pestifer.objs.seqadv module

SEQADV (PDB) and seq_dif (mmCIF) records declare differences between the actual sequence of the molecule and the sequence of its database reference. This is how authors report things like accidental mutations (conflicts), engineered mutations, and other differences. These records are residue-specific.

class pestifer.objs.seqadv.Seqadv(*args, idCode: str, resname: str, chainID: str, resid: ResID, database: str | None = None, dbAccession: str | None = None, dbRes: str | None = None, dbSeq: int | None = None, typekey: str | None = None, pdbx_ordinal: int | None = None, pdbx_auth_seq_num: int | None = None, residue: Residue = None, pdbx_stash: dict | None = None)[source]

Bases: BaseObj

A class for handling SEQADV/seq_dif records in input structure files

assign_residue(Residues: ResidueList)[source]

Assigns the residue attribute of the seqadv to the corresponding Residue object This method searches through the provided list of Residues to find a match based on the attributes of the seqadv object. If a match is found, the residue attribute is set to the corresponding Residue object. If no match is found, the residue attribute remains None.

Parameters:

Residues (list) – A list of Residue objects to search for the corresponding residue.

chainID: str
database: str | None
dbAccession: str | None
dbRes: str | None
dbSeq: int | None
idCode: str
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': False}

Configuration for pydantic.BaseModel.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pdb_line()[source]

Write the seqadv as it would appear in a PDB file

Returns:

The PDB line for the seqadv record.

Return type:

str

pdbx_auth_seq_num: int | None
pdbx_ordinal: int | None
pdbx_stash: dict | None
resid: ResID
residue: Residue
resname: str
seqadv_details_keyword(text)[source]

Returns the typekey for the given text

Parameters:

text (str) – The text to analyze for keywords.

Returns:

The typekey corresponding to the text, or _other_ if no keyword is found.

Return type:

str

typekey: str | None
update_from_residue()[source]

Updates the chainID attribute of the seqadv from its residue attribute This method sets the chainID attribute of the seqadv to the chainID of its residue attribute, if the residue is not None. If the residue is None, it does nothing.

class pestifer.objs.seqadv.SeqadvList(initlist: Iterable[T] = ())[source]

Bases: BaseObjList[Seqadv]

A class for handling lists of Seqadvs.

assign_residues(Residues: ResidueList) SeqadvList[source]

Assigns residues to each Seqadv in the list from the provided Residues. This method iterates over each Seqadv in the list and calls its assign_residue method with the provided Residues. After assigning residues, it creates a new SeqadvList containing the Seqadv objects that have no assigned residue (i.e., their residue attribute is None). It then removes these Seqadv objects from the original list.

Parameters:

Residues (list) – A list of Residue objects to assign to the Seqadv objects.

Returns:

A new SeqadvList containing the Seqadv objects that could not be assigned a residue.

Return type:

SeqadvList

describe()[source]

Abstract method to describe the contents of the BaseObjList. Subclasses should implement this method to provide a meaningful description.

classmethod from_cif(parsed: DataContainer) SeqadvList[source]

Create a SeqadvList from a DataContainer (mmCIF format).

Parameters:

parsed (DataContainer) – The parsed mmCIF data container.

Returns:

A new SeqadvList instance containing Seqadv objects created from the mmCIF data.

Return type:

SeqadvList

classmethod from_pdb(parsed: PDBRecordDict) SeqadvList[source]

Create a SeqadvList from a PDBRecordDict.

update_from_residues()[source]

Updates the chainID attribute of each Seqadv in the list from its residue. This method iterates over each Seqadv in the list and calls its update_from_residue method. It updates the chainID attribute of each Seqadv based on its residue attribute.