This provides a program to compute a, c slices of the RNA polytope using viennaRNA, as well as the BEES ensemble.
The first portion will describe how to construct the BEES and REPS ensemble, which are wrappers of the param_partition algorithm. For those who are only interested in the parameter partition algorithm should refer to the second half.
This requires the ViennaRNA python package v2.7.0. It comes either from a full install of ViennaRNA or can be installed on its own with pip here.
It also requires numpy, scipy, matplotlib and pandas .
We have put all the required packages into requirement.txt. The following can be used to create the virtual environment as well as install all the dependencies. ViennaRNA v2.7.0 requires python to be
conda create -n polytope python=3.11
conda activate polytope
pip install requirement.txt
- In order to run this program, you will need a command line installation of Vienna RNA (not just python), and add it to path. This program will interact with
RNAeval, which compute the energy breakdown of the structure. This is unfortunately not available with the python interface of Vienna RNA.
- The REPS and BEES ensemble is constructed via BEES_param_partition.py. The inputs are identical to the param_partition.py.
- In order to run this program, you will need a command line installation of Vienna RNA (not just python), and add it to path. This program will interact with
RNAeval, which compute the energy breakdown of the structure. This is unfortunately not available with the python interface of Vienna RNA.
usage: TL_HPI [-h] [-b B] [--timing] [--unskewed] [--bounds n n n n] [--LP] [-d n] FASTA_PATH SAVE_PATH
Computes a,c slice for an RNA polytope
positional arguments:
FASTA_PATH Path to fasta file.
SAVE_PATH Directory to save output files.
options:
-h, --help show this help message and exit
-b B b value for computation. Default 0.
--timing Save timing data as SAVE_PATH/seqname_timing.txt
--unskewed Compute in unskewed space (i.e. excess branching)
--bounds n n n n Integer bounds in dckals/mol for slice in format a_min a_max c_min c_max. Default 0 10000 -10000
10000.
--LP Compute without --noLP option in vienna
-d n Set dandle mode (1 or 2).
-
All output files will start with the fasta file name, not the sequence name.
-
The minimum input required is the fasta path, and the output path. As an example,
python BEES_param_partition.py tRNA_example.fasta ./example/will generate- example/tRNA_example/tRNA_example_sig_structs.txt: all branching signatures
- example/tRNA_example/tRNA_example_geometry.txt: the geometry
- example/tRNA_example/tRNA_example_REPS_features.csv: REPS structure with energy breakdown
- example/tRNA_example/tRNA_example_BEES_features.csv: BEES structure with energy breakdown
-
The CSV will contain all the structures in REPS and BEES ensemble, as well as the polytope region and the energy breakdown.
-
-bwill pick a slice. All computation for the papers have used$b = 0$ . -
--unskewed: generates a more interpretable region. -
--bounds: set the A-C boundary. The recent paper has used the bound -2048 2048 -2048 2048, which corresponds to$-2048 \le a \le 2048$ and$-2048 \le c \le 2048$ . Note that that these values are in decical, and not in kcal. You can divide by 100 to obtain the kcal values. -
--LP: this allows lonely pairs in the partition function. Refer to ViennaRNA for more detailed description of the difference. Our experiment have not toggled this option. -
-d: dangling options. By default, we choose Vienna's default option, which is 2. Refer to Vienna RNA for details on the difference between d1 and d2. -
For our BEES paper, we have used
python BEES_param_partition.py tRNA_example.fasta ./example/ --bounds -2048 2048 -2048 2048 -d 2 -b 0 --unskewed
The main algorithm is param_partition.py. These are the options:
usage: TL_HPI [-h] [-b B] [--geometry] [--timing] [--unskewed] [--bounds n n n n] [--LP] [-d n]
FASTA_PATH SAVE_PATH
Computes a,c slice for an RNA polytope
positional arguments:
FASTA_PATH Path to fasta file.
SAVE_PATH Directory to save output files.
options:
-h, --help show this help message and exit
-b B b value for computation. Default 0.
--geometry Save geometry of regions as SAVE_PATH/seqname_geometry.txt.
--timing Save timing data as SAVE_PATH/seqname_timing.txt
--unskewed Compute in unskewed space (i.e. excess branching)
--bounds n n n n Integer bounds in dckals/mol for slice in format a_min a_max c_min c_max. Default a>=0 plane (i.e. 0, 10000, -10000, 10000).
--LP Compute without --noLP option in viennaRNA.
-d n Set dandle mode (1 or 2).
- By default param_partition will save a file seqname_sig_structs.txt consiting of all the signatures and corresponding structures found within the designated frame.
Adding --geometry and --timing saves additional files. For instance,
python param_partition.py tRNA_example.fasta save/files/here --geometry --timing
will compute the a,c slice of the a >= plane and save files save/files/here/tRNA_example_geometry.txt, save/files/here/tRNA_example_timing.txt, and the default save/files/here/tRNA_example_sig_structs.txt
The directory partition_algo_testing contains the runTL2ggb.sage file which uses sagemath to create geogebra files for visualizing the computed partiton.