rna_library.core.enums

Enumerated types for base pairs, nucleotides and motifs. Assist with ensuring type correctness and lowers overhead vs string-based implementations.

Module Contents

Classes

BasePair

Enumerated type for canoncial and wobble basepairs.

Nucleotide

Enumerated type for all nucleotide types.

MotifType

Enumerated type for all motif types

Attributes

ALLOWED_PAIRS

A set() containing all 6 canonical and wobble basepairings.

BPS

A tuple() of allowed canonical and wobble basepairings.

LEGAL_BPS

A set() of all 4 allowed nucleotide types.

NTS

A tuple() of all 4 canonical nucleotide types. Ordered

BP_VALS

A list() that contains the integer values for all of the

BASEPAIR_MAPPER

A dict() object that maps a canonical basepair to its

NT_VALS

A list() that contains the integer values for all of the

NUCLEOTIDE_MAPPER

A dict() object that maps a canoncial nucleotide to its

TYPE_MAPPER

A :class: dict() object that maps a :class: MotifType to its value

rna_library.core.enums.ALLOWED_PAIRS

A set() containing all 6 canonical and wobble basepairings.

rna_library.core.enums.BPS = ['GU', 'UG', 'AU', 'UA', 'GC', 'CG']

A tuple() of allowed canonical and wobble basepairings. Ordered for easy conversion by the BasePair() class.

rna_library.core.enums.LEGAL_BPS

A set() of all 4 allowed nucleotide types.

rna_library.core.enums.NTS = ['A', 'C', 'G', 'U']

A tuple() of all 4 canonical nucleotide types. Ordered for each conversion by the Nucleotide() class.

class rna_library.core.enums.BasePair

Bases: enum.IntEnum

Inheritance diagram of rna_library.core.enums.BasePair

Enumerated type for canoncial and wobble basepairs.

GU = 0
UG = 1
AU = 2
UA = 3
GC = 4
CG = 5
is_GU(self)
Returns

If the instance is a UG or GU pair.

Return type

bool()

is_AU(self)
Returns

If the instance is a UA or AU pair.

Return type

bool()

is_GC(self)
Returns

If the instance is a CG or GC pair.

Return type

bool()

is_canoncial(self)
Returns

If the instance is a canonical Watson-Crick basepair.

Return type

bool()

to_str(self)
Returns

The BasePair() instance in text form.

Return type

str()

rna_library.core.enums.BP_VALS

A list() that contains the integer values for all of the BasePair() enumerations.

rna_library.core.enums.BASEPAIR_MAPPER

A dict() object that maps a canonical basepair to its BasePair() value.

class rna_library.core.enums.Nucleotide

Bases: enum.IntEnum

Inheritance diagram of rna_library.core.enums.Nucleotide

Enumerated type for all nucleotide types.

A = [0]
C = [1]
G = [2]
U = 3
to_str(self)
Returns

The Nucleotide() instance in text form.

Return type

str()

rna_library.core.enums.NT_VALS

A list() that contains the integer values for all of the Nucleotide() enumerations.

rna_library.core.enums.NUCLEOTIDE_MAPPER

A dict() object that maps a canoncial nucleotide to its Nucleotide() value.

class rna_library.core.enums.MotifType

Bases: enum.IntEnum

Inheritance diagram of rna_library.core.enums.MotifType

Enumerated type for all motif types

UNASSIGNED = 0
SINGLESTRAND = 1
HELIX = 2
HAIRPIN = 3
JUNCTION = 4
rna_library.core.enums.TYPE_MAPPER

A :class: dict() object that maps a :class: MotifType to its value as a str().