Goosang-Yu/genet

Make python function of ViennaRNA fold_compound

Closed this issue ยท 7 comments

  1. Function fold_compound of ViennaRNA can not be used in Windows OS
  2. For only this function, we should ViennaRNA, which can make some installation error.

Example usage:

from RNA import fold_compound

InputSeq = 'ACGCGTATTATGCGCAGCTATC' # sequence (str)

sDBSeq, fMFE = fold_compound(InputSeq).mfe() # fMFE is what we want to get

Could we make python function which can return same output of fold_compound?

Source code (C lang):
https://github.com/ViennaRNA/ViennaRNA/blob/master/src/ViennaRNA/fold_compound.c

Can you tell me your opinion, @ntfargo ?

Please also see ViennaRNA/interfaces/mfe.dox

/**

@fn float vrna_mfe(vrna_fold_compound_t *fc, char *structure)
@scripting
@parblock
This function is attached as method `mfe()` to objects of type `fold_compound`.
The parameter @p structure is returned along with the MFE und must not be provided.
See e.g. @rstinline:py:meth:`RNA.fold_compound.mfe()` in the :doc:`/api_python`@endrst.
@endparblock

Okay thanks i will check!

Okay so, as i see ViennaRNA is primarily designed for unix-based systems.

I need more time to research this issue; maybe I will make a sub-repository to test these things.

&attachment
https://www.tbi.univie.ac.at/RNA/ViennaRNA/refman/examples/python.html
https://www.tbi.univie.ac.at/RNA/download/win/windows/Install-ViennaRNA-2.6.2_64bit.exe (precompiled Binary Package / PATH variable needs to add system vars)

Thank you @ntfargo ,

As you mentioned, ViennaRNA has a Python API, which I've been using so far.
However, this API has two issues:

  1. It doesn't install on Windows OS because there are no precompiled versions available for Windows.
    2/ ViennaRNA sometimes fails to install or import the module (import RNA), and I'm not sure why.

One more thing that concerns me is that calculating from DNA/RNA sequence (input; str) -> fold_compound -> MFE is a bit slow. What I need is only the MFE, so it would be great if I could create a compact function that calculates just the MFE, removing any unnecessary calculation steps to speed it up.

If it's too complicated, just making ViennaRNA's fold_compound.mfe() work on Windows OS would be a significant help.
I'll keep looking into it, and I'll get back to you.

Thank you!

Creating a special fold_compound.mfe() can be quite complex and challenging, but with the right effort and determination, it's possible to develop a highly stable algorithm. However, for a smoother experience on Windows OS, I still recommend using Windows Subsystem for Linux (WSL).

Any news about this idea?

No idea for ViennaRNA implementation with only python.
The best way is using WLS as you said or not using RNA 2ndary folding as DeepPrime feature.