Biowulf High Performance Computing at the NIH
mfold on Biowulf

MFOLD performs RNA and DNA secondary structure prediction using nearest neighbor thermodynamic rules. It can accept input in Genbank, GCG and Fasta formats.


See the mfold references page on the mfold site for a detailed list of references.

Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session to use the application. mfold can process a single sequence in genbank, embl, or fasta format. Fasta files with more than one sequence will result in errors. As an example, let's analyze a yeast tRNA-phe (using a simple constraint file which forces base pairing between the first 7 NTs and their complementary bases from the known structure):

[user@biowulf]$ sinteractive
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144]$ module load mfold
[user@cn3144]$ cp ${MFOLD_TEST_DATA:-none}/* .
[user@cn3144]$ mfold SEQ=Phe-GAA-1-1-nointron.fa AUX=Phe-GAA-1-1-nointron.constraint NA=RNA
mfold version 3.6
SlvTUE.pnt created.
Sequence length is 73
Folding at 37 degrees using version 3.0 dat files.
End of Fill
Save file created using nafold.
Minimum folding energy is -25.40 kcal/mol.
Energy increment is 1.27 kcal/mol.
H-num file created from plot file.
Suboptimal foldings created.
Energy dot plot created.
Free energies re-evaluated using efn2 and added to ct file.
1     2

Structure plots generated.
All done.

mfold will generate output files in different formats for the energy dot plot, the optimal structure, and suboptimal structures (if any). The command above, for example, produces these two graphs amongst others:

Energy dot plotOptimal structure

The loop containing the 'GAA' anticodon is at the top. See the output section of the mfold manual for more details

Remember to exit the session when you are done.

[user@cn3144]$ exit
salloc.exe: Relinquishing job allocation 46116226

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. similar to the following example:

#! /bin/bash

module load mfold  || exit 2

mkdir -p mfold.out
cd mfold.out

# create separate directories/files for each
# sequence in the fasta file
awk '
    /^>/ {
        name = substr($1, 2)
        file = sprintf("mfold_%s/%s.fa", name, name)
        system(sprintf("mkdir mfold_%s", name))
    {print > file}
' $MFA

# run mfold on all the sequences
for d in ./mfold_*; do
    cd $d && mfold SEQ=${d#./mfold_}.fa NA=RNA && cd ..

Submit this job using the Slurm sbatch command.

sbatch --cpus-per-task=2 --mem=2g
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. mfold.swarm). For example:

mfold SEQ=Saccharomyces_cerevisiae_Ala-AGC-1-10.fa NA=RNA
mfold SEQ=Saccharomyces_cerevisiae_Ala-AGC-1-11.fa NA=RNA
mfold SEQ=Saccharomyces_cerevisiae_Ala-AGC-1-1.fa NA=RNA
mfold SEQ=Saccharomyces_cerevisiae_Ala-AGC-1-2.fa NA=RNA

Submit this job using the swarm command.

swarm -f mfold.swarm -g 2 -t 1 -p 2 --module mfold
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module mfold Loads the mfold module for each subjob in the swarm