Sampling#
You can use Boltzmann sampling to approximate expected distances using either the Command Line Interface or the Python API
Python API#
The Python API is fully compatible with the ViennaRNA Python fold compound. Thus, you can set up a fold compound and use
the sample_fc()
function to get a numpy array containing all pairwise distances. Have
look into the function documentation for details and examples. If you are only interested in the distance between two
nucleotides i
and j
, you can speed up this procedure by using sample_distance_ij()
.
Command Line Interface#
For approximation via the CLI you need a FASTA file with your sequences in it. This is passed via the --input
flag. The File specified in --output
will contain a pickled python dictionary with the FASTA identifiers as keys
and numpy arrays containing all pairwise expected distances as values.
RNAdist sample --input FASTA --output OUTPUT --num_threads 2 --nr_samples 1000
In contrast to the Python API it does not support constraint folding. To see the documentation of how to visualize the output and further CLI flagst have a look into the CLI documentation RNAdist Command Line Interface.