summaryrefslogtreecommitdiff
path: root/modelcif/descriptor.py
diff options
context:
space:
mode:
Diffstat (limited to 'modelcif/descriptor.py')
-rw-r--r--modelcif/descriptor.py68
1 files changed, 68 insertions, 0 deletions
diff --git a/modelcif/descriptor.py b/modelcif/descriptor.py
new file mode 100644
index 0000000..285ebee
--- /dev/null
+++ b/modelcif/descriptor.py
@@ -0,0 +1,68 @@
+"""Classes to describe the chemistry of custom chemical components.
+
+ If a given :class:`ihm.ChemComp` is not defined in either the wwPDB
+ chemical component dictionary (CCD) or the ModelArchive CCD, its
+ chemistry can be described with one or more of these objects. They
+ are passed as the ``descriptors`` argument when creating a new
+ :class:`ihm.ChemComp`.
+"""
+
+
+class Descriptor:
+ """Base class for all descriptors.
+ This class is generally not used directly; instead, a subclass
+ such as :class:`IUPACName` or :class:`InChI` is employed.
+
+ :param str value: The actual name or identifier describing
+ the chemistry.
+ :param str details: Additional details about this descriptor.
+ :param software: The software used to generate the descriptor, if any.
+ :type software: :class:`modelcif.Software`
+ """
+
+ def __init__(self, value, details=None, software=None):
+ self.value, self.details = value, details
+ self.software = software
+
+ def __repr__(self):
+ return "<%s(%s)>" % (self.__class__.__name__, repr(self.value))
+
+
+class CanonicalSMILES(Descriptor):
+ """Simplified Molecular-Input Line-Entry System (SMILES) computed from
+ chemical structure devoid of isotopic and stereochemical information."""
+ type = 'Canonical SMILES'
+
+
+class IsomericSMILES(Descriptor):
+ """Simplified Molecular-Input Line-Entry System (SMILES) computed from
+ chemical structure containing isotopic and stereochemical information.
+
+ SMILES written with isotopic and chiral specifications are collectively
+ known as isomeric SMILES."""
+ type = 'Isomeric SMILES'
+
+
+class IUPACName(Descriptor):
+ """Chemical name computed from chemical structure that uses International
+ Union of Pure and Applied Chemistry (IUPAC) nomenclature standards."""
+ type = 'IUPAC Name'
+
+
+class InChI(Descriptor):
+ """International Chemical Identifier (InChI) computed from chemical
+ structure using the International Union of Pure and Applied Chemistry
+ (IUPAC) standard."""
+ type = 'InChI'
+
+
+class InChIKey(Descriptor):
+ """International Chemical Identifier hash (InChIKey) computed from
+ chemical structure using the International Union of Pure and Applied
+ Chemistry (IUPAC) standard."""
+ type = 'InChI Key'
+
+
+class PubChemCID(Descriptor):
+ """PubChem Compound ID."""
+ type = 'PubChem CID'