RNAFold4J is a port of the RNAFold program from the ViennaRNA package (v1.8.5) for Java. It requires no external depencies and is hence platform independent. In addition, an API is available which allows for the integration of RNAFold4J into bioinformatics pipelines in a programmatic manner.
Disclaimer: RNAFold is implemented and developed by Ivo L Hofacker et al. as part of the ViennaRNA package. All intellectual credits of this work go to the original authors and the Institute for Theoretical Chemistry of the University of Vienna. My only contribution is the adaptation of the C source code to Java.
java -jar rnafold4j [-p[0|2]] [-C] [-T temp] [-4] [-d[2|3]] [-noGU] [-noCloseGU]
[-noLP] [-e e_set] [-nsp pairs] [-S scale]
[-noconv] [-circ] [-o outputFolder]
where the individual options correspond to the RNAFold parameters (see the official manual for a detailed description).
- MEA prediction is currently not implemented.
- Dot plots are currently not implemented. Instead, base pair probabilities are written to text files when using the
-p
option.
If you want to integrate RNAFold4J
in your own pipeline, you can use the provided API as such
import rnafold4j.MFEData;
import rnafold4j.RNAFoldAPI;
public static void main(String[] args) {
// The sequence to be predicted
byte[] seq = new String("GUGACGUGUGCAAAUGUGACGUGUGCAAAUGUGACGUGUGCAAAU").getBytes();
// Create a new instance of RNAFold4J
RNAFoldAPI rfa = new RNAFoldAPI();
// Predict the MFE and corresponding structure
MFEData mfe = rfa.getMFE(seq);
System.out.println(String.format("Sequence: %s\nStructure: %s \nMFE: %f", new String(seq), new String(mfe.structure), mfe.mfe));
// Predict the base pair probability matrix (equivalent to using the -p option).
// Returns linearized upper trianguar matrix
double[] bppm = rfa.getBppm(seq);
}
Please see the release section for the most recent version of RNAFold4J.
RNAFold4j is a maven project:
git clone https://github.com/drivenbyentropy/rnafold4j.git
cd rnafold4j
mvn package
The compiled jar file can then be found in target\rnafold4j.jar