The ihm.reference Python module¶
Classes for providing extra information about an ihm.Entity
- class ihm.reference.Reference[source]¶
Base class for extra information about an
ihm.Entity.This class is not used directly; instead, use a subclass such as
SequenceorUniProtSequence. These objects are then typically passed to theihm.Entityconstructor.
- class ihm.reference.Sequence(db_name, db_code, accession, sequence, details=None)[source]¶
Point to the sequence of an
ihm.Entityin a sequence database; convenience subclasses are provided for common sequence databases such asUniProtSequence.These objects are typically passed to the
ihm.Entityconstructor.See also
alignmentsto describe the correspondence between the database and entity sequences.- Parameters:
db_name (str) – The name of the database.
db_code (str) – The name of the sequence in the database.
accession (str) – The database accession.
sequence (str) – The complete sequence, as a string of one-letter codes.
details (str) – Longer text describing the sequence.
- class ihm.reference.UniProtSequence(db_code, accession, sequence, details=None)[source]¶
Point to the sequence of an
ihm.Entityin UniProt.These objects are typically passed to the
ihm.Entityconstructor.- Parameters:
db_code (str) – The UniProt name (e.g. NUP84_YEAST)
accession (str) – The UniProt accession (e.g. P52891)
See
Sequencefor a description of the remaining parameters.- add_missing_sequence()[source]¶
Fill in any missing sequence information. This is done by querying the UniProt web API, so requires network access.
- classmethod from_accession(accession)[source]¶
Create
UniProtSequencefrom just an accession. This is done by querying the UniProt web API, so requires network access.- Parameters:
accession (str) – The UniProt accession (e.g. P52891)
- class ihm.reference.Alignment(db_begin=1, db_end=None, entity_begin=1, entity_end=None, seq_dif=[])[source]¶
A sequence range that aligns between the database and the entity. This describes part of the sequence in the sequence database (
Sequence) and in theihm.Entity. The two ranges must be the same length and have the same primary sequence (any differences must be described withSeqDifobjects).- Parameters:
db_begin (int) – The first residue in the database sequence that is used (defaults to the entire sequence).
db_end (int) – The last residue in the database sequence that is used (or None, the default, to use the entire sequence).
entity_begin (int) – The first residue in the
Entitysequence that is taken from the reference (defaults to the entire entity sequence).entity_end (int) – The last residue in the
Entitysequence that is taken from the reference (or None, the default, to use the entire sequence).seq_dif (Sequence of
SeqDifobjects.) – Single-point mutations made to the sequence.
- class ihm.reference.SeqDif(seq_id, db_monomer, monomer, details=None)[source]¶
Annotate a sequence difference between a reference and entity sequence. This is generally used for simple mutations; for insertions or deletions, use the
InsertionSeqDiforDeletionSeqDifsubclasses instead. See alsoAlignment.- Parameters:
seq_id (int) – The residue index in the entity sequence.
db_monomer (
ihm.ChemComp) – The monomer type (as aChemCompobject) in the reference sequence.monomer (
ihm.ChemComp) – The monomer type (as aChemCompobject) in the entity sequence.details (str) – Descriptive text for the sequence difference.
- class ihm.reference.InsertionSeqDif(seq_id, monomer, details='insertion')[source]¶
Annotate an insertion of a residue relative to the reference sequence. This is used to describe a residue that is present in the entity sequence but not in the reference, such as an expression tag. See also
SeqDifandAlignment.- Parameters:
seq_id (int) – The residue index in the entity sequence.
monomer (
ihm.ChemComp) – The monomer type (as aChemCompobject) in the entity sequence.details (str) – Descriptive text for the sequence difference.
- class ihm.reference.DeletionSeqDif(db_seq_id, db_monomer, details='deletion')[source]¶
Annotate a deletion of a residue from the reference sequence. This is used to describe a residue that is present in the reference sequence but not in the entity. See also
SeqDifandAlignment.- Parameters:
db_seq_id (int) – The residue index in the reference sequence.
db_monomer (
ihm.ChemComp) – The monomer type (as aChemCompobject) in the reference sequence.details (str) – Descriptive text for the sequence difference.