molecupy.structures.chains
(Residuic structures)¶
Contains classes for macrostructures made of residues.
-
class
molecupy.structures.chains.
ResiduicStructure
(*residues)[source]¶ Base class:
AtomicStructure
The base class for all structures which can be described as a set of residues.
Parameters: residues – A sequence of Residue
objects in this structure.-
residues
(include_missing=True)[source]¶ Returns the residues in this structure as a
set
.Parameters: include_missing (str) – If False
only residues present in the PDB coordinates will be returned, and not missing ones.Return type: set
-
add_residue
(residue)[source]¶ Adds a residue to the structure.
Parameters: residue (Residue) – The residue to add.
-
remove_residue
(residue)[source]¶ Removes a residue from the structure.
Parameters: residue (Residue) – The residue to remove.
-
get_residue_by_id
(residue_id)[source]¶ Returns the first residue that matches a given residue ID.
Parameters: residue_id (str) – The residue ID to search by. Return type: Residue
orNone
-
get_residues_by_name
(residue_name, include_missing=True)[source]¶ Returns all the residues of a given name.
Parameters: - residue_name (str) – The name to search by.
- include_missing (str) – If
False
only residues present in the PDB coordinates will be returned, and not missing ones.
Return type: set
ofResidue
objects.
-
get_residue_by_name
(residue_name, include_missing=True)[source]¶ Returns the first residue that matches a given name.
Parameters: - residue_name (str) – The name to search by.
- include_missing (str) – If
False
only residues present in the PDB coordinates will be returned, and not missing ones.
Return type: Residue
orNone
-
-
class
molecupy.structures.chains.
ResiduicSequence
(*residues)[source]¶ Base class:
ResiduicStructure
The base class for all structures which can be described as a sequence of residues.
Parameters: residues – A sequence of Residue
objects in this structure.-
residues
(include_missing=True)[source]¶ Returns the residues in this structure as a
list
.Parameters: include_missing (str) – If False
only residues present in the PDB coordinates will be returned, and not missing ones.Return type: list
-
-
class
molecupy.structures.chains.
Chain
(chain_id, *residues)[source]¶ Base class:
ResiduicSequence
Represents chains - the polymeric units that make up most of PDB structures.
Parameters: - chain_id – The chain’s ID.
- residues – The residues in this chain.
-
alpha_helices
()[source]¶ Returns the
AlphaHelix
objects on this chain.Returns: set
ofAlphaHelix
objects
-
beta_strands
()[source]¶ Returns the
BetsStrand
objects on this chain.Returns: set
ofBetaStrand
objects
-
get_helix_by_id
(helix_id)[source]¶ Returns the first alpha helix that matches a given helix ID.
Parameters: helix_id (str) – The helix ID to search by. Return type: AlphaHelix
orNone
-
class
molecupy.structures.chains.
BindSite
(site_id, *residues)[source]¶ Base class:
ResiduicStructure
Represents binding sites - the residue clusters that mediate ligand binding.
Parameters: - site_id – The site’s ID.
- residues – The residues in this chain.
-
ligand
(ligand=None)[source]¶ Returns or sets the site’s
SmallMolecule
ligand.Parameters: ligand (SmallMolecule) – If given, the ligand will be set to this. Return type: SmallMolecule
-
continuous_sequence
()[source]¶ If the residues are on the same chain, this will return a continuous sequence that contains all residues in this site, otherwise
None
.Return type: ResiduicSequence
-
class
molecupy.structures.chains.
AlphaHelix
(helix_id, *residues, helix_class=None, comment=None)[source]¶ Base class:
ResiduicSequence
Represents alpha helices.
Parameters: - helix_id (str) – The helix’s ID.
- residues – The residues in this helix.
- helix_class (str) – The classification of the helix.
- comment (str) – Any comment associated with this helix.
-
helix_class
(helix_class=None)[source]¶ Returns or sets the helix’s classification.
Parameters: helix_class (str) – If given, the class will be set to this. Return type: str
-
class
molecupy.structures.chains.
BetaStrand
(strand_id, sense, *residues)[source]¶ Base class:
ResiduicSequence
Represents beta strands.
Parameters: - strand_id (str) – The strand’s ID.
- residues – The residues in this strand.
- sense (int) – The sense of the strand with respect to the prior strand.