Question: Consecutive Window Rna Folding
0
gravatar for MarkR
6.5 years ago by
MarkR0
MarkR0 wrote:

I wish to use a library to give me all consecutive folded windows of an RNA. It seems like RNALfold from the ViennaRNA suite cherry picks a few structures and displays them. What I want is the whole set of windows, from index 0..end-windowSize. Is there any library that can provide this? Or a way I can make RNALfold give me this information?

rna structure secondary • 1.2k views
ADD COMMENTlink modified 10 weeks ago by jtimmons30 • written 6.5 years ago by MarkR0
0
gravatar for jtimmons
10 weeks ago by
jtimmons30
Boston
jtimmons30 wrote:

Hello. Reviving another close-for-a-bit BioStars thread to share that I made a DNA/RNA folding library that has a function for something like this. The library, seqfold, is based on the same algo as mfold/unafold, etc, and returns comparable minimum free energies (see: examples). seqfold.dg_cache is the function that generates a cache that could be used for window querying.

Documentation

https://github.com/Lattice-Automation/seqfold

Examples

https://github.com/Lattice-Automation/seqfold/tree/master/examples

Python

The example below includes dg_cache which is the function for generating a 2D matrix for querying windows, as you asked about in your question.

from seqfold import dg, dg_cache

# just returns minimum free energy
dg("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC", temp = 37.0)  # -12.94

# `dg_cache` returns a 2D array where each (i,j) combination returns the MFE from i to j inclusive
cache: List[List[float]] = dg_cache("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")

CLI

seqfold has a CLI but I can't think of an intuitive way to expose this 2D matrix other than to write it to a CSV externally. If anyone wants a windows/cache function exposed through a CLI let me know and I'll add something like CSV export (so this is available through the CLI in addition to the Python interface).

ADD COMMENTlink modified 10 weeks ago • written 10 weeks ago by jtimmons30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1100 users visited in the last hour