mythos.input.topology
Topological information for DNA/RNA.
Attributes
Classes
Defines nucleotide types as integer enumerations. |
|
Topology information for a RNA/DNA strand. |
Functions
|
Checks if a sequence is well-formed. |
|
Read topology information from an oxDNA file. |
Determine the format of an oxDNA file from the first line of the file. |
|
|
Convert 5' neighbors to bonded neighbors by index. |
|
Get unbonded neighbors. |
|
Read topology information from a file in the classix oxDNA format. |
|
Module Contents
- mythos.input.topology.N_1ST_LINE_OXDNA_CLASSIC = 2
- mythos.input.topology.N_1ST_LINE_OXDNA_NEW = 3
- mythos.input.topology.VALID_NEIGHBOR_SECOND_DIM = 2
- mythos.input.topology.ERR_TOPOLOGY_INVALID_NUMBER_NUCLEOTIDES = 'Invalid number of nucleotides'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_STRAND_COUNTS = 'Invalid strand counts'
- mythos.input.topology.ERR_TOPOLOGY_SEQ_NOT_MATCH_NUCLEOTIDES = 'Sequence does not match number of nucleotides'
- mythos.input.topology.ERR_TOPOLOGY_STRAND_COUNTS_NOT_MATCH = 'Strand counts do not match number of nucleotides'
- mythos.input.topology.ERR_TOPOLOGY_BONDED_NEIGHBORS_INVALID_SHAPE = 'Invalid bonded neighbors shape'
- mythos.input.topology.ERR_TOPOLOGY_UNBONDED_NEIGHBORS_INVALID_SHAPE = 'Invalid unbonded neighbors shape'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_SEQUENCE_LENGTH = 'Invalid sequence length'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_SEQUENCE_NUCLEOTIDES = 'Invalid sequence nucleotides'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_DISCRETE_SEQUENCE_SHAPE = 'Invalid discrete sequence shape'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_UNPAIRED_PSEQ_SHAPE = 'Invalid unpaired probabilistic sequence shape'
- mythos.input.topology.ERR_TOPOLOGY_MISMATCH_PSEQ_SHAPE_NUM_NUCLEOTIDES = 'Pseq shape does not match number of nucleotides'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_BP_PSEQ_SHAPE = 'Invalid base-paired probabilistic sequence shape'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_PROBABILITIES = 'Probabilities must be > 0'
- mythos.input.topology.ERR_TOPOLOGY_PSEQ_NOT_NORMALIZED = 'Probabilities must be normalized'
- mythos.input.topology.ERR_INVALID_OXDNA_FORMAT = 'Invalid oxDNA topology format. See...
- mythos.input.topology.ERR_STRAND_COUNTS_CIRCULAR_MISMATCH = 'Strand counts and cicularity do not match'
- mythos.input.topology.ERR_FILE_NOT_FOUND = 'Topology file not found'
- mythos.input.topology.ERR_TOPOLOGY_INVALID_SEQUENCE_TYPE = 'Invalid sequence type. Must be discrete or probabilistic'
- mythos.input.topology.WARN_CLASSIC_UNSPECIFIED_NT_TYPE = 'Type of strand {strand_idx} not specified, and did not find T/U for autodetect'
- mythos.input.topology.WARN_NEW_UNSPECIFIED_NT_TYPE = 'Type of strand {strand_idx} not specified'
- class mythos.input.topology.NucleotideType[source]
Bases:
enum.IntEnumDefines nucleotide types as integer enumerations.
- UNSPECIFIED = 0
- DNA = 1
- RNA = 2
- mythos.input.topology.check_valid_seq(seq: mythos.utils.types.Sequence, n_nucleotides: int) None[source]
Checks if a sequence is well-formed.
- class mythos.input.topology.Topology[source]
Topology information for a RNA/DNA strand.
- strand_counts: numpy.ndarray
- bonded_neighbors: numpy.ndarray
- unbonded_neighbors: numpy.ndarray
- seq: mythos.utils.types.Sequence
- is_end: numpy.ndarray
- nt_type: numpy.ndarray
- mythos.input.topology.from_oxdna_file(path: mythos.utils.types.PathOrStr, *, return_format: bool = False) Topology | tuple[Topology, mythos.utils.types.oxDNAFormat][source]
Read topology information from an oxDNA file.
- Parameters:
path (typ.PathOrStr) – Path to the oxDNA topology file.
return_format (bool, optional) – Whether to return the oxDNA format along with the topology as a tuple (top, fmt). Defaults to False.
- Returns:
- The parsed topology, and
optionally the format.
- Return type:
- mythos.input.topology._determine_oxdna_format(first_line: str) tuple[mythos.utils.types.oxDNAFormat, collections.abc.Callable[[list[str]], Topology]][source]
Determine the format of an oxDNA file from the first line of the file.
- mythos.input.topology._get_bonded_neighbors(strand_lengths: list[int], is_circular: list[bool]) list[tuple[int, int]][source]
Convert 5’ neighbors to bonded neighbors by index.
- mythos.input.topology._get_unbonded_neighbors(n_nucleotides: int, bonded_neighbors: list[tuple[int, int]]) list[tuple[int, int]][source]
Get unbonded neighbors.