Biopython: Add DNA/RNA secondary structure prediction, dg calculation?

Created on 5 Sep 2020  Â·  9Comments  Â·  Source: biopython/biopython

Awhile ago I made a biopython issue mentioning a small bug I saw in the DNA nearest neighbor values. I caught that because I was using biopython's DNA nearest neighbor energies to bootstrap a library I was working on: seqfold. It's an open-source implementation of the early 80s algorithms for secondary structure prediction of nucleic acids by free energy minimization.

I'm writing to ask whether it could be incorporated into Biopython. I think some reasons that it could benefit Biopython are that:

  • users often use secondary structure predictions

    • for their DNA assembly workflows (it affects Gibson assembly, yeast assembly if the ends form dimers)

    • to avoid bad primers

    • RNA expression tuning

  • the existing standard libraries for DNA/RNA folding (unafold/mfold) are, imo, a PITA to get, setup, use (largely because of licenses, but also just finding how to get them is wonky)
  • with secondary structure, Biopython could also do some of its own primer design (example of a personal implementation)

If this seems outside of the scope of features that are Biopython's roadmap, I totally get it and don't mind being told no. I just wanted to mention it because Biopython obviously has a huge user-base, and I think that a native python solution to DNA/RNA folding would be worthwhile.

All 9 comments

I have been using ViennaRNA for RNA secondary structure calculations. It comes with a Python interface.
Best,-Michiel

On Sunday, September 6, 2020, 12:48:14 AM GMT+9, Joshua Timmons <[email protected]> wrote:

Awhile ago I made a biopython issue mentioning a small bug I saw in the DNA nearest neighbor values. I caught that because I was using biopython's DNA nearest neighbor energies to bootstrap a library I was working on: seqfold. It's an open-source implementation of the early 80s algorithms for secondary structure prediction of nucleic acids by free energy minimization.

I'm writing to ask whether it could be incorporated into Biopython. I think some reasons that it could benefit Biopython are that:

  • users often use secondary structure predictions

    • for their DNA assembly workflows (it affects Gibson assembly, yeast assembly if the ends form dimers)
    • to avoid bad primers
    • RNA expression tuning
  • the existing standard libraries for DNA/RNA folding (unafold/mfold) are, imo, a PITA to get, setup, use (largely because of licenses, but also just finding how to get them is wonky)

  • with secondary structure, Biopython could also do some of its own primer design (example of a personal implementation)

If this seems outside of the scope of features that are Biopython's roadmap, I totally get it and don't mind being told no. I just wanted to mention it because Biopython obviously has a huge user-base, and I think that a native python solution to DNA/RNA folding would be worthwhile.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

is that part of BioPython? I'm aware that there are Python interfaces for existing secondary structure libraries

@JJTimmons No it isn't. It's available here: https://www.tbi.univie.ac.at/RNA/
Simple usage from Python is as follows:

>>> import RNA
>>> RNA.fold("GGGGGGGGGGGGGGUUUUUUCCCCCCCCCCCCC")
['((((((((((((((.....))))))))))))))', -36.400001525878906]

but it has many more capabilities.

I just checked the license and saw this:

If you want to include this software in a commercial product, please contact the authors. 

I get that doesn't matter if you're in academia, but that's a deal breaker for small and exploratory commercial projects

point taken, there are existing and more extensive tools (eg Vienna, unafold, mfold) and the primary audience is generally okay with their licenses

This is completely outside my area of expertise but I'd like to make a comment. If you have an implementation that fits well with biopython and is robust, even if it doesn't have the latest methods, it would be a good addition. It's the same with our pairwise alignment code - plenty of solutions out there, but it's nice to have it integrated.

My only concern would be maintainability but if you're happy to look over that module, I wouldn't see what would be the downside of including such a module.

Looks quite interesting, and thanks for the link to your primer design solution. Having something permissively licensed like this integrated could be useful indeed, even if, as Joao says, there may be more full-featured solutions out there.

I'm also open to have this functionality added to Biopython. I had a look in your code and found that in some places it contains much what is already in MeltingTemp. I can think of re-structuring MeltingTemp so that it is possible to use the underlying methods, e.g. to return deltaH/deltaS directly so that you can avoid unnecessary code duplication.
What do we need to change in MeltingTemp for your requirements?

I agree that there's significant overlap with MeltingTemp: I think the DNA energies were a near copy-paste into dna.py (thank you, by the way, for those). The tm.py file is also entirely almost based on MeltingTemp (the only difference being _tm_cache that I use for primers). In the file with the secondary folding (fold.py) I don't know that there's much that could be re-used right now.

I'd hope to look and discuss a bit more, but maybe the RNA and DNA energies could be moved to a shared file like SeqUtils/FreeEnergies. It would contain your existing DNA nearest neighbor tables, plus the RNA ddgs, and the ddgs from hairpins, bulges, branching. SeqUtils/MeltingTemp would import from that energies file. And the new module, SeqUtils/SecondaryStructure (or something along those lines), would as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wdecoster picture wdecoster  Â·  9Comments

benfulton picture benfulton  Â·  11Comments

peterjc picture peterjc  Â·  5Comments

peterjc picture peterjc  Â·  8Comments

sbliven picture sbliven  Â·  11Comments