AlifoldApp#

class biotite.application_v2.viennarna.AlifoldApp(path: PathLike[str] | str = 'RNAalifold')[source]#

Bases: LocalApp

A handle to ViennaRNA’s RNAalifold software.

In contrast to FoldApp, the energy function includes a term that includes coevolution information extracted from an alignment in addition to the physical free energy term.

Parameters:
pathstr, optional

Path of the RNAalifold binary.

Examples

>>> matrix = SubstitutionMatrix.std_nucleotide_matrix()
>>> alignment = align_multiple(
...     [
...         NucleotideSequence("GGGGAAAACCCC"),
...         NucleotideSequence("GGGGAAAAACCCC"),
...         NucleotideSequence("GGGGGAAAACCCCC"),
...         NucleotideSequence("GGGAAAACCC"),
...     ],
...     matrix,
...     terminal_penalty=False,
... )[0]
>>> print(alignment)
-GGGGAAAACCCC-
-GGGGAAAAACCCC
GGGGGAAAACCCCC
--GGGAAAACCC--
>>> result = AlifoldApp().run(alignment).result()
>>> print(result.dot_bracket)
.((((....)))).
>>> print(result.free_energy, result.covariance_energy)
-4.47 0.31
>>> print(result.base_pairs())
[[ 1 12]
 [ 2 11]
 [ 3 10]
 [ 4  9]]
>>> print(result.base_pairs_of(0))
[[ 0 11]
 [ 1 10]
 [ 2  9]
 [ 3  8]]
run(alignment: Alignment, temperature: float = 37, pairs: Any = None, paired: Any = None, unpaired: Any = None, downstream: Any = None, upstream: Any = None, enforce: bool = False, **kwargs: Any) → CommandSetup[FoldedAlignment]#

Predict the consensus secondary structure of an alignment.

Constraints of known paired or unpaired bases can be added to the folding algorithm via pairs, paired, unpaired, downstream and upstream.

Parameters:
alignmentAlignment

An alignment of RNA sequences.

temperaturefloat, optional

The temperature (°C) to be assumed for the energy parameters.

pairsndarray, shape=(n,2), dtype=int, optional

Positions of constrained base pairs.

pairedndarray, shape=(n,), dtype=int or dtype=bool, optional

Positions of bases that are paired with any other base.

unpairedndarray, shape=(n,), dtype=int or dtype=bool, optional

Positions of bases that are unpaired.

downstreamndarray, shape=(n,), dtype=int or dtype=bool, optional

Positions of bases that are paired with any downstream base.

upstreamndarray, shape=(n,), dtype=int or dtype=bool, optional

Positions of bases that are paired with any upstream base.

enforcebool, optional

If set to true, the given constraints are enforced, i.e. the respective base pairs must form. By default, a constraint only forbids the formation of a base pair that would conflict with this constraint.

**kwargs

Additional command line options.

Returns:
futureFuture of FoldedAlignment

A handle to the running computation.