[BioPython] Tm for DNA/DNA and RNA/RNA that works!

Brad Chapman chapmanb at uga.edu
Tue Feb 24 19:30:51 EST 2004


Hi Sebastian;

> This version is ready to upload to CVS. It was check against 
> http://bioweb.pasteur.fr/seqanal/interfaces/melting.html
> It work for DNA/DNA and RNA/RNA. It uses the Santalucia salt correction 
> and the inicialization correction.

Great -- thanks much for continuing to look into this and get it
finished. I've checked it into CVS as Bio/SeqUtils/MeltingTemp.py.
Please check that I didn't mess anything up (I wrapped the lines to
less than 80 characters and also commented out some print
statements) and it still works fine for you.

A couple of comments on the code -- nothing serious but just some
points which might be helpful and make it easier to read:

1. In tercorr, the code might be a little clearer if you started off
the function by defining "constants" like:

STRONG_BONDS = ["G", "C"]
WEAK_BONDS = ["A", "T", "U"]

Then you could write code like:
if stri[0] in STRONG_BONDS:
    # adjust parameters
elif stri[0] in WEAK_BONDS:
    # adjust parameters
else:
    raise ValueError("What is this")

2. It seems like the calculation of vh and vs involve adding up
counts of dinucleotides followed by multiplication by some kind of
adjusting value. All of the adding and multiplying might be clearer
(and easier to debug) if you did something like:

adjust_info = [("AA", 7.9), ("TT", 7.9), ("AT", 7.2)] # and so on
for dinucleotide, adjust_value in adjust_info:
   vh += overcount(sup, dinucleotide) * adjust_value

Anyways, just some random ideas that popped out of my brain when
looking at this. If you make changes in the future please submit 
patches against the CVS version and I'll be happy to check them in.

Thanks again for the work and your interest in this!
Brad


More information about the BioPython mailing list