skchem.standardizers package

Submodules

skchem.standardizers.chemaxon module

## skchem.standardizers.chemaxon

Module wrapping ChemAxon Standardizer. Must have standardizer installed and license activated.

class skchem.standardizers.chemaxon.ChemAxonStandardizer(config_path=None, keep_failed=False, **kwargs)[source]

Bases: skchem.base.CLIWrapper, skchem.base.BatchTransformer, skchem.base.Transformer, skchem.filters.base.TransformFilter

ChemAxon Standardizer Wrapper.

Parameters:config_path (str) – The path of the config_file. If None, use the default one.

Notes

ChemAxon Standardizer must be installed and accessible as standardize from the shell launching the program.

Warning

Must use a unique index (see #31).

Examples

>>> import skchem
>>> std = skchem.standardizers.ChemAxonStandardizer() 
>>> m = skchem.Mol.from_smiles('CC.CCC')
>>> print(std.transform(m)) 
<Mol: CCC>
>>> data = [m, skchem.Mol.from_smiles('C=CO'), skchem.Mol.from_smiles('C[O-]')]
>>> std.transform(data) 
0     <Mol: CCC>
1    <Mol: CC=O>
2      <Mol: CO>
Name: structure, dtype: object
>>> will_fail = mol = '''932-97-8
...      RDKit          3D
...
...   9  9  0  0  0  0  0  0  0  0999 V2000
...    -0.9646    0.0000    0.0032 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -0.2894   -1.2163    0.0020 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -0.2894    1.2163    0.0025 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -2.2146    0.0000   -0.0004 N   0  0  0  0  0  0  0  0  0  0  0  0
...     1.0710   -1.2610    0.0002 C   0  0  0  0  0  0  0  0  0  0  0  0
...     1.0710    1.2610    0.0007 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -3.3386    0.0000   -0.0037 N   0  0  0  0  0  0  0  0  0  0  0  0
...     1.8248    0.0000   -0.0005 C   0  0  0  0  0  0  0  0  0  0  0  0
...     3.0435    0.0000   -0.0026 O   0  0  0  0  0  0  0  0  0  0  0  0
...   1  2  1  0
...   1  3  1  0
...   1  4  2  3
...   2  5  2  0
...   3  6  2  0
...   4  7  2  0
...   5  8  1  0
...   8  9  2  0
...   6  8  1  0
... M  CHG  2   4   1   7  -1
... M  END
... '''
>>> will_fail = skchem.Mol.from_molblock(will_fail)
>>> std.transform(will_fail) 
nan
>>> data = [will_fail] + data
>>> std.transform(data) 
0           None
1     <Mol: CCC>
2    <Mol: CC=O>
3      <Mol: CO>
Name: structure, dtype: object
>>> std.transform_filter(data) 
1     <Mol: CCC>
2    <Mol: CC=O>
3      <Mol: CO>
Name: structure, dtype: object
>>> std.keep_failed = True 
>>> std.transform(data) 
0    <Mol: [N-]=[N+]=C1C=CC(=O)C=C1>
1                         <Mol: CCC>
2                        <Mol: CC=O>
3                          <Mol: CO>
Name: structure, dtype: object
DEFAULT_CONFIG = '/home/docs/checkouts/readthedocs.org/user_builds/scikit-chem/checkouts/latest/skchem/standardizers/default_config.xml'
columns
filter(*args, **kwargs)[source]
install_hint = ' Install ChemAxon from https://www.chemaxon.com. It requires a license,\n which can be freely obtained for academics. '
monitor_progress(filename)[source]
static validate_install()[source]

Check if we can call cxcalc.

Module contents

class skchem.standardizers.ChemAxonStandardizer(config_path=None, keep_failed=False, **kwargs)[source]

Bases: skchem.base.CLIWrapper, skchem.base.BatchTransformer, skchem.base.Transformer, skchem.filters.base.TransformFilter

ChemAxon Standardizer Wrapper.

Parameters:config_path (str) – The path of the config_file. If None, use the default one.

Notes

ChemAxon Standardizer must be installed and accessible as standardize from the shell launching the program.

Warning

Must use a unique index (see #31).

Examples

>>> import skchem
>>> std = skchem.standardizers.ChemAxonStandardizer() 
>>> m = skchem.Mol.from_smiles('CC.CCC')
>>> print(std.transform(m)) 
<Mol: CCC>
>>> data = [m, skchem.Mol.from_smiles('C=CO'), skchem.Mol.from_smiles('C[O-]')]
>>> std.transform(data) 
0     <Mol: CCC>
1    <Mol: CC=O>
2      <Mol: CO>
Name: structure, dtype: object
>>> will_fail = mol = '''932-97-8
...      RDKit          3D
...
...   9  9  0  0  0  0  0  0  0  0999 V2000
...    -0.9646    0.0000    0.0032 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -0.2894   -1.2163    0.0020 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -0.2894    1.2163    0.0025 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -2.2146    0.0000   -0.0004 N   0  0  0  0  0  0  0  0  0  0  0  0
...     1.0710   -1.2610    0.0002 C   0  0  0  0  0  0  0  0  0  0  0  0
...     1.0710    1.2610    0.0007 C   0  0  0  0  0  0  0  0  0  0  0  0
...    -3.3386    0.0000   -0.0037 N   0  0  0  0  0  0  0  0  0  0  0  0
...     1.8248    0.0000   -0.0005 C   0  0  0  0  0  0  0  0  0  0  0  0
...     3.0435    0.0000   -0.0026 O   0  0  0  0  0  0  0  0  0  0  0  0
...   1  2  1  0
...   1  3  1  0
...   1  4  2  3
...   2  5  2  0
...   3  6  2  0
...   4  7  2  0
...   5  8  1  0
...   8  9  2  0
...   6  8  1  0
... M  CHG  2   4   1   7  -1
... M  END
... '''
>>> will_fail = skchem.Mol.from_molblock(will_fail)
>>> std.transform(will_fail) 
nan
>>> data = [will_fail] + data
>>> std.transform(data) 
0           None
1     <Mol: CCC>
2    <Mol: CC=O>
3      <Mol: CO>
Name: structure, dtype: object
>>> std.transform_filter(data) 
1     <Mol: CCC>
2    <Mol: CC=O>
3      <Mol: CO>
Name: structure, dtype: object
>>> std.keep_failed = True 
>>> std.transform(data) 
0    <Mol: [N-]=[N+]=C1C=CC(=O)C=C1>
1                         <Mol: CCC>
2                        <Mol: CC=O>
3                          <Mol: CO>
Name: structure, dtype: object
DEFAULT_CONFIG = '/home/docs/checkouts/readthedocs.org/user_builds/scikit-chem/checkouts/latest/skchem/standardizers/default_config.xml'
columns
filter(*args, **kwargs)[source]
install_hint = ' Install ChemAxon from https://www.chemaxon.com. It requires a license,\n which can be freely obtained for academics. '
monitor_progress(filename)[source]
static validate_install()[source]

Check if we can call cxcalc.