FoldRNA.LoopModel
— TypeLoopModel
Nearest-neighbour model (Turner model) based on scoring loops closed by basepairs.
The implementation currently doesn't support:
- pseudoknots
- coaxial stacking
- multiple strands (although there is the scalar duplex_init)
FoldRNA.Pairtable
— MethodPairtable(dbn::String)
Compute the pair table (base pairs and strand extents) from dbn
, a nucleic acid secondary structure given in dot-bracket notation.
In dot-bracket notation, unpaired bases are denoted by '.', base pairs are formed by pairing brackets '()[]{}<>', and strand ends (in a multi-strand complex) are indicated by '+'.
Throws an exception if the dot-bracket string is malformed (illegal characters or wrong number of opening or closing parentheses).
Examples
julia> Pairtable("(..)")
Pairtable([4, 0, 0, 1], StrandInfo[StrandInfo(1, 4, false)])
julia> Pairtable("(.(.[+.).].)")
Pairtable([11, 0, 7, 0, 9, 0, 3, 0, 5, 0, 1], StrandInfo[StrandInfo(1, 5, false), StrandInfo(6, 11, false)])
FoldRNA.StrandInfo
— TypeStrandInfo(startidx, endidx, iscircular)
StrandInfo(; startidx, endidx, iscircular)
Strand information used in a Pairtable: start index startidx
of the strand in the Pairtable, end index endidx
, and if the strand iscircular
.
FoldRNA.StrandInfo
— MethodStrandInfo(startidx, endidx) = StrandInfo(startidx, endidx, false)
Strand information for a linear (non-circular) strand.
FoldRNA.allseq
— Methodallseq(n::Integer; [bases])
Iterator over all sequences of length n
. Optionally, the bases
to be used can be specified.
FoldRNA.allseq
— Methodallseq(pt::Pairtable; [bases], [basepairs])
allseq(dbn::String; [bases], [basepairs])
Iterator over all sequences compatible with a secondary structure given as a Pairtable pt
or a string dbn
in dot-bracket notation. Optionally, bases
and basepairs
to be used can be specified.
FoldRNA.allstruct
— Methodallstruct(seq::AbstractString; hpmin=3, canbp::Function=(s,i,j)->...)
allstruct(n::Integer; hpmin=3, canbp::Function)
allstruct(f::Function, seq::String; hpmin=3, canbp::Function)
allstruct(f::Function, n::Integer; hpmin=3, canbp::Function)
Iterate over all unpseudoknotted secondary structures, either for a given sequence seq
or all structures of length n
. The methods that take a function f
as the first argument apply this function to every structure.
Optional arguments: minimum hairpin size is hpmin
, and the function canbp
specifies which bases can form basepairs.
FoldRNA.filter_wildcard_chars
— Methodfilter_wildcard_chars(model::LoopModel)
Remove all parameters from tables that refer to wildcard nucleotides, e.g. 'N'.
FoldRNA.numseq
— Methodnumseq(pt::Pairtable; nbases=DEFAULT_NBASES, nbasepairs=DEFAULT_NBASEPAIRS)
numseq(dbn::String; nbases=DEFAULT_NBASES, nbasepairs=DEFAULT_NBASEPAIRS)
Number of sequences for a given secondary structure given as a Pairtable
or as a string in dot-bracket notation. Optionally the number of possible bases nbases
and basepairs nbasepairs
can be specified.
FoldRNA.numstruct
— Methodnumstruct(seq::AbstractString; hpmin=3)
Number of unpseudoknotted secondary structures for a sequence seq
given as an AbstractString
. The permissible base-pairs are Set([('U', 'A'), ('U', 'G'), ('G', 'U'), ('A', 'U'), ('C', 'G'), ('G', 'C')])
, and additionally the base N
can base-pair with any other base. The minimum allowed length of a hairpin loop is hpmin
.
FoldRNA.numstruct
— Methodnumstruct(n::Integer; hpmin=3)
Number of unpseudoknotted secondary structures for a sequence of length n
. The minimum allowed length of a hairpin loop is hpmin
. This function assumes that any base can base-pair with any other base.
FoldRNA.randseq
— Methodrandseq(n::Integer; [bases])
Random sequence of length n
. Optionally, the possible bases
to be used can be specified.
FoldRNA.randseq
— Methodrandseq(pt::Pairtable; [bases], [basepairs])
randseq(dbn::String; [bases], [basepairs])
Random sequence for a secondary structure given as a Pairtable
or string in dot-bracket notation. Optionally, the bases
and basepairs
to be used can be specified.
FoldRNA.readparam_viennarna
— Methodreadparam_viennarna(filepath; options...)
Read nearest-neighbour energy parameter file in ViennaRNA RNAfold v2.0 format.
Some implicit defaults for the ViennaRNA parameter file format:
- energy values are in units of 0.01 * kcal/mol
- parameters are assumed to be at 37 degrees Celsius
These can be configured with keyword arguments.
Note: for the intloop22 tables (named int22
and int22_enthalpies
in the ViennaRNA parameter file), the tables are assumed to not consider bases or basepairs that contain an 'N'
.