RNAmediator.Tweaks.RNAtweaks.FoldOutput
- class RNAmediator.Tweaks.RNAtweaks.FoldOutput(condition: str = 'unconstrained', anno: str = None, gibbs: float = None, constraint: str = None, bpp: float = None, bppm: numpy.array = None, nrg: float = None, ddg: float = None, dnrg: float = None)
Output wrapper for ouput files of RNAfold
Inherits from collections.defaultdict
- __init__(condition: str = 'unconstrained', anno: str = None, gibbs: float = None, constraint: str = None, bpp: float = None, bppm: numpy.array = None, nrg: float = None, ddg: float = None, dnrg: float = None)
Output wrapper for RNAfold
- Parameters:
condition (str, optional) – Condition used for folding, by default ‘raw’
text (str, optional) – string representation of an RNAfold output file
gibbs (float, optional) – Gibbs Free Energy, by default None
constraint (str, optional) – Constraint applied for folding, by default None
bpp (float, optional) – Base-Pairing Probability, by default None
bppm (np.array, optional) – BasePairProbability matrix, by default None
nrg (float, optional) – Folding Pseudo-Energy, by default None
ddg (float, optional) – Delta-delta-Gibbs to unconstrained, by default None
dnrg (float, optional) – Delta-Folding Pseudo-Energy, by default None
Methods
__init__([condition, anno, gibbs, ...])Output wrapper for RNAfold
annotate(anno)Annotate FoldOutput
clear()copy()from_RNAfold_file(file_path[, condition, ...])creates FoldOutput from a file
from_rnamediator_fold_compound(fc[, ...])creates FoldOutput from original rnamediator fold compound
fromkeys([value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
get_text([h])return formatted string output
items()keys()merge(*args)returns annotation from FoldOutput
pop(k[,d])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem()Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Attributes
default_factoryFactory for default value called by __missing__().
- annotate(anno)
Annotate FoldOutput
- Parameters:
anno (str) – Annotation to set
- classmethod from_RNAfold_file(file_path: str, condition: str = 'unconstrained', constraint: str = None)
creates FoldOutput from a file
Parameters
- conditionstr, optional
which folding condition, e.g. raw, constraint, constraint-paired
- constraintstr, optional
which constraint was applied when folding
Returns
- from_rnamediator_fold_compound(fc, condition: str = 'unconstrained', constr: str = None, start: int = None, end: int = None)
creates FoldOutput from original rnamediator fold compound
Parameters
- fc: fold_compound object
ViennaRNA fold_compound object
- condition: str
Condition for folding
- constr: str
Constraint string
- start: int
Start of folding window
- end: int
End of folding window
Returns
- get_text(h=True)
return formatted string output
- Parameters:
h (bool) – Prints header if True
- Returns:
Contents of FoldOutput as formatted string
- Return type:
formatted_string
- parse_anno()
returns annotation from FoldOutput
- Returns:
Returns goi, chrom, start, end, strand
- Return type:
list([str, str, str, str, str])