Package: seqfold
seqfoldPredict the minimum free energy structure of nucleic acids.seqfoldis an implementation of theZuker, 1981dynamic programming algorithm, the basis forUNAFold/mfold, with energy functions fromSantaLucia, 2004(DNA) andTurner, 2009(RNA).Installationpypy3 (strongly recommended)pypy3-mensurepip
pypy3-mpipinstallseqfoldFor a 200bp sequence (on my laptop),pypy3takes 2.5 seconds versus 15 seconds for CPython.Default pippipinstallseqfoldUsagePythonfromseqfoldimportfold,dg,dg_cache,dot_bracket# just returns minimum free energydg("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC",temp=37.0)# -13.4# `fold` returns a list of `seqfold.Struct` from the minimum free energy structurestructs=fold("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")print(sum(s.eforsinstructs))# -13.4, same as dg()forstructinstructs:print(struct)# prints the i, j, ddg, and description of each structure# `dg_cache` returns a 2D array where each (i,j) combination returns the MFE from i to j inclusivecache=dg_cache("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")# `dot_bracket` returns a dot_bracket representation of the foldingprint(dot_bracket(structs))# ((((((((.((((......))))..((((.......)))).))))))))CLIusage: seqfold [-h] [-t FLOAT] [-d] [-r] [--version] SEQ

Predict the minimum free energy (kcal/mol) of a nucleic acid sequence

positional arguments:
  SEQ                   nucleic acid sequence to fold

optional arguments:
  -h, --help            show this help message and exit
  -t FLOAT, --celcius FLOAT
                        temperature in Celsius
  -d, --dot-bracket     write a dot-bracket of the MFE folding to stdout
  -r, --sub-structures  write each substructure of the MFE folding to stdout
  --version             show program's version number and exitExamples$seqfoldGGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC--celcius32-15.3$seqfoldGGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC--celcius32--dot-bracket--sub-structures
GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC((((((((.((((......))))..((((.......)))).))))))))ijddgdescription048-1.9STACK:GG/CC147-1.9STACK:GG/CC246-1.4STACK:GA/CT345-1.4STACK:AG/TC444-1.9STACK:GG/CC543-1.6STACK:GT/CA642-1.4STACK:TC/AG741-0.5BIFURCATION:4n/3h922-1.1STACK:TT/AA1021-0.7STACK:TA/AT1120-1.6STACK:AC/TG12193.0HAIRPIN:CA/GG2539-1.9STACK:CC/GG2638-2.3STACK:CG/GC2737-1.9STACK:GG/CC28363.2HAIRPIN:GT/CT
-15.3NotesThe type of nucleic acid, DNA or RNA, is inferred from the input sequence.seqfoldis case-insensitive with the input sequence.The default temperature is 37 degrees Celsius for both the Python and CLI interface.MotivationSecondary structure prediction is used for makingPCR primers, designingoligos for MAGE, and tuningRBS expression rates.WhileUNAFoldandmfoldare the most widely used applications for nucleic acid secondary structure prediction, their format and license are restrictive.seqfoldis meant to be an open-source, minimalist alternative for predicting minimum free energy secondary structure.seqfoldmfoldUNAFoldLicenseMITAcademic Non-commercial$200-36,000OSLinux, MacOS, WindowsLinux, MacOSLinux, MacOS, WindowsFormatpython, CLI pythonCLI binaryCLI binaryDependenciesnone(mfold_util)Perl, (gnuplot, glut/OpenGL)Graphicalnoyes (output)yes (output)HeterodimersnoyesyesConstraintsnoyesyesCitationsPapers, and how they helped in developingseqfold, are listed below.Nussinov, 1980Nussinov, Ruth, and Ann B. Jacobson. "Fast algorithm for predicting the secondary structure of single-stranded RNA." Proceedings of the National Academy of Sciences 77.11 (1980): 6309-6313.Framework for the dynamic programming approach. It has a conceptually helpful "Maximal Matching" example that demonstrates the approach on a simple sequence with only matched or unmatched bp.Zuker, 1981Zuker, Michael, and Patrick Stiegler. "Optimal computer folding of large RNA sequences using thermodynamics and auxiliary information." Nucleic acids research 9.1 (1981): 133-148.The most cited paper in this space. Extends further thanNussinov, 1980with a nearest neighbor approach to energies and a consideration of each of stack, bulge, internal loop, and hairpin. Their data structure and traceback method are both more intuitive thanNussinov, 1980.Jaeger, 1989Jaeger, John A., Douglas H. Turner, and Michael Zuker. "Improved predictions of secondary structures for RNA." Proceedings of the National Academy of Sciences 86.20 (1989): 7706-7710.Zuker and colleagues expand on the 1981 paper to incorporate penalties for multibranched loops and dangling ends.SantaLucia, 2004SantaLucia Jr, John, and Donald Hicks. "The thermodynamics of DNA structural motifs." Annu. Rev. Biophys. Biomol. Struct. 33 (2004): 415-440.The paper from which almost every DNA energy function inseqfoldcomes from (with the exception of multibranch loops). Provides neighbor entropies and enthalpies for stacks, mismatching stacks, terminal stacks, and dangling stacks. Ditto for bulges, internal loops, and hairpins.Turner, 2009Turner, Douglas H., and David H. Mathews. "NNDB: the nearest neighbor parameter database for predicting stability of nucleic acid secondary structure." Nucleic acids research 38.suppl_1 (2009): D280-D282.Source of RNA nearest neighbor change in entropy and enthalpy parameter data. In/data.Ward, 2017Ward, M., Datta, A., Wise, M., & Mathews, D. H. (2017). Advanced multi-loop algorithms for RNA secondary structure prediction reveal that the simplest model is best. Nucleic acids research, 45(14), 8541-8550.An investigation of energy functions for multibranch loops that validates the simple linear approach employed byJaeger, 1989that keeps runtime withinO(n³).