pestifer.molecule.bioassemb module

A class for processing biological assemblies

class pestifer.molecule.bioassemb.BioAssemb(*args, **kwargs)[source]

Bases: object

A class for handling biological assemblies in molecular structures. This class represents a biological assembly, which can consist of multiple transformations applied to segments in an asymmetric unit. It is initialized with a dictionary or an AsymmetricUnit, TransformList, or AncestorAwareObjList instance. If initialized with an AsymmetricUnit, it creates a default assembly with the name ‘A.U.’ and an identity transformation. If initialized with a TransformList or AncestorAwareObjList, it uses the transforms from that list. If initialized with a dictionary, it expects the dictionary to contain the keys ‘name’, ‘transforms’, and ‘index’. The class also maintains a static index to ensure unique assembly names.

Required attributes for the BioAssemb class.

name

The name of the biological assembly.

Type:

str

transforms

A list of Transform objects representing the transformations applied to the assembly.

Type:

TransformList

index

An index for the biological assembly, used to ensure unique names.

Type:

int

activate(AU: AsymmetricUnit, CM: ChainIDManager)[source]

Activate the biological assembly by generating chain ID maps for its transformations.

Parameters:
  • AU (AsymmetricUnit) – The asymmetric unit to which this biological assembly applies.

  • CM (ChainIDManager) – The ChainIDManager instance used to manage chain ID mappings.

set_parent_molecule(mol: Molecule)[source]

Set the parent molecule for this BioAssemb instance.

Parameters:

mol (Molecule) – The parent molecule to set.

class pestifer.molecule.bioassemb.BioAssembList(initial_data=None)[source]

Bases: UserList[BioAssemb]

A class for handling lists of BioAssemb objects. This class inherits from UserList and provides methods to manage collections of biological assemblies.

static from_data_container(dc: DataContainer)[source]

Initialize a BioAssembList from a DataContainer.

Parameters:

dc (DataContainer) – A DataContainer containing the data for biological assemblies.

Returns:

An instance of BioAssembList initialized with the provided DataContainer.

Return type:

BioAssembList

static from_pdb_record_dict(PRDict: PDBRecordDict)[source]

Initialize a BioAssembList from a PDBRecordDict.

Parameters:

PRDict (PDBRecordDict) – A dictionary containing PDB records for biological assemblies.

Returns:

An instance of BioAssembList initialized with the provided PDBRecordDict.

Return type:

list

get(index: int) BioAssemb | None[source]

Get a BioAssemb instance by index.

Parameters:

index (int) – The index of the BioAssemb to retrieve.

Returns:

The BioAssemb instance at the specified index.

Return type:

BioAssemb

set_parent_molecule(mol: Molecule)[source]

Set the parent molecule for this BioAssembList instance.

Parameters:

mol (object) – The parent molecule to set.