FoldedAlignment#

class biotite.application_v2.viennarna.FoldedAlignment(alignment: Alignment, dot_bracket: str, free_energy: float | None = None, covariance_energy: float | None = None, span: tuple[int, int] | None = None)[source]#

Bases: object

The predicted consensus secondary structure of an alignment of ribonucleic acid sequences.

Attributes:
alignmentAlignment

The folded alignment.

dot_bracketstr

The consensus secondary structure in dot-bracket notation, indexed by alignment column.

free_energyfloat, optional

The physical free energy (kcal/mol) of the consensus structure.

covariance_energyfloat, optional

The energy (kcal/mol) of the covariance term, if reported by the software.

spantuple (int, int), optional

If the dot_bracket describes only a local part of the alignment, the (start, stop) range (0-based, exclusive stop) of alignment columns the structure occupies. None means the structure spans all columns.

base_pairs() → ndarray[tuple[N, C2], dtype[integer]]#

Get the consensus base pairs in alignment-column coordinates.

Returns:
base_pairsndarray, shape=(n,2), dtype=int

Each row gives the two paired alignment columns.

base_pairs_of(sequence_index: int) → ndarray[tuple[N, C2], dtype[integer]]#

Get the consensus base pairs projected onto one sequence of the alignment.

Base pairs where either column is a gap in the selected sequence are omitted.

Parameters:
sequence_indexint

The index of the sequence in the alignment.

Returns:
base_pairsndarray, shape=(n,2), dtype=int

Each row gives the two paired positions in the ungapped sequence numbering of the selected sequence.

static from_base_pairs(alignment: Alignment, base_pairs: ndarray[tuple[N, C2], dtype[integer]], max_pseudoknot_order: int | None = None) → FoldedAlignment#

Create a FoldedAlignment from an alignment and its consensus base pairs.

Base pairs that are non-canonical in every sequence of the alignment are omitted, as they cannot be represented by the folding energy model.

Parameters:
alignmentAlignment

The alignment.

base_pairsndarray, shape=(n,2), dtype=int

Each row gives the two paired alignment columns.

max_pseudoknot_orderint, optional

The maximum pseudoknot order to represent. Base pairs of a higher order are treated as unpaired. By default, all orders are represented.

Returns:
foldedFoldedAlignment

The corresponding consensus structure, with unknown free_energy.