#include <ProbScan.h>
Public Member Functions | |
ProbScan (std::string sequence, bool isRNA=true) | |
Constructor - user provides a sequence as a c string. | |
ProbScan (const char filename[], bool from_sequence_file, bool isRNA=true) | |
Constructor - user provides a filename for existing file as a c string. | |
double | probability_of_hairpin (int i, int j) |
Returns probability of a hairpin closed at a specific position. | |
std::vector< hairpin_t > | probability_of_all_hairpins (int min, int max, double threshold) |
Calculates the probabilities of all possible hairpins in this sequence. | |
double | probability_of_internal_loop (int i, int j, int k, int l) |
Returns probability of an internal loop or bulge loop closed at a specific position. | |
std::vector< internal_loop_t > | probability_of_all_internal_loops (double threshold, std::string mode=std::string("both")) |
Calculates the probabilities of all possible internal loops and/or bulge loops in this sequence. | |
double | probability_of_stack (int i, int j) |
double | probability_of_helix (const int i, const int j, const int how_many_stacks) |
Calculates probability of an helix at a specific position. | |
std::vector< basestack_t > | probability_of_all_helices (double threshold, int length) |
Calculates the probabilities of all possible helices in this sequence of a specific length. | |
double | probability_of_multibranch_loop (const multibranch_loop_t &mb) |
Calculates probability of a multibranch loop at a specific position. | |
Private Member Functions | |
PFPRECISION | equilibrium_constant_for_multibranch_loop (const multibranch_loop_t &) |
std::vector< mb_element > | construct_mb_element_array (const multibranch_loop_t &) |
ProbScan::ProbScan | ( | std::string | sequence, | |
bool | isRNA = true | |||
) |
Constructor - user provides a sequence as a c string.
The partition function will be calculated. If the sequence is long, this may take some time. Input sequence should contain A,C,G,T,U,a,c,g,t,u,x,X. Capitalization makes no difference. T=t=u=U. If IsRNA is true, the backbone is RNA, so U is assumed. If IsRNA is false, the backbone is DNA, so T is assumed. x=X= nucleotide that neither stacks nor pairs. For now, any unknown nuc is considered 'X'. Note that sequences will subsequently be indexed starting at 1 (like a biologist), so that the 0th position in the sequence array will be nucleotide 1.
sequence | is a NULL terminated c string containing the nucleotide sequence. | |
isRNA | is a bool that indicates whether this sequence is RNA or DNA. true=RNA. false=DNA. Default is true. |
ProbScan::ProbScan | ( | const char | filename[], | |
bool | from_sequence_file, | |||
bool | isRNA = true | |||
) |
Constructor - user provides a filename for existing file as a c string.
The existing file, specified by filename, can either be a ct file, a sequence, or an RNAstructure save file. Therefore, the user provides a flag for the file: type = 1 => .ct file, type = 2 => .seq file, type = 3 => partition function save (.pfs) file, type = 4 => folding save file (.sav). If the input file is ont a partition function save file, the partition function will be calculated. If the sequence is long, this may take some time. This constructor generates internal error codes that can be accessed by GetErrorCode() after the constructor is called. 0 = no error. The errorcode can be resolved to a c string using GetErrorMessage. Note that the contructor needs to be explicitly told, via IsRNA, what the backbone is because files do not store this information. Note also that save files explicitly store the thermodynamic parameters, therefore changing the backbone type as compaared to the original calculation will not change structure predictions.
filename | is null terminated c string containing the path to the input file. | |
from_sequence_file | is a bool which tells the constructor whether we are initializing from a sequence file, in which case the partition function must be calculated | |
isRNA | is a bool that indicates whether this sequence is RNA or DNA. true=RNA. false=DNA. Default is true. |
vector< mb_element > ProbScan::construct_mb_element_array | ( | const multibranch_loop_t & | mb | ) | [private] |
PFPRECISION ProbScan::equilibrium_constant_for_multibranch_loop | ( | const multibranch_loop_t & | mb | ) | [private] |
vector< hairpin_t > ProbScan::probability_of_all_hairpins | ( | int | min, | |
int | max, | |||
double | threshold | |||
) |
Calculates the probabilities of all possible hairpins in this sequence.
min | The minimum size of a hairpin | |
max | The maximum size of a hairpin | |
threshold | The minimum probability for candidate hairpins |
std::vector< basestack_t > ProbScan::probability_of_all_helices | ( | double | threshold, | |
int | length | |||
) |
Calculates the probabilities of all possible helices in this sequence of a specific length.
threshold | the minimum probability of candidate helices | |
length | the number of base pair stacks to search for |
std::vector<internal_loop_t> ProbScan::probability_of_all_internal_loops | ( | double | threshold, | |
std::string | mode = std::string("both") | |||
) |
Calculates the probabilities of all possible internal loops and/or bulge loops in this sequence.
threshold | the minimum probability of candidate loops | |
mode | a string which indicates what type of loops should be searched for. Allowed values are "internal", "bulge", and "both" |
double ProbScan::probability_of_hairpin | ( | int | i, | |
int | j | |||
) |
Returns probability of a hairpin closed at a specific position.
i | The 5' nucleotide closing the hairpin | |
j | The 3' nucleotide closing the hairpin |
double ProbScan::probability_of_helix | ( | const int | i, | |
const int | j, | |||
const int | how_many_stacks | |||
) |
Calculates probability of an helix at a specific position.
i | The 5' nucleotide closing the helix on the exterior | |
j | The 3' nucleotide closing the helix on the exterior | |
how_many_stacks | The number of base pair STACKS in the helix (this is the number of pairs minus 1) |
double ProbScan::probability_of_internal_loop | ( | int | i, | |
int | j, | |||
int | k, | |||
int | l | |||
) |
Returns probability of an internal loop or bulge loop closed at a specific position.
i | The 5' nucleotide closing the loop on the exterior | |
j | The 3' nucleotide closing the loop on the exterior | |
k | The 5' nucleotide closing the loop on the interior | |
l | The 3' nucleotide closing the loop on the interior |
double ProbScan::probability_of_multibranch_loop | ( | const multibranch_loop_t & | mb | ) |
Calculates probability of a multibranch loop at a specific position.
mb | A multibranch loop object, containing a vector of pairs describing the multibranch loop. These can be created with the multibranch_loop function. See the text interface for the ProbScan program for an example of usage. |
double ProbScan::probability_of_stack | ( | int | i, | |
int | j | |||
) |
Calculates probability of a base pair stack closed at a specific position Note that this is a special case of probability_of_helix where the size is set to 1
i | The 5' nucleotide closing the stack | |
j | The 3' nucleotide closing the stack |