Package: gc-meox-tms
In silico derivatizationOverviewThis package performs in-silico MeOX + TMS derivatization (as described e.g. inhttps://doi.org/10.1021/acs.analchem.7b01010):Methoximation: ketone R(C=O)R' and aldehyde (-HC=O) karboxyl groups
are substituted with -C=NOCH3Trimethylsilylation: the acidic hydrogen in -OH, -SH, -COOH, -NH2, -NHR, =NH, the hydrogen is substituted with -Si(CH3)3The substitution needn't happen always, their probability currently hardcoded in the package.
Typically, multiple substitution attempts are run on each input molecule, and all distinct results are gathered.Known limitation is methoximation on cycles which should be broken. This is not implemented yet.InstallationThere are a few ways to installgc-meox-tms:Install in a newcondaenvironment (recommended):$condacreate-ngc-meox-tms-cbiocondagc-meox-tms
$condaactivategc-meox-tmsFrom source by cloning the repository and installing the package withpipas follows:$gitclonehttps://github.com/RECETOX/gc-meox-tms.git# install the package:$python-mpipinstallgc-meox-tms# if you want to run examples in the Jupyter notebook, install with this command:$python-mpipinstallgc-meox-tms[eda]Install via Conda:$condacreate--namegc-meox-tmsgc-meox-tms
$condaactivategc-meox-tmsUsageCommand-Line Toolgc-meox-tmscan be used as a command line tool to produce all MeOX/TMS derivatives of given compounds. To use it via
the command line you will need one or moretxtfiles with chemical compounds represented as SMILES
(one SMILES per line). The tool can output results in flattxtformat(one compound per line) or tab separatedtsvformat (all derivatives of a given molecule per line).$python-mgc_meox_tms\-f<pathtowriteflattxtresult>\-t<pathtowritetabseparatedresult>\<pathstoinputtxtfiles>More parameters can be specified, such as number of cores or repeats. For more information run:$python-mgc_meox_tms--helpPython PackagePackage provides functions:is_derivatized()checks whether the molecule contains MeOX or TMS groups that are likely to be result of derivatizationremove_derivatization_groups()removes the suspected groups, reconstructing the original moleculeadd_derivatization_groups()does the substitution abovefromgc_meox_tmsimportadd_derivatization_groups,is_derivatized,remove_derivatization_groupsfromrdkit.ChemimportMolToSmiles# Example compounds in SMILES formatcompounds=["CC=O","CC=NOC","CCO[Si](C)(C)C"]# Check derivatization[is_derivatized(smiles=smiles)forsmilesincompounds]>>>[False,True,True]# Remove derivatization groups from derivatized moleculesunderivatized=[remove_derivatization_groups(smiles=smiles)forsmilesincompounds[1:]]print([MolToSmiles(mol)formolinunderivatized])>>>["CC=O","CCO"]# Convert molecules back to derivatized formsrederivatized=[add_derivatization_groups(mol=mol)formolinunderivatized]print([MolToSmiles(mol)formolinrederivatized])>>>['CC=NOC','CCO[Si](C)(C)C']Note that your results may differ from the presented sinceadd_derivatization_groupsis not deterministic. If you rerun
the function enough times you will get all possible derivatizations. The number of reruns to obtain all possible conformations
is individual for each compound (depends on possible conversion degrees etc.).See also the Jupyter notebook inexample/directory for more examples.Developer documentationInstallationCreate a virtual environment of your choice (e.g., conda or venv).
The development version can be installed with conda or pip as follows:# 1. Fork and clone the repository$gitclonehttps://github.com/<YOUR_GITHUB_USERNAME>/gc-meox-tms.git
$cdgc-meox-tms# 2a. To create a conda env run from the package directory:$condaenvcreate-fconda/environment-dev.yaml
$condaactivategc-meox-tms-dev# 2b. Alternatively, install using python venv:$python3-mvenvgc-meox-tms-dev
$sourcegc-meox-tms-dev/bin/activate
$pipinstall-e.[dev]ContributingBefore opening a PR make sure all the tests are passing by runningpytestfrom within the package directory:$pytestIt may happen that some tests which are dependent on probabilistic logic may fail. If that occurs,
try rerunning the tests. Usually one rerun is enough.We strongly advise you to add new tests for the functionality that you want to contribute. If you want to check whether
your changes are covered with tests, run$ pytest --covand examine the output to see what parts may need better test coverage.Run linter, to make sure all is nicely formatted:$flake8# if you use venv, exclude venv directory from linting$flake8--exclude'gc-meox-tms-dev'Lastly make sure the Python imports are in a proper order:$isortgc_meox_tms