neurosnap.constants package#
Domain-organized constants used throughout Neurosnap.
- class neurosnap.constants.AARecordTable(records)[source]#
Bases:
objectIndexed lookup wrapper for a single amino-acid record table.
The table preserves the input record order for iteration while also exposing direct lookups by one-letter code, three-letter/CCD abbreviation, and full residue name.
- __iter__()[source]#
Iterate records in their original table order.
- Returns:
Iterator over
AARecordobjects.
- get_canonical_record(record_or_abr)[source]#
Resolve a record or abbreviation to its canonical-table record.
- Parameters:
record_or_abr (
Union[str,AARecord]) – Either anAARecordinstance already associated with this table family, or a residue abbreviation to resolve against the table.- Return type:
- Returns:
The canonical-table
AARecordwhen one can be determined. If the supplied record is already present in this table, that record is returned unchanged. ReturnsNonewhen the residue is unknown to the table or does not declare a standard parent that exists in this table.
- get_standard_record(record_or_abr)[source]#
Resolve a record or abbreviation to its standard parent record.
- Parameters:
record_or_abr (
Union[str,AARecord]) – Either anAARecordinstance or a residue abbreviation to resolve.- Return type:
- Returns:
The standard-parent
AARecordwhen one can be determined. Returns the input record unchanged when it is already a standard amino acid. ReturnsNonewhen the residue is unknown or has no standard parent mapping.