Ejemplo n.º 1
0
def invert_sequence(chrSeq, start, stop):

    invert = chrSeq[int(start) - 1:int(stop)]
    MutableSeq.reverse_complement(invert)
    begin = MutableSeq.__add__(chrSeq[:int(start) - 1], invert)
    chrSeq = MutableSeq.__add__(begin, chrSeq[int(stop):])
    return chrSeq
Ejemplo n.º 2
0
def duplicate_sequence(chrSeq,
                       dupStart,
                       dupStop,
                       insertLoc,
                       numDup=1,
                       invert=False):

    duplication = str(chrSeq[int(dupStart) - 1:int(dupStop)]) * int(numDup)
    if invert == True:
        MutableSeq.reverse(duplication)
    begin = MutableSeq.__add__(chrSeq[:int(insertLoc)], duplication)
    chrSeq = MutableSeq.__add__(begin, chrSeq[int(insertLoc):])
    return chrSeq
Ejemplo n.º 3
0
def insert_sequence(chrSeq, insertLoc, insertSeq):

    begin = MutableSeq.__add__(chrSeq[:int(insertLoc)], insertSeq)
    chrSeq = MutableSeq.__add__(begin, chrSeq[int(insertLoc):])
    return chrSeq