Closed MathiasCharconnet closed 2 months ago
From python side, I would recommend using RNA.fold_compound where you can pass the model as an argument For example
md = RNA.md(temperature=25, salt=0.1)
fc = RNA.fold_compout(your_sequence, md)
fc.mfe()
@anthonyhtyao Why do you recommend using fold_compound ? I've seen rna_cofold was deprecated which might be the reason, however when I used RNA.cvar.salt=0.1 I did obtained some changes in interaction energy and secondary structure folding which did make sense. Any idea on using the jobs option ? I'm trying to make the simulation faster by optimizing the number of cores I'm using on a server.
Functions provided in ViennaRNA are wrapped as member functions of RNA.fold_compound in RNAlib. You can see from its documentation here. This aims to simplify the use of RNAlib from Python.
Unfortunately, jobs option is not provided in RNAlib. One needs to write the parallel calculation on their own.
@anthonyhtyao Why do you recommend using fold_compound ? I've seen rna_cofold was deprecated which might be the reason, however when I used RNA.cvar.salt=0.1 I did obtained some changes in interaction energy and secondary structure folding which did make sense. Any idea on using the jobs option ? I'm trying to make the simulation faster by optimizing the number of cores I'm using on a server.
Indeed, setting the global RNA.cvar.salt
to a different value will change all subsequent computations to use the updated salt concentration. What @anthonyhtyao suggested was to use the v3.0 API instead of the 'simple' API to allow for concurrent computations even with different model setttings. Using the fold_compound
object and the methods attached separates the model and predictions for each object from the global defaults. It is therefore the best choice if you want to go for parallel/concurrent computations.
I second @anthonyhtyao with his second answer: There is no parallelization implemented in the ViennaRNA library except for some highly special algorithms. If you want to simulate the -j/--jobs
option of RNAfold
or RNAcofold
, you need to write you own threaded code.
closing this issue since it seems resolved... Feel free to re-open if necessary!
Contact Details
mathias.charconnet@live.fr
What happened?
Hi,
I have been using viennaRNA using sourcecode and python, and there are several interesting options that I could use with the source and that I would like to be using with python scripts, I was wondering whether this was possible. Here are some of the options:
--salt= --> I remember that temperature can be changed using RNA.cvar.temperature=25, can salt concentration be changed using RNA.cvar.salt=0.1
--jobs=4; wanted to improve my calculation speed when using python and was wondering if this option could be used
Best, Mathias Charconnet.
Version
2.6.x (Default)
Which operating system are you using?
Linux (Default)
Does the problem occur with one of our executable program or the C-library?
No response
Relevant log output
No response
Code of Conduct