Macs in Chemistry

Insanely great science

 

Predicting sites of metabolism

It is really useful to have two sites of metabolism tools available that use contrasting methodologies, FAME 2 using curated dataset of experimentally determined metabolism data to build a machine learning model using simple descriptors. In contrast SMARTCyp uses precomputed activation energies from density functional theory (DFT) calculations of model compounds. These are used to predict the reactivity of similar fragments within the target molecule the final score is modified to reflect the accessibility to the active site of the different CYP450 iso forms and improvements for N-oxidations of tertiary amines are included, specifically an empirical corrections to unlikely oxidations of tertiary alkylamines.

I previously wrote a script displaying the results of a SMARTCyp calculation in a webview, The first part of the script imports the smartcyp.jar, however with each update I was finding issues so I thought it might be better to simply treat SMARTCyp as a command line application and use subprocess to access it.

SMARTCyp uses a large number of quantum chemical calculations of fragment activation energies have previously been performed. The results have been compiled into rules consisting of SMARTS patterns and associated energies. SMARTCyp only uses the 2D structure of a compound, and the energy required for oxidation at each atom is computed by fragment matching towards the SMARTS patterns. If multiple patterns match the same atom the pattern with the lowest energy is used. The accessibility is approximated as the relative topological distance of an atom from the center of the molecule, and the final score is computed as Score = energy - 8*accessibility.

The results are displayed as a web page using ChemDoodle Web components.

The Vortex scripts are shown below and can be downloaded from the link at the bottom of the page. REMEMBER you will need to edit some of the paths for your environment.

The SMARTCyp Vortex Script

# Using SMARTCyp from http://www.farma.ku.dk/smartcyp/
# P. Rydberg, D. E. Gloriam, J. Zaretzki, C. Breneman and L. Olsen, ACS Med. Chem. Lett., 2010, 1, 96-100 , P. Rydberg, D. E. Gloriam and L. Olsen, Bioinformatics, 2010, 26, 2988-2989, P. Rydberg and L. Olsen, ACS Med. Chem. Lett., 2012, 3, 69-73, , P. Rydberg and L. Olsen, ChemMedChem, 2012, 7, 1202-1209 , P. Rydberg et al., Angew. Chem, Int. Ed. 2013, 52, 993-997, and P. Rydberg et al., Mol. Pharmaceutics 2013, 10, 1216-1223 

# This script assumes the smartcyp.jar file is in /Users/username/vortex/modules/



import sys
import com.dotmatics.vortex.util.Util as Util
import subprocess



import tempfile

smiles = ''

col = vtable.findColumnWithName('Structure', 0)

if (col == None):
   col = vtable.findColumnWithName('SMILES', 0)
   if (col == None):
      vortex.alert('Load a workspace with a Structure or SMILES column please.')
      quit()
   else:
  smiles = col.getValueAsString(cell_row)
else:
   smiles = vortex.getMolProperty(vtable.getMolFileManager().getMolFileAtRow(cell_row), 'SMILES')
smiles = smiles.encode('utf-8')
vortex.alert('SMILES = '+smiles)

tmpdir = tempfile.mkdtemp()


# Command for SMARTCyp

#java -jar /Users/username/vortex/modules/smartcyp.jar -outputdir '/var/folders/_d/q7dkb9g934vbg8rd6pb59pmh0000gn/T/tmpNDbowQ' -outputfile 'temp2' -nocsv -smiles 'COc1ccc(c2c1OC1(CCCC1)C2)C1=NN(C2CCCCCC2)C(=O)[C@@H]2CCCC[C@@H]21' 

#You will need to edit the paths
subprocess.call(['/usr/bin/java', '-jar', '/Users/username/vortex/modules/smartcyp.jar', '-outputdir', tmpdir, '-outputfile', 'temp2', '-nocsv', '-smiles',  smiles], cwd='/Users/username/Public')



chart = vws.addChart(31)
plot = vws.findPlot(chart)
plot.setUrl('file://%s/temp2.html' % tmpdir)

The FAME2 Vortex Script

FAME 2 uses an extremely randomised trees approach which is a computationally efficient classification algorithm. FAME 2 uses circular descriptions of atoms and their environments.

#FAME 2: Simple and Effective Machine Learning Model of Cytochrome P450 Regioselectivity
#http://dx.doi.org/10.1021/acs.jcim.7b00250
# This script assumes the FAME2.jar file is in /Users/username/vortex/modules/fame2
#together with libraries



import sys
import com.dotmatics.vortex.util.Util as Util
import subprocess


import tempfile

smiles = ''

col = vtable.findColumnWithName('Structure', 0)

if (col == None):
   col = vtable.findColumnWithName('SMILES', 0)
   if (col == None):
      vortex.alert('Load a workspace with a Structure or SMILES column please.')
      quit()
   else:
      smiles = col.getValueAsString(cell_row)
else:
   smiles = vortex.getMolProperty(vtable.getMolFileManager().getMolFileAtRow(cell_row), 'SMILES')
smiles = smiles.encode('utf-8')
vortex.alert('SMILES = '+smiles)

tmpdir = tempfile.mkdtemp()
#tmpdir = '/Users/Chris/Public'


#java -jar /Users/username/Desktop/fame2/fame2.jar -s 'CC/C(=C(\c1ccccc1)c1ccc(cc1)OCCN(C)C)c1ccccc1'

#You will need to edit the paths
subprocess.call(['/usr/bin/java', '-jar', '/Users/username/vortex/modules/fame2/fame2.jar', '-o', tmpdir, '--smiles',  smiles], cwd='/Users/username/Public')


chart = vws.addChart(31)
plot = vws.findPlot(chart)
plot.setUrl('file://%s/mol_1_1/mol_1_1_soms.html' % tmpdir)

The scripts are activated by right-clicking on a row in the workspace allowing the user to choose the script from the dropdown menu, the calculation may take a few seconds depending on the size of the structure, and the results are shown below.

somprediction

The scripts can be downloaded here http://macinchem.org/reviews/vortex_scripts/FameSMARTSCyscripts.zip and need to be put in the context folder that is in the Vortex Add ons folder.

Last updated 21 September 2017