API documentation¶
This part of the documentation is automatically generated from the MolVS source code and comments.
The MolVS package is made up of the following modules:
molvs.standardize¶
This module contains the main Standardizer
class that can be used to perform all
standardization tasks, as well as convenience functions like standardize_smiles()
for common
standardization tasks.
-
class
molvs.standardize.
Standardizer
(normalizations=NORMALIZATIONS, acid_base_pairs=ACID_BASE_PAIRS, tautomer_transforms=TAUTOMER_TRANSFORMS, tautomer_scores=TAUTOMER_SCORES, max_restarts=MAX_RESTARTS, max_tautomers=MAX_TAUTOMERS, prefer_organic=PREFER_ORGANIC)[source]¶ The main class for performing standardization of molecules and deriving parent molecules.
The primary usage is via the
standardize()
method:s = Standardizer() mol1 = Chem.MolFromSmiles('C1=CC=CC=C1') mol2 = s.standardize(mol1)
There are separate methods to derive fragment, charge, tautomer, isotope and stereo parent molecules.
Initialize a Standardizer with optional custom parameters.
Parameters: - normalizations – A list of Normalizations to apply (default:
NORMALIZATIONS
). - acid_base_pairs – A list of AcidBasePairs for competitive reionization (default:
ACID_BASE_PAIRS
). - charge_corrections – A list of ChargeCorrections to apply (default:
CHARGE_CORRECTIONS
). - tautomer_transforms – A list of TautomerTransforms to apply (default:
TAUTOMER_TRANSFORMS
). - tautomer_scores – A list of TautomerScores used to determine canonical tautomer (default:
TAUTOMER_SCORES
). - max_restarts – The maximum number of times to attempt to apply the series of normalizations (default 200).
- max_tautomers – The maximum number of tautomers to enumerate (default 1000).
- prefer_organic – Whether to prioritize organic fragments when choosing fragment parent (default False).
-
__call__
(mol)[source]¶ Calling a Standardizer instance like a function is the same as calling its
standardize()
method.
-
standardize
(mol)[source]¶ Return a standardized version the given molecule.
The standardization process consists of the following stages: RDKit
RemoveHs()
, RDKitSanitizeMol()
,MetalDisconnector
,Normalizer
,Reionizer
, RDKitAssignStereochemistry()
.Parameters: mol (rdkit.Chem.rdchem.Mol) – The molecule to standardize. Returns: The standardized molecule. Return type: rdkit.Chem.rdchem.Mol
-
tautomer_parent
(mol, skip_standardize=False)[source]¶ Return the tautomer parent of a given molecule.
Parameters: - mol (rdkit.Chem.rdchem.Mol) – The input molecule.
- skip_standardize (bool) – Set to True if mol has already been standardized.
Returns: The tautomer parent molecule.
Return type:
-
fragment_parent
(mol, skip_standardize=False)[source]¶ Return the fragment parent of a given molecule.
The fragment parent is the largest organic covalent unit in the molecule.
Parameters: - mol (rdkit.Chem.rdchem.Mol) – The input molecule.
- skip_standardize (bool) – Set to True if mol has already been standardized.
Returns: The fragment parent molecule.
Return type:
-
stereo_parent
(mol, skip_standardize=False)[source]¶ Return the stereo parent of a given molecule.
The stereo parent has all stereochemistry information removed from tetrahedral centers and double bonds.
Parameters: - mol (rdkit.Chem.rdchem.Mol) – The input molecule.
- skip_standardize (bool) – Set to True if mol has already been standardized.
Returns: The stereo parent molecule.
Return type:
-
isotope_parent
(mol, skip_standardize=False)[source]¶ Return the isotope parent of a given molecule.
The isotope parent has all atoms replaced with the most abundant isotope for that element.
Parameters: - mol (rdkit.Chem.rdchem.Mol) – The input molecule.
- skip_standardize (bool) – Set to True if mol has already been standardized.
Returns: The isotope parent molecule.
Return type:
-
charge_parent
(mol, skip_standardize=False)[source]¶ Return the charge parent of a given molecule.
The charge parent is the uncharged version of the fragment parent.
Parameters: - mol (rdkit.Chem.rdchem.Mol) – The input molecule.
- skip_standardize (bool) – Set to True if mol has already been standardized.
Returns: The charge parent molecule.
Return type:
-
super_parent
(mol, skip_standardize=False)[source]¶ Return the super parent of a given molecule.
THe super parent is fragment, charge, isotope, stereochemistry and tautomer insensitive. From the input molecule, the largest fragment is taken. This is uncharged and then isotope and stereochemistry information is discarded. Finally, the canonical tautomer is determined and returned.
Parameters: - mol (rdkit.Chem.rdchem.Mol) – The input molecule.
- skip_standardize (bool) – Set to True if mol has already been standardized.
Returns: The super parent molecule.
Return type:
-
disconnect_metals
¶ Returns: A callable MetalDisconnector
instance.
-
normalize
¶ Returns: A callable Normalizer
instance.
-
remove_fragments
¶ Returns: A callable FragmentRemover
instance.
-
largest_fragment
¶ Returns: A callable LargestFragmentChooser
instance.
-
enumerate_tautomers
¶ Returns: A callable TautomerEnumerator
instance.
-
canonicalize_tautomer
¶ Returns: A callable TautomerCanonicalizer
instance.
- normalizations – A list of Normalizations to apply (default:
-
molvs.standardize.
standardize_smiles
(smiles)[source]¶ Return a standardized canonical SMILES string given a SMILES string.
Note: This is a convenience function for quickly standardizing a single SMILES string. It is more efficient to use the
Standardizer
class directly when working with many molecules or when custom options are needed.Parameters: smiles (string) – The SMILES for the molecule. Returns: The SMILES for the standardized molecule. Return type: string.
-
molvs.standardize.
enumerate_tautomers_smiles
(smiles)[source]¶ Return a set of tautomers as SMILES strings, given a SMILES string.
Parameters: smiles – A SMILES string. Returns: A set containing SMILES strings for every possible tautomer. Return type: set of strings.
-
molvs.standardize.
canonicalize_tautomer_smiles
(smiles)[source]¶ Return a standardized canonical tautomer SMILES string given a SMILES string.
Note: This is a convenience function for quickly standardizing and finding the canonical tautomer for a single SMILES string. It is more efficient to use the
Standardizer
class directly when working with many molecules or when custom options are needed.Parameters: smiles (string) – The SMILES for the molecule. Returns: The SMILES for the standardize canonical tautomer. Return type: string.
molvs.normalize¶
This module contains tools for normalizing molecules using reaction SMARTS patterns.
-
molvs.normalize.
NORMALIZATIONS
¶ The default list of Normalization transforms.
-
molvs.normalize.
MAX_RESTARTS
= 200¶ The default value for the maximum number of times to attempt to apply the series of normalizations.
-
class
molvs.normalize.
Normalization
(name, transform)[source]¶ A normalization transform defined by reaction SMARTS.
Parameters: - name (string) – A name for this Normalization
- transform (string) – Reaction SMARTS to define the transformation.
-
class
molvs.normalize.
Normalizer
(normalizations=NORMALIZATIONS, max_restarts=MAX_RESTARTS)[source]¶ A class for applying Normalization transforms.
This class is typically used to apply a series of Normalization transforms to correct functional groups and recombine charges. Each transform is repeatedly applied until no further changes occur.
Initialize a Normalizer with an optional custom list of
Normalization
transforms.Parameters: - normalizations – A list of
Normalization
transforms to apply. - max_restarts (int) – The maximum number of times to attempt to apply the series of normalizations (default 200).
-
__call__
(mol)[source]¶ Calling a Normalizer instance like a function is the same as calling its normalize(mol) method.
-
normalize
(mol)[source]¶ Apply a series of Normalization transforms to correct functional groups and recombine charges.
A series of transforms are applied to the molecule. For each Normalization, the transform is applied repeatedly until no further changes occur. If any changes occurred, we go back and start from the first Normalization again, in case the changes mean an earlier transform is now applicable. The molecule is returned once the entire series of Normalizations cause no further changes or if max_restarts (default 200) is reached.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The molecule to normalize. Returns: The normalized fragment. Return type: rdkit.Chem.rdchem.Mol
- normalizations – A list of
molvs.metal¶
This module contains tools for disconnecting metal atoms that are defined as covalently bonded to non-metals.
-
class
molvs.metal.
MetalDisconnector
[source]¶ Class for breaking covalent bonds between metals and organic atoms under certain conditions.
-
__call__
(mol)[source]¶ Calling a MetalDisconnector instance like a function is the same as calling its disconnect(mol) method.
-
disconnect
(mol)[source]¶ Break covalent bonds between metals and organic atoms under certain conditions.
The algorithm works as follows:
- Disconnect N, O, F from any metal.
- Disconnect other non-metals from transition metals + Al (but not Hg, Ga, Ge, In, Sn, As, Tl, Pb, Bi, Po).
- For every bond broken, adjust the charges of the begin and end atoms accordingly.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The input molecule. Returns: The molecule with metals disconnected. Return type: rdkit.Chem.rdchem.Mol
-
molvs.tautomer¶
This module contains tools for enumerating tautomers and determining a canonical tautomer.
-
molvs.tautomer.
TAUTOMER_TRANSFORMS
¶ The default list of TautomerTransforms.
-
molvs.tautomer.
TAUTOMER_SCORES
¶ The default list of TautomerScores.
-
molvs.tautomer.
MAX_TAUTOMERS
= 1000¶ The default value for the maximum number of tautomers to enumerate, a limit to prevent combinatorial explosion.
-
class
molvs.tautomer.
TautomerTransform
(name, smarts, bonds=(), charges=(), radicals=())[source]¶ Rules to transform one tautomer to another.
Each TautomerTransform is defined by a SMARTS pattern where the transform involves moving a hydrogen from the first atom in the pattern to the last atom in the pattern. By default, alternating single and double bonds along the pattern are swapped accordingly to account for the hydrogen movement. If necessary, the transform can instead define custom resulting bond orders and also resulting atom charges.
Initialize a TautomerTransform with a name, SMARTS pattern and optional bonds and charges.
The SMARTS pattern match is applied to a Kekule form of the molecule, so use explicit single and double bonds rather than aromatic.
Specify custom bonds as a string of
-
,=
,#
,:
for single, double, triple and aromatic bonds respectively. Specify custom charges as+
,0
,-
for +1, 0 and -1 charges respectively.Parameters: - name (string) – A name for this TautomerTransform.
- smarts (string) – SMARTS pattern to match for the transform.
- bonds (string) – Optional specification for the resulting bonds.
- charges (string) – Optional specification for the resulting charges on the atoms.
-
class
molvs.tautomer.
TautomerScore
(name, smarts, score)[source]¶ A substructure defined by SMARTS and its score contribution to determine the canonical tautomer.
Initialize a TautomerScore with a name, SMARTS pattern and score.
Parameters: - name – A name for this TautomerScore.
- smarts – SMARTS pattern to match a substructure.
- score – The score to assign for this substructure.
-
class
molvs.tautomer.
TautomerCanonicalizer
(transforms=TAUTOMER_TRANSFORMS, scores=TAUTOMER_SCORES, max_tautomers=MAX_TAUTOMERS)[source]¶ Parameters: - transforms – A list of TautomerTransforms to use to enumerate tautomers.
- scores – A list of TautomerScores to use to choose the canonical tautomer.
- max_tautomers – The maximum number of tautomers to enumerate, a limit to prevent combinatorial explosion.
-
__call__
(mol)[source]¶ Calling a TautomerCanonicalizer instance like a function is the same as calling its canonicalize(mol) method.
-
canonicalize
(mol)[source]¶ Return a canonical tautomer by enumerating and scoring all possible tautomers.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The input molecule. Returns: The canonical tautomer. Return type: rdkit.Chem.rdchem.Mol
-
class
molvs.tautomer.
TautomerEnumerator
(transforms=TAUTOMER_TRANSFORMS, max_tautomers=MAX_TAUTOMERS)[source]¶ Parameters: - transforms – A list of TautomerTransforms to use to enumerate tautomers.
- max_tautomers – The maximum number of tautomers to enumerate (limit to prevent combinatorial explosion).
-
__call__
(mol)[source]¶ Calling a TautomerEnumerator instance like a function is the same as calling its enumerate(mol) method.
-
enumerate
(mol)[source]¶ Enumerate all possible tautomers and return them as a list.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The input molecule. Returns: A list of all possible tautomers of the molecule. Return type: list of rdkit.Chem.rdchem.Mol
molvs.fragment¶
This module contains tools for dealing with molecules with more than one covalently bonded unit. The main classes are
LargestFragmentChooser
, which returns the largest covalent unit in a molecule, and
FragmentRemover
, which filters out fragments from a molecule using SMARTS patterns.
-
molvs.fragment.
REMOVE_FRAGMENTS
¶ The default list of
FragmentPatterns
to be used byFragmentRemover
.
-
molvs.fragment.
LEAVE_LAST
= True¶ The default value for whether to ensure at least one fragment is left after FragmentRemover is applied.
-
molvs.fragment.
PREFER_ORGANIC
= False¶ The default value for whether LargestFragmentChooser sees organic fragments as “larger” than inorganic fragments.
-
class
molvs.fragment.
FragmentPattern
(name, smarts)[source]¶ A fragment defined by a SMARTS pattern.
Initialize a FragmentPattern with a name and a SMARTS pattern.
Parameters: - name – A name for this FragmentPattern.
- smarts – A SMARTS pattern.
-
molvs.fragment.
is_organic
(fragment)[source]¶ Return true if fragment contains at least one carbon atom.
Parameters: fragment – The fragment as an RDKit Mol object.
-
class
molvs.fragment.
FragmentRemover
(fragments=REMOVE_FRAGMENTS, leave_last=LEAVE_LAST)[source]¶ A class for filtering out fragments using SMARTS patterns.
Initialize a FragmentRemover with an optional custom list of
FragmentPattern
.Setting leave_last to True will ensure at least one fragment is left in the molecule, even if it is matched by a
FragmentPattern
. Fragments are removed in the order specified in the list, so place those you would prefer to be left towards the end of the list. If all the remaining fragments match the sameFragmentPattern
, they will all be left.Parameters: - fragments – A list of
FragmentPattern
to remove. - leave_last (bool) – Whether to ensure at least one fragment is left.
-
__call__
(mol)[source]¶ Calling a FragmentRemover instance like a function is the same as calling its remove(mol) method.
-
remove
(mol)[source]¶ Return the molecule with specified fragments removed.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The molecule to remove fragments from. Returns: The molecule with fragments removed. Return type: rdkit.Chem.rdchem.Mol
- fragments – A list of
-
class
molvs.fragment.
LargestFragmentChooser
(prefer_organic=PREFER_ORGANIC)[source]¶ A class for selecting the largest covalent unit in a molecule with multiple fragments.
If prefer_organic is set to True, any organic fragment will be considered larger than any inorganic fragment. A fragment is considered organic if it contains a carbon atom.
Parameters: prefer_organic (bool) – Whether to prioritize organic fragments above all others. -
__call__
(mol)[source]¶ Calling a LargestFragmentChooser instance like a function is the same as calling its choose(mol) method.
-
choose
(mol)[source]¶ Return the largest covalent unit.
The largest fragment is determined by number of atoms (including hydrogens). Ties are broken by taking the fragment with the higher molecular weight, and then by taking the first alphabetically by SMILES if needed.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The molecule to choose the largest fragment from. Returns: The largest fragment. Return type: rdkit.Chem.rdchem.Mol
-
molvs.charge¶
This module implements tools for manipulating charges on molecules. In particular, Reionizer
,
which competitively reionizes acids such that the strongest acids ionize first, and Uncharger
,
which attempts to neutralize ionized acids and bases on a molecule.
-
molvs.charge.
ACID_BASE_PAIRS
¶ The default list of AcidBasePairs, sorted from strongest to weakest. This list is derived from the Food and Drug Administration Substance Registration System Standard Operating Procedure guide.
-
class
molvs.charge.
AcidBasePair
(name, acid, base)[source]¶ An acid and its conjugate base, defined by SMARTS.
A strength-ordered list of AcidBasePairs can be used to ensure the strongest acids in a molecule ionize first.
Initialize an AcidBasePair with the following parameters:
Parameters: - name (string) – A name for this AcidBasePair.
- acid (string) – SMARTS pattern for the protonated acid.
- base (string) – SMARTS pattern for the conjugate ionized base.
-
class
molvs.charge.
Reionizer
(acid_base_pairs=ACID_BASE_PAIRS)[source]¶ A class to fix charges and reionize a molecule such that the strongest acids ionize first.
Initialize a Reionizer with the following parameter:
Parameters: - acid_base_pairs – A list of
AcidBasePairs
to reionize, sorted from strongest to weakest. - charge_corrections – A list of
ChargeCorrections
.
-
__call__
(mol)[source]¶ Calling a Reionizer instance like a function is the same as calling its reionize(mol) method.
-
reionize
(mol)[source]¶ Enforce charges on certain atoms, then perform competitive reionization.
First, charge corrections are applied to ensure, for example, that free metals are correctly ionized. Then, if a molecule with multiple acid groups is partially ionized, ensure the strongest acids ionize first.
The algorithm works as follows:
- Use SMARTS to find the strongest protonated acid and the weakest ionized acid.
- If the ionized acid is weaker than the protonated acid, swap proton and repeat.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The molecule to reionize. Returns: The reionized molecule. Return type: rdkit.Chem.rdchem.Mol
- acid_base_pairs – A list of
-
class
molvs.charge.
Uncharger
(acid_base_pairs=(AcidBasePair('-OSO3H', 'OS(=O)(=O)[OH]', 'OS(=O)(=O)[O-]'), AcidBasePair('–SO3H', '[!O]S(=O)(=O)[OH]', '[!O]S(=O)(=O)[O-]'), AcidBasePair('-OSO2H', 'O[SD3](=O)[OH]', 'O[SD3](=O)[O-]'), AcidBasePair('-SO2H', '[!O][SD3](=O)[OH]', '[!O][SD3](=O)[O-]'), AcidBasePair('-OPO3H2', 'OP(=O)([OH])[OH]', 'OP(=O)([OH])[O-]'), AcidBasePair('-PO3H2', '[!O]P(=O)([OH])[OH]', '[!O]P(=O)([OH])[O-]'), AcidBasePair('-CO2H', 'C(=O)[OH]', 'C(=O)[O-]'), AcidBasePair('thiophenol', 'c[SH]', 'c[S-]'), AcidBasePair('(-OPO3H)-', 'OP(=O)([O-])[OH]', 'OP(=O)([O-])[O-]'), AcidBasePair('(-PO3H)-', '[!O]P(=O)([O-])[OH]', '[!O]P(=O)([O-])[O-]'), AcidBasePair('phthalimide', 'O=C2c1ccccc1C(=O)[NH]2', 'O=C2c1ccccc1C(=O)[N-]2'), AcidBasePair('CO3H (peracetyl)', 'C(=O)O[OH]', 'C(=O)O[O-]'), AcidBasePair('alpha-carbon-hydrogen-nitro group', 'O=N(O)[CH]', 'O=N(O)[C-]'), AcidBasePair('-SO2NH2', 'S(=O)(=O)[NH2]', 'S(=O)(=O)[NH-]'), AcidBasePair('-OBO2H2', 'OB([OH])[OH]', 'OB([OH])[O-]'), AcidBasePair('-BO2H2', '[!O]B([OH])[OH]', '[!O]B([OH])[O-]'), AcidBasePair('phenol', 'c[OH]', 'c[O-]'), AcidBasePair('SH (aliphatic)', 'C[SH]', 'C[S-]'), AcidBasePair('(-OBO2H)-', 'OB([O-])[OH]', 'OB([O-])[O-]'), AcidBasePair('(-BO2H)-', '[!O]B([O-])[OH]', '[!O]B([O-])[O-]'), AcidBasePair('cyclopentadiene', 'C1=CC=C[CH2]1', 'c1ccc[cH-]1'), AcidBasePair('-CONH2', 'C(=O)[NH2]', 'C(=O)[NH-]'), AcidBasePair('imidazole', 'c1cnc[nH]1', 'c1cnc[n-]1'), AcidBasePair('-OH (aliphatic alcohol)', '[CX4][OH]', '[CX4][O-]'), AcidBasePair('alpha-carbon-hydrogen-keto group', 'O=C([!O])[C!H0+0]', 'O=C([!O])[C-]'), AcidBasePair('alpha-carbon-hydrogen-acetyl ester group', 'OC(=O)[C!H0+0]', 'OC(=O)[C-]'), AcidBasePair('sp carbon hydrogen', 'C#[CH]', 'C#[C-]'), AcidBasePair('alpha-carbon-hydrogen-sulfone group', 'CS(=O)(=O)[C!H0+0]', 'CS(=O)(=O)[C-]'), AcidBasePair('alpha-carbon-hydrogen-sulfoxide group', 'C[SD3](=O)[C!H0+0]', 'C[SD3](=O)[C-]'), AcidBasePair('-NH2', '[CX4][NH2]', '[CX4][NH-]'), AcidBasePair('benzyl hydrogen', 'c[CX4H2]', 'c[CX3H-]'), AcidBasePair('sp2-carbon hydrogen', '[CX3]=[CX3!H0+0]', '[CX3]=[CX2-]'), AcidBasePair('sp3-carbon hydrogen', '[CX4!H0+0]', '[CX3-]')))[source]¶ Class for neutralizing charges in a molecule.
This class uncharges molecules by adding and/or removing hydrogens. In cases where there is a positive charge that is not neutralizable, any corresponding negative charge is also preserved.
-
__call__
(mol)[source]¶ Calling an Uncharger instance like a function is the same as calling its uncharge(mol) method.
-
uncharge
(mol)[source]¶ Neutralize molecule by adding/removing hydrogens.
Parameters: mol (rdkit.Chem.rdchem.Mol) – The molecule to uncharge. Returns: The uncharged molecule. Return type: rdkit.Chem.rdchem.Mol
-
molvs.validate¶
This module contains the main Validator
class that can be used to perform all
Validations
, as well as the validate_smiles()
convenience function.
-
molvs.validate.
SIMPLE_FORMAT
= '%(levelname)s: [%(validation)s] %(message)s'¶ The default format for log messages.
-
molvs.validate.
LONG_FORMAT
= '%(asctime)s - %(levelname)s - %(validation)s - %(message)s'¶ A more detailed format for log messages. Specify when initializing a Validator.
-
class
molvs.validate.
Validator
(validations=VALIDATIONS, log_format=SIMPLE_FORMAT, level=logging.INFO, stdout=False, raw=False)[source]¶ The main class for running
Validations
on molecules.Initialize a Validator with the following parameters:
Parameters: - validations – A list of Validations to apply (default:
VALIDATIONS
). - log_format (string) – A string format (default:
SIMPLE_FORMAT
). - level – The minimum logging level to output.
- stdout (bool) – Whether to send log messages to standard output.
- raw (bool) – Whether to return raw
LogRecord
objects instead of formatted log strings.
- validations – A list of Validations to apply (default:
-
molvs.validate.
validate_smiles
(smiles)[source]¶ Return log messages for a given SMILES string using the default validations.
Note: This is a convenience function for quickly validating a single SMILES string. It is more efficient to use the
Validator
class directly when working with many molecules or when custom options are needed.Parameters: smiles (string) – The SMILES for the molecule. Returns: A list of log messages. Return type: list of strings.
molvs.validations¶
This module contains all the built-in Validations
.
-
molvs.validations.
VALIDATIONS
¶ The default list of
Validations
used byValidator
.
-
class
molvs.validations.
Validation
(log)[source]¶ The base class that all
Validation
subclasses must inherit from.
-
class
molvs.validations.
SmartsValidation
(log)[source]¶ Abstract superclass for
Validations
that log a message if a SMARTS pattern matches the molecule.Subclasses can override the following attributes:
-
level
= 20¶ The logging level of the message.
-
message
= 'Molecule matched %(smarts)s'¶ The message to log if the SMARTS pattern matches the molecule.
-
entire_fragment
= False¶ Whether the SMARTS pattern should match an entire covalent unit.
-
smarts
¶ The SMARTS pattern as a string. Subclasses must implement this.
-
-
class
molvs.validations.
IsNoneValidation
(log)[source]¶ Logs an error if
None
is passed to the Validator.This can happen if RDKit failed to parse an input format. If the molecule is
None
, no subsequent validations will run.
-
class
molvs.validations.
NoAtomValidation
(log)[source]¶ Logs an error if the molecule has zero atoms.
If the molecule has no atoms, no subsequent validations will run.
-
class
molvs.validations.
DichloroethaneValidation
(log)[source]¶ Logs if 1,2-dichloroethane is present.
This is provided as an example of how to subclass
SmartsValidation
to check for the presence of a substructure.
-
class
molvs.validations.
FragmentValidation
(log)[source]¶ Logs if certain fragments are present.
Subclass and override the
fragments
class attribute to customize the list ofFragmentPatterns
.
molvs.errors¶
This module contains exceptions that are raised by MolVS.