Infrared
Loading...
Searching...
No Matches
infrared.rna Namespace Reference

Classes

class  BPComp
 Constrain complementarity of the base pair (i,j) More...
 
class  BPEnergy
 Function for Stack Energy model. More...
 
class  DifferentComplClassConstraint
 Parse RNA structure including pseudoknots. More...
 
class  GCCont
 Function for (basepair-wise) BasePair Energy model. More...
 
class  NotBPComp
 Function for (position-wise) GC content. More...
 
class  ParseError
 
class  SameComplClassConstraint
 Constrain nucleotides to be in different complementarity classes. More...
 
class  StackEnergy
 Constrain nucleotides to be in the same complementarity class. More...
 

Functions

 parse_array (structure, *opening="([{<", closing=")]}>")
 
 parse (structure, **kwargs)
 Parse RNA structure, returning list of base pairs.
 
 is_complementary (x, y)
 Check complementarity of nucleotides.
 
 invalid_bps (seq, struc)
 Get invalid base pairs.
 
 is_valid (seq, struc)
 Check whether sequence satisfies complementarity constraints due to structure.
 
 structure_to_basepair_dependencies (structure, edges=[])
 Convert structure to list of edges in basepair model.
 
 structure_to_stacking_dependencies (structure, edges=[])
 Convert structure to list of edges in stacking model.
 
 GC_content (seq)
 Compute GC content in a sequence.
 
 unique_edges (xs)
 Make edges unique (considering symmetry).
 
 read_inp (inpfh)
 Read multiple structures from file in inp format.
 
 nucleotide_to_value (x)
 Convert integer (variable value) to nucleotide.
 
 value_to_nucleotide (x)
 Convert integer (variable value) to nucleotide.
 
 values_to_seq (xs)
 Convert list of integers (variable values) to string (sequence) of nucleotides.
 
 ass_to_seq (ass)
 Convert assignment to sequence string.
 
 iupacvalues (symbol)
 
 set_bpenergy_table (params=def_params_bp)
 Set the bp energy table for Function BPEnergy.
 
 set_stacking_energy_table (params=def_params_stacking)
 Set the stacking energy table for Function StackEnergy.
 

Variables

dict def_params_bp
 Default parameters for the base pair model (magic params from the Redprint paper)
 
dict def_params_stacking
 Default parameters for the stacking model (magic params from the Redprint paper)
 

Detailed Description

Functionality for RNA-related Infrared applications.

import infrared.rna as rna
Definition rna.py:1

Function Documentation

◆ ass_to_seq()

infrared.rna.ass_to_seq (   ass)

Convert assignment to sequence string.

Parameters
assassignment

◆ GC_content()

infrared.rna.GC_content (   seq)

Compute GC content in a sequence.

Parameters
seqsequence string
Returns
gc content (as ratio in [0,1])

◆ invalid_bps()

infrared.rna.invalid_bps (   seq,
  struc 
)

Get invalid base pairs.

Parameters
seqsequence string
strucstructure as dot bracket string or base pair list
Returns
list of base pairs that violate the complementarity constraints

◆ is_complementary()

infrared.rna.is_complementary (   x,
  y 
)

Check complementarity of nucleotides.

Parameters
xnucelotide
ynucelotide
Returns
whether complementary (A-U,C-G, or G-U)

◆ is_valid()

infrared.rna.is_valid (   seq,
  struc 
)

Check whether sequence satisfies complementarity constraints due to structure.

Parameters
seqsequence string
strucstructure as dot bracket string or base pair list
Returns
whether valid

◆ iupacvalues()

infrared.rna.iupacvalues (   symbol)

◆ nucleotide_to_value()

infrared.rna.nucleotide_to_value (   x)

Convert integer (variable value) to nucleotide.

Parameters
xnucleotide or gap, A, C, G, U, T, -, or .
Note
encoding A=0, C=1, G=2, U/T=3, -/.=4

◆ parse()

infrared.rna.parse (   structure,
**  kwargs 
)

Parse RNA structure, returning list of base pairs.

Parameters
structuredot bracket string of RNA structure
Returns
list of base pairs (i,j)
See also
parse_array

◆ parse_array()

infrared.rna.parse_array (   structure,
opening = "([{<",
  closing = ")]}>" 
)

◆ read_inp()

infrared.rna.read_inp (   inpfh)

Read multiple structures from file in inp format.

inp format is a file format to specify instances for multi-target RNA design, e.g. used in the benchmarks of Modena and RNAblueprint

Parameters
inpfhinput file handle
Returns
list of the structures as dot bracket strings

◆ set_bpenergy_table()

infrared.rna.set_bpenergy_table (   params = def_params_bp)

Set the bp energy table for Function BPEnergy.

Parameters
paramsdictionary of parameters or a table of the parameters as expected by _bpenergy

◆ set_stacking_energy_table()

infrared.rna.set_stacking_energy_table (   params = def_params_stacking)

Set the stacking energy table for Function StackEnergy.

Parameters
paramsdictionary of parameters or a table of the parameters as expected by _stackenergy

◆ structure_to_basepair_dependencies()

infrared.rna.structure_to_basepair_dependencies (   structure,
  edges = [] 
)

Convert structure to list of edges in basepair model.

Dependencies are appendes to edges

Parameters
structurearray representation of RNA structure
edgesedges list of edges [in,out]
Note
node indices are 0-based

◆ structure_to_stacking_dependencies()

infrared.rna.structure_to_stacking_dependencies (   structure,
  edges = [] 
)

Convert structure to list of edges in stacking model.

Dependencies are appendes to edges

Parameters
structurearray representation of RNA structure
edgeslist of edges [in,out]
See also
structure_to_basepair_dependencies

◆ unique_edges()

infrared.rna.unique_edges (   xs)

Make edges unique (considering symmetry).

keeps only one of (x,y) and (y,x), namely (x,y) if x<y

Parameters
xslist of edges
Returns
unique list of edges

◆ value_to_nucleotide()

infrared.rna.value_to_nucleotide (   x)

Convert integer (variable value) to nucleotide.

Parameters
xinteger
Note
encoding A=0, C=1, G=2, U=3, -=4

◆ values_to_seq()

infrared.rna.values_to_seq (   xs)

Convert list of integers (variable values) to string (sequence) of nucleotides.

Parameters
xslist of integers

Variable Documentation

◆ def_params_bp

dict infrared.rna.def_params_bp
Initial value:
1= {"GC_IN": -2.10208, "AU_IN": -0.52309, "GU_IN": -0.88474,
2 "GC_TERM": -0.09070, "AU_TERM": 1.26630, "GU_TERM": 0.78566}

Default parameters for the base pair model (magic params from the Redprint paper)

◆ def_params_stacking

dict infrared.rna.def_params_stacking
Initial value:
1= {"AUAU": -0.18826, "AUCG": -1.13291, "AUGC": -1.09787,
2 "AUGU": -0.38606, "AUUA": -0.26510, "AUUG": -0.62086,
3 "CGAU": -1.11752, "CGCG": -2.23740, "CGGC": -1.89434,
4 "CGGU": -1.22942, "CGUA": -1.10548, "CGUG": -1.44085,
5 "GUAU": -0.55066, "GUCG": -1.26209, "GUGC": -1.58478,
6 "GUGU": -0.72185, "GUUA": -0.49625, "GUUG": -0.68876}

Default parameters for the stacking model (magic params from the Redprint paper)