2

I am relatively new to Python,so I would very much appreciate any constructive feedback on my code and would really appreciate it if you could guide me in the right direction if I a wrong.

So I have a designed a program in Python that takes in a DNA sequence, basically a string comprising only four letters (A,T,C and G) and finds the complement of the sequence. Thereafter, it takes the two sequences and divides them into fragments of certain length such that each fragment overlaps with the neighboring fragment by same number of letters.

For instance, it would take in DNA sequence, say s1, and produce the following output for its complement and fragments.

s1 = "AGCCCTCCAGGACAGGCTGCATCAGAAGAGGCCATCAAGCAGGTCTGTTCCAAGGGCCTTTGCGTCAGGT"

print(dna_complement(s1))
>>>> complement = TCGGGAGGTCCTGTCCGACGTAGTCTTCTCCGGTAGTTCGTCCAGACAAGGTTCCCGGAAACGCAGTCCA
print(dna_fragment(s1, oligo_size=8, oligo_overlap=3)):
>>>> AGCCCTCC..GACAGGCT..ATCAGAAG..GCCATCAA..AGGTCTGT..CAAGGGCC..TGCGTCAGGT
     .....AGGTCCTG..CGACGTAG..TTCTCCGG..GTTCGTCC..ACAAGGTT..CGGAAACG.......

As you can see in the above example, the output of dna_fragmentation is two strings that share an oligo overlap of 3 base pairs ( i.e. three letters) and the size of oligos is at minimum 8 base pairs.

Hereafter, the program tries to determine the value for specific parameter (Tm) for the overlapping region (Tm is the temperature at which half of the overlapping region is coiled and other half is in form of a DNA duplex). Now the program must try to change the length of overlapping region such that the Tm for the overlapping regions must be approximately the same for all overlapping regions. I have successfully completed the former tasks by essentially storing the oligos (fragments) in a list and using list comprehension to find the Tm for each oligo; however, I have failed in accomplishing the latter task.

So my question is how can I take the overlapping region, store it in a variable and then change its length so that it matches a certain Tm?

0 Answers0