molecupy.structures.models (The Model class)

Contains the Model class.

class molecupy.structures.models.Model[source]

Base class: AtomicStructure

Represents the structural environment in which the other structures exist.

source()[source]

The object the Model was created from.

small_molecules()[source]

Returns all the SmallMolecule objects in this model.

Return type:set
add_small_molecule(small_molecule)[source]

Adds a small molecule to the model.

Parameters:small_molecule (SmallMolecule) – The small molecule to add.
remove_small_molecule(small_molecule)[source]

Removes a small molecule from the structure.

Parameters:small_molecule (SmallMolecule) – The small molecule to remove.
get_small_molecule_by_id(molecule_id)[source]

Returns the first small molecule that matches a given molecule ID.

Parameters:molecule_id (str) – The molecule ID to search by.
Return type:SmallMolecule or None
get_small_molecule_by_name(molecule_name)[source]

Returns the first small molecules that matches a given name.

Parameters:molecule_name (str) – The name to search by.
Return type:SmallMolecule or None
get_small_molecules_by_name(molecule_name)[source]

Returns all the small molecules of a given name.

Parameters:molecule_name (str) – The name to search by.
Return type:set of SmallMolecule objects.
duplicate_small_molecule(small_molecule, molecule_id=None)[source]

Creates a copy of a small molecule in the Model. The coordinates will be identical but it will have a unique ID.

Parameters:
  • small_molecule (SmalllMolecule) – The molecule to duplicate.
  • molecule_id (str) – If given, this will determine the ID of the new molecule.
chains()[source]

Returns all the Chain objects in this model.

Return type:set
add_chain(chain)[source]

Adds a chain to the model.

Parameters:chain (Chain) – The chain to add.
remove_chain(chain)[source]

Removes a chain from the structure.

Parameters:chain (Chain) – The chain to remove.
get_chain_by_id(chain_id)[source]

Returns the first chain that matches a given chain ID.

Parameters:chain_id (str) – The chain ID to search by.
Return type:Chain or None
duplicate_chain(chain, chain_id=None)[source]

Creates a copy of a chain in the Model. The coordinates will be identical but it will have a unique ID.

Parameters:
  • chain (Chain) – The chain to duplicate.
  • chain_id (str) – If given, this will determine the ID of the new chain.
bind_sites()[source]

Returns all the BindSite objects in this model.

Return type:set
add_bind_site(site)[source]

Adds a bind site to the model.

Parameters:site (BindSite) – The bind site to add.
remove_bind_site(site)[source]

Removes a bind site from the structure.

Parameters:site (BindSite) – The bind site to remove.
get_bind_site_by_id(site_id)[source]

Returns the first bind site that matches a given site ID.

Parameters:site_id (str) – The site ID to search by.
Return type:BindSite or None
complexes()[source]

Returns all the Complex objects in this model.

Return type:set
add_complex(complex_)[source]

Adds a complex to the model.

Parameters:complex (Complex) – The complex to add.
remove_complex(complex_)[source]

Removes a complex from the model.

Parameters:complex (Complex) – The complex to remove.
get_complex_by_id(complex_id)[source]

Returns the first complex that matches a given complex ID.

Parameters:complex_id (str) – The complex ID to search by.
Return type:Complex or None
get_complex_by_name(complex_name)[source]

Returns the first complex that matches a given name.

Parameters:complex_name (str) – The name to search by.
Return type:Complex or None
get_complexes_by_name(complex_name)[source]

Returns all the complexes of a given name.

Parameters:complex_name (str) – The name to search by.
Return type:set of Complex objects.
duplicate_complex(complex_, complex_id=None, complex_name=None)[source]

Creates a copy of a complex in the Model. The coordinates will be identical but it will have a unique ID.

Parameters:
  • complex (Complex) – The complex to duplicate.
  • complex_id (str) – If given, this will determine the ID of the new complex.
  • complex_name (str) – If given, this will determine the name of the new complex.
to_pdb_data_file()[source]

Converts the Model to a PdbDataFile.

save_as_pdb(path)[source]

Saves the Model to file as a PDB file.

Parameters:path (str) – The location and file name to save as.