The isoenum API Reference¶
This package provides routines to generate isotopically-resolved InChI
(International Chemical Identifier) from non-isotopically labeled CTfile
formatted files (e.g. Molfiles, SDfiles) or non-isotopically labeled
InChI identifiers.
This package includes the following modules:
cli- This module provides the command-line interface for the
isoenumpackage. api- This module provides routines to augment
CTfileobjects with additional information and used byisoenumpackage CLI. labeling- This module provides functions for generating a labeling schema.
nmr- This module provides descriptions of coupling combinations that could be observed within NMR experiments.
openbabel- This module provides functions to call the Open Babel software to convert
between
InChIandCTfileformatted files. conf- This module provides the processing of configuration files necessary for isotopic enumerator.
fileio- This module provides functions for generating
CTfileobjects and convertCTfileobjects intoInChI. utils- This module provides reusable utility functions.
exceptions- This module provides
isoenumpackage custom exceptions.
isoenum.cli¶
Isotopic enumerator (isoenum) command-line interface
- Usage:
isoenum -h | –help
isoenum –version
- isoenum name (<path-to-ctfile-file-or-inchi-file-or-inchi-string>)
- [–specific=<isotope:element:position>…] [–all=<isotope:element>…] [–enumerate=<isotope:element:min:max>…] [–complete | –partial] [–ignore-iso] [–format=<format>] [–output=<path>] [–verbose]
- isoenum ionize (<path-to-ctfile-file-or-inchi-file-or-inchi-string>)
- (–state=<element:position:charge>…) [–format=<format>] [–output=<path>]
- isoenum nmr (<path-to-ctfile-file-or-inchi-file-or-inchi-string>)
- [–type=<experiment-type>] [–jcoupling=<name>…] [–decoupled=<element>…] [–format=<format>] [–output=<path>] [–subset] [–verbose]
- isoenum vis (<path-to-ctfile-file-or-inchi-file-or-inchi-string>)
- (–format=<format>) (–output=<path>)
- Options:
-h, --help Show this screen. --verbose Print more information. -v, --version Show version. -a, --all=<isotope:element> Specify element and isotope, e.g. -a 13:C or –all=13:C -s, --specific=<isotope:element:position> Specify element, isotope and specific position, e.g. -s 13:C:1 or –specific=13:C:1. -e, --enumerate=<isotope:element:min:max> Enumerate all isotopically-resolved CTfile or InChI, e.g. -e 13:C:2:4 or –enumerate=13:C:2:4 -c, --complete Use complete labeling schema, i.e. every atom must specify “ISO” property, partial labeling schema will be used otherwise for specified labeling information only. -p, --partial Use partial labeling schema, i.e. generate labeling schema from the provided labeling information. -i, --ignore-iso Ignore existing “ISO” specification in the CTfile or InChI. -f, --format=<format> Format of output: inchi, mol, sdf, csv, json [default: inchi]. -o, --output=<path> Path to output file. -t, --type=<experiment-type> Type of NMR experiment [default: 1D1H]. -j, --jcoupling=<type> Allowed J couplings. -d, --decoupled=<element> Turn off J coupling for a given element. -z, --state=<element:position:charge> Create ionized form of InChI from neutral molecule, e.g. N:6:+1, O:8:-1. --subset Create atom subsets for each resonance.
-
isoenum.cli.cli(cmdargs)[source]¶ Process command-line arguments.
Parameters: cmdargs (dict) – Command-line arguments. Returns: None. Return type: None
-
isoenum.cli.save_output(outputstr, path, file_format)[source]¶ Save output results into file or print to stdout.
Parameters: Returns: None.
Return type:
isoenum.labeling¶
This module contains a function to generate a labeling schema based on provided cli parameters.
-
isoenum.labeling.create_labeling_schema(complete_labeling_schema, ignore_existing_isotopes, all_iso, specific_iso, existing_iso, enumerate_iso, isotopes_conf, ctfile)[source]¶ Create labeling schema.
Parameters: - complete_labeling_schema (bool) – Specifies if default isotopes to be added to isotopic layer.
- ignore_existing_isotopes (bool) – Specifies if will ignore existing isotopic layer.
- all_iso (dict) – Atom specific isotopes –all option.
- specific_iso (dict) – Atom number specific isotopes from –specific option.
- existing_iso (dict) – Atom number specific isotopes from
Molfile. - enumerate_iso (list) – List of isotopes from –enumerate option.
- isotopes_conf (dict) – Default isotopes.
- ctfile (
Molfile) – Instance ofMolfile.
Returns: Labeling schema.
Return type:
isoenum.nmr¶
This module provides descriptions of coupling combinations that could be observed within NMR experiments.
-
class
isoenum.nmr.Coupling(coupling_path=None, nmr_active_atoms=None, subset_atoms=None)[source]¶ Coupling provides information on the connectivity of molecules.
-
is_resonance_compatible(resonance)[source]¶ Test if coupling is compatible with resonance.
Parameters: resonance ( Coupling) – Subclass ofCoupling.Returns: True if compatible, False otherwise. Return type: Trueor False
-
classmethod
couplings(atom)[source]¶ Generate list of possible couplings for a given atom type.
Parameters: atom ( ctfile.Atom) – Atom type.Returns: List of couplings. Return type: list
-
name¶ Specific coupling name that indicates interacting atoms.
Returns: Specific coupling name. Return type: str
-
-
class
isoenum.nmr.J1CH(coupling_path=None, nmr_active_atoms=None, subset_atoms=None)[source]¶ J1CH coupling type: C-H.
-
class
isoenum.nmr.J2HH(coupling_path=None, nmr_active_atoms=None, subset_atoms=None)[source]¶ J2HH coupling type: H-C-H.
-
class
isoenum.nmr.J3HH(coupling_path=None, nmr_active_atoms=None, subset_atoms=None)[source]¶ J3HH coupling type: H-C-C-H.
-
class
isoenum.nmr.HResonance(coupling_path=None, nmr_active_atoms=None, subset_atoms=None)[source]¶ Hydrogen resonance.
-
class
isoenum.nmr.NMRExperiment(name, couplings, decoupled, default_coupling_definitions)[source]¶ NMR experiment.
-
class
isoenum.nmr.NMR1D1H(name, couplings=None, decoupled=None, default_coupling_definitions=(HResonance(coupling_path=None), J1CH(coupling_path=None), J2HH(coupling_path=None), J3HH(coupling_path=None)))[source]¶ 1D 1H NMR experiment.
-
class
isoenum.nmr.NMR1DCHSQC(name, couplings=None, decoupled=None, default_coupling_definitions=(HResonance(coupling_path=None), J1CH(coupling_path=None), J2HH(coupling_path=None), J3HH(coupling_path=None)))[source]¶ 1D 13C HSQC NMR experiment.
isoenum.conf¶
This module provides processing of configuration files necessary for isotopic enumerator.
isoenum.fileio¶
This module provides routines to generate CTfile objects and
convert CTfile objects into InChI and vice versa.
-
isoenum.fileio.create_ctfile(path_or_id, xyx_coordinates='--gen2D', explicit_hydrogens='-h')[source]¶ Guess what type of path is provided, i.e. is it existing file in
Molfileformat, existing file inSDfilefile format, existing file containingInChIstring, orInChIstring and tries to createCTfileobject.Parameters: Returns: Subclass of
CTfileobject.Return type: MolfileorSDfile
-
isoenum.fileio.create_ctfile_from_ctfile_str(ctfile_str)[source]¶ Create
CTfileobject fromCTfilestring.Parameters: ctfile_str (str) – CTfilestring.Returns: Subclass of CTfileobject.Return type: CTfile
-
isoenum.fileio.create_ctfile_from_identifier_file(path, output_format='mol', **options)[source]¶ Create
CTfileinstance fromInChIorSMILESidentifier file.Parameters: Returns: Subclass of
CTfileobject.Return type: CTfile
-
isoenum.fileio.create_ctfile_from_identifier_str(identifier_str, output_format='mol', **options)[source]¶ Create
CTfileinstance fromInChIorSMILESidentifier string.Parameters: Returns: Subclass of
CTfileobject.Return type: CTfile
-
isoenum.fileio.guess_identifier_format(identifier_str)[source]¶ Guess identifier format.
Parameters: identifier_str (str) – Chemical identifier string. Returns: ‘inchi’ or ‘smiles’ string. Return type: str
-
isoenum.fileio.create_inchi_from_ctfile_obj(ctf, **options)[source]¶ Create
InChIfromCTfileinstance.Parameters: ctf ( CTfile) – Instance ofCTfile.Returns: InChIstring.Return type: str
-
isoenum.fileio.normalize_ctfile_obj(ctf, xyx_coordinates='--gen2D', explicit_hydrogens='-h')[source]¶ Normalize
CTfileobject.Parameters: ctf ( CTfile) –CTfileobject.Returns: Normalized CTfileobject.Return type: CTfile
-
isoenum.fileio.create_empty_sdfile_obj()[source]¶ Create empty
SDfileobject.Returns: SDfileobject.Return type: SDfile
-
isoenum.fileio.create_empty_molfile_obj()[source]¶ Create empty
Molfileobject.Returns: Molfileobject.Return type: Molfile
isoenum.utils¶
This module provides reusable utility functions.
isoenum.openbabel¶
This module provides convert() to convert
between different file formats used in molecular modeling and computational
chemistry (e.g. InChI, SMILES, Molfile, etc.).