mythos.input.sequence_constraints ================================= .. py:module:: mythos.input.sequence_constraints .. autoapi-nested-parse:: Sequence constraint information for DNA/RNA. Attributes ---------- .. autoapisummary:: mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_NUMBER_NUCLEOTIDES mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_SHAPE mythos.input.sequence_constraints.ERR_INVALID_BP_SHAPE mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED_SHAPE mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_MAPPER_SHAPE mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_BP_MAPPER_SHAPE mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_MISMATCH_NUM_TYPES mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_COVER mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_IS_UNPAIRED_INVALID_VALUES mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_PAIRED_NT_MAPPED_TO_UNPAIRED mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INCOMPLETE_UNPAIRED_MAPPED_IDXS mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_UNPAIRED_NT_MAPPED_TO_PAIRED mythos.input.sequence_constraints.ERR_SEQ_CONSTRAINTS_INCOMPLETE_BP_MAPPED_IDXS mythos.input.sequence_constraints.ERR_BP_ARR_CONTAINS_DUPLICATES mythos.input.sequence_constraints.ERR_INVALID_BP_INDICES mythos.input.sequence_constraints.ERR_DSEQ_TO_PSEQ_INVALID_BP Classes ------- .. autoapisummary:: mythos.input.sequence_constraints.SequenceConstraints Functions --------- .. autoapisummary:: mythos.input.sequence_constraints.check_consistent_constraints mythos.input.sequence_constraints.check_cover mythos.input.sequence_constraints.from_bps mythos.input.sequence_constraints.dseq_to_pseq Module Contents --------------- .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_NUMBER_NUCLEOTIDES :value: 'Invalid number of nucleotides' .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_SHAPE :value: 'Invalid shape for unpaired nucleotides' .. py:data:: ERR_INVALID_BP_SHAPE :value: 'Invalid shape for base pairs' .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED_SHAPE :value: 'Invalid shape for array specifying if unpaired' .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_UNPAIRED_MAPPER_SHAPE :value: 'Invalid shape for unpaired nucleotide index mapper' .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_BP_MAPPER_SHAPE :value: 'Invalid shape for base pair index mapper' .. py:data:: ERR_SEQ_CONSTRAINTS_MISMATCH_NUM_TYPES :value: 'Number of nucleotides should equal the number of unpaired base pairs plus the number of coupled... .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_COVER :value: 'Unpaired and coupled nucleotides do not cover all nucleotides' .. py:data:: ERR_SEQ_CONSTRAINTS_IS_UNPAIRED_INVALID_VALUES :value: 'Array specifying if unpaired contains invalid values, can only be one-hot' .. py:data:: ERR_SEQ_CONSTRAINTS_INVALID_IS_UNPAIRED :value: 'Array specifying if is_unpaired disagrees with list of unpaired nucleotides' .. py:data:: ERR_SEQ_CONSTRAINTS_PAIRED_NT_MAPPED_TO_UNPAIRED :value: 'Base paired nucleotides cannot be mapped to an unpaired nucleotide' .. py:data:: ERR_SEQ_CONSTRAINTS_INCOMPLETE_UNPAIRED_MAPPED_IDXS :value: 'Map of position indices to indices of unpaired nucleotides does not cover number of unpaired... .. py:data:: ERR_SEQ_CONSTRAINTS_UNPAIRED_NT_MAPPED_TO_PAIRED :value: 'Unpaired nucleotides cannot be mapped to a base paired nucleotide' .. py:data:: ERR_SEQ_CONSTRAINTS_INCOMPLETE_BP_MAPPED_IDXS :value: 'Map of position indices to indices of base paired nucleotides does not cover number of base... .. py:data:: ERR_BP_ARR_CONTAINS_DUPLICATES :value: 'Array specifying base paired indices cannot contain duplicates' .. py:data:: ERR_INVALID_BP_INDICES :value: 'Base paired indices must be between 0 and n_nucleotides-1' .. py:data:: ERR_DSEQ_TO_PSEQ_INVALID_BP :value: 'Invalid base pair encountered when converting discrete sequence to probabilistic sequence' .. py:function:: 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 Checks for consistency between specified nucleotide constraints and index mappers. .. py:function:: check_cover(n_nucleotides: int, n_unpaired: int, n_bp: int, unpaired: mythos.utils.types.Arr_Unpaired, bps: mythos.utils.types.Arr_Bp) -> None Checks if unpaired and paired nucleotides cover the entire set of nucleotides. .. py:class:: SequenceConstraints Constraint information for a RNA/DNA strand. .. py:attribute:: n_nucleotides :type: int .. py:attribute:: n_unpaired :type: int .. py:attribute:: n_bp :type: int .. py:attribute:: is_unpaired :type: mythos.utils.types.Arr_Nucleotide_Int .. py:attribute:: unpaired :type: mythos.utils.types.Arr_Unpaired .. py:attribute:: bps :type: mythos.utils.types.Arr_Bp .. py:attribute:: idx_to_unpaired_idx :type: mythos.utils.types.Arr_Nucleotide_Int .. py:attribute:: idx_to_bp_idx :type: mythos.utils.types.Arr_Nucleotide_2_Int .. py:method:: __post_init__() -> None Check that the sequence constraints are valid. .. py:function:: from_bps(n_nucleotides: int, bps: mythos.utils.types.Arr_Bp) -> SequenceConstraints Construct a SequenceConstraints object from a set of base pairs. .. py:function:: dseq_to_pseq(dseq: mythos.utils.types.Discrete_Sequence, sc: SequenceConstraints) -> mythos.utils.types.Probabilistic_Sequence Converts a discrete sequence to a probabilistic sequence.