mythos.input.sequence_constraints

Sequence constraint information for DNA/RNA.

Attributes

ERR_SEQ_CONSTRAINTS_INVALID_NUMBER_NUCLEOTIDES

ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_SHAPE

ERR_INVALID_BP_SHAPE

ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED_SHAPE

ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_MAPPER_SHAPE

ERR_SEQ_CONSTRAINTS_INVALID_BP_MAPPER_SHAPE

ERR_SEQ_CONSTRAINTS_MISMATCH_NUM_TYPES

ERR_SEQ_CONSTRAINTS_INVALID_COVER

ERR_SEQ_CONSTRAINTS_IS_UNPAIRED_INVALID_VALUES

ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED

ERR_SEQ_CONSTRAINTS_PAIRED_NT_MAPPED_TO_UNPAIRED

ERR_SEQ_CONSTRAINTS_INCOMPLETE_UNPAIRED_MAPPED_IDXS

ERR_SEQ_CONSTRAINTS_UNPAIRED_NT_MAPPED_TO_PAIRED

ERR_SEQ_CONSTRAINTS_INCOMPLETE_BP_MAPPED_IDXS

ERR_BP_ARR_CONTAINS_DUPLICATES

ERR_INVALID_BP_INDICES

ERR_DSEQ_TO_PSEQ_INVALID_BP

Classes

SequenceConstraints

Constraint information for a RNA/DNA strand.

Functions

check_consistent_constraints(→ None)

Checks for consistency between specified nucleotide constraints and index mappers.

check_cover(→ None)

Checks if unpaired and paired nucleotides cover the entire set of nucleotides.

from_bps(→ SequenceConstraints)

Construct a SequenceConstraints object from a set of base pairs.

dseq_to_pseq(→ mythos.utils.types.Probabilistic_Sequence)

Converts a discrete sequence to a probabilistic sequence.

Module Contents

mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_NUMBER_NUCLEOTIDES = 'Invalid number of nucleotides'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_SHAPE = 'Invalid shape for unpaired nucleotides'
mythos.input.sequence_constraints.ERR_INVALID_BP_SHAPE = 'Invalid shape for base pairs'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED_SHAPE = 'Invalid shape for array specifying if unpaired'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_MAPPER_SHAPE = 'Invalid shape for unpaired nucleotide index mapper'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_BP_MAPPER_SHAPE = 'Invalid shape for base pair index mapper'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_MISMATCH_NUM_TYPES = 'Number of nucleotides should equal the number of unpaired base pairs plus the number of coupled...
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_COVER = 'Unpaired and coupled nucleotides do not cover all nucleotides'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_IS_UNPAIRED_INVALID_VALUES = 'Array specifying if unpaired contains invalid values, can only be one-hot'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED = 'Array specifying if is_unpaired disagrees with list of unpaired nucleotides'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_PAIRED_NT_MAPPED_TO_UNPAIRED = 'Base paired nucleotides cannot be mapped to an unpaired nucleotide'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INCOMPLETE_UNPAIRED_MAPPED_IDXS = 'Map of position indices to indices of unpaired nucleotides does not cover number of unpaired...
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_UNPAIRED_NT_MAPPED_TO_PAIRED = 'Unpaired nucleotides cannot be mapped to a base paired nucleotide'
mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INCOMPLETE_BP_MAPPED_IDXS = 'Map of position indices to indices of base paired nucleotides does not cover number of base...
mythos.input.sequence_constraints.ERR_BP_ARR_CONTAINS_DUPLICATES = 'Array specifying base paired indices cannot contain duplicates'
mythos.input.sequence_constraints.ERR_INVALID_BP_INDICES = 'Base paired indices must be between 0 and n_nucleotides-1'
mythos.input.sequence_constraints.ERR_DSEQ_TO_PSEQ_INVALID_BP = 'Invalid base pair encountered when converting discrete sequence to probabilistic sequence'
mythos.input.sequence_constraints.check_consistent_constraints(n_unpaired: int, n_bp: int, unpaired: mythos.utils.types.Arr_Unpaired, idx_to_unpaired_idx: mythos.utils.types.Arr_Nucleotide_Int, idx_to_bp_idx: mythos.utils.types.Arr_Nucleotide_2_Int) None[source]

Checks for consistency between specified nucleotide constraints and index mappers.

mythos.input.sequence_constraints.check_cover(n_nucleotides: int, n_unpaired: int, n_bp: int, unpaired: mythos.utils.types.Arr_Unpaired, bps: mythos.utils.types.Arr_Bp) None[source]

Checks if unpaired and paired nucleotides cover the entire set of nucleotides.

class mythos.input.sequence_constraints.SequenceConstraints[source]

Constraint information for a RNA/DNA strand.

n_nucleotides: int
n_unpaired: int
n_bp: int
is_unpaired: mythos.utils.types.Arr_Nucleotide_Int
unpaired: mythos.utils.types.Arr_Unpaired
bps: mythos.utils.types.Arr_Bp
idx_to_unpaired_idx: mythos.utils.types.Arr_Nucleotide_Int
idx_to_bp_idx: mythos.utils.types.Arr_Nucleotide_2_Int
__post_init__() None[source]

Check that the sequence constraints are valid.

mythos.input.sequence_constraints.from_bps(n_nucleotides: int, bps: mythos.utils.types.Arr_Bp) SequenceConstraints[source]

Construct a SequenceConstraints object from a set of base pairs.

mythos.input.sequence_constraints.dseq_to_pseq(dseq: mythos.utils.types.Discrete_Sequence, sc: SequenceConstraints) mythos.utils.types.Probabilistic_Sequence[source]

Converts a discrete sequence to a probabilistic sequence.