I intend use string and reverse function to build a simple application in python for DNA (presented by A,G,G, and T) mutation when one of its substring is reversed during the replication process. The reversal happens what are termed inverted pairs. For instance, if the pattern TGAA is later followed byinverted pattern AAGT, the slice of DNA delimited by those patterns could be inverted and reattached. Something's like
TGAACATTAAGT
will be inversed to
TGAATTACAAGT
---------------------------------
The program is simple but I don't know how to manipulate the string to make it be reversed in the way I would like to. Here is my incomplete design:
[code=python]
DNAsequence = raw_input('Plea se enter a DNA sequence :') #First, people have to enter a DNA sequence (A,C,G,T only).
pattern= raw_input('plea se enter the pattern :') # Second, people have to enter the pattern (also A,C,G,T only) this limited to 4 characters.
MutatedDNA ='......' #this is the output I would like to have, a mutated sequence of DNA
[/code]
TGAACATTAAGT
will be inversed to
TGAATTACAAGT
---------------------------------
The program is simple but I don't know how to manipulate the string to make it be reversed in the way I would like to. Here is my incomplete design:
[code=python]
DNAsequence = raw_input('Plea se enter a DNA sequence :') #First, people have to enter a DNA sequence (A,C,G,T only).
pattern= raw_input('plea se enter the pattern :') # Second, people have to enter the pattern (also A,C,G,T only) this limited to 4 characters.
MutatedDNA ='......' #this is the output I would like to have, a mutated sequence of DNA
[/code]
Comment