MFE_utils

Attributes

SIMPLE_PAIRING_FE

TURNER_FE

_INT_PAIRS

_PAIRS

_PAIRS_INV

Functions

base_as_int(c)

Map one character from bases ACGU to an int 0..3

int_as_base(r)

Map int bases 0..3 to a character from ACGU

pair_int_as_str(pair_int)

Convert pair-int to str form (e.g. 3 -> 'GU')

pair_int_as_tuple(pair_int)

str_as_pair_int(p)

Convert a pair-str to an index to various tables (or -1)

tuple_as_pair_int(r, s)

Convert a pair of bases to an index to various tables (or -1)

Module Contents

MFE_utils.SIMPLE_PAIRING_FE
MFE_utils.TURNER_FE
MFE_utils._INT_PAIRS
MFE_utils._PAIRS = ('AU', 'CG', 'GC', 'GU', 'UA', 'UG')
MFE_utils._PAIRS_INV: dict[str | tuple[int, int], int]
MFE_utils.base_as_int(c)

Map one character from bases ACGU to an int 0..3

Parameters:

c (str)

Return type:

int

MFE_utils.int_as_base(r)

Map int bases 0..3 to a character from ACGU

Parameters:

r (int)

Return type:

str

MFE_utils.pair_int_as_str(pair_int)

Convert pair-int to str form (e.g. 3 -> ‘GU’)

Parameters:

pair_int (int)

Return type:

str

MFE_utils.pair_int_as_tuple(pair_int)
Parameters:

pair_int (int)

Return type:

tuple[int, int]

MFE_utils.str_as_pair_int(p)

Convert a pair-str to an index to various tables (or -1)

p is a string pair like “GU” and the return is an integer index in a list of Watson-Crick-Franklin pairs for RNA including GU. If p is not one of those pairs, -1 is returned.

Parameters:

p (str)

Return type:

int

MFE_utils.tuple_as_pair_int(r, s)

Convert a pair of bases to an index to various tables (or -1)

(r,s) is a base pair like (2,3) (signifying “GU”) and the return is an integer index in a list of Watson-Crick-Franklin pairs for RNA including GU. If (r,s) is not one of those pairs, -1 is returned.

Parameters:
  • r (int)

  • s (int)

Return type:

int