Scripting Vortex 21
Well things can change quickly at times, in the last tutorial I wrote..
Well if you download the latest daily build of Vortex from the Dotmatics Support site there is a version that comes bundles with Java 8, if you download this version are a host of new options for displaying plots.
Loading a Web Page
We can demonstrate adding a plot and loading a web page with a few simple commands in the Vortex console (Vortex Script Menu:Vortex Add ons:console). First load a workspace and then open the Vortex console. Then type:-
vws.addChart(31) plot = vws.getPlot(0) plot.loadURL('www.macinchem.org')
The web view is fully functioning and you can click on links etc and follow links. You can of course replace the URL, and perhaps have a URL generated from a compound ID to link to an internal web server.
The web view even supports Java applets such as JMOL as shown below, including all the normal interactions with the applet.
The majority of metabolism of drugs is mediated by cytochromeP450 enzymes of the 57 different isoforms 3 enzymes account for the majority of metabolism as shown in the plot below. SMARTCyp is a method for prediction of which sites in a molecule that are most liable to metabolism by Cytochrome P450.
SMARTCyp is a method for prediction of which sites in a molecule that are most liable to metabolism by Cytochrome P450. It has been shown to be applicable to metabolism by the isoforms 1A2, 2A6, 2B6, 2C8, 2C19, 2E1, and 3A4 (CYP3A4), and specific models for the isoform 2C9 (CYP2C9) and isoform 2D6 (CYP2D6) are included from version 2.1. CYP3A4, CYP2D6, and CYP2C9 are the three of the most important enzymes in drug metabolism since they are involved in the metabolism of more than half of the drugs used today.
SMARTCyp is available as an executable java jar file.
java -jar smartcyp.jar [-nocsv] [-nohtml] [-printall] [-outputdir dirname] input-file-names
-nocsv results in only html output.
-nohtml results in only csv output and increased speed since no images are generated.
-printall will print all non-hydrogen atoms to the csv file for easier import into other software.
-outputdir dirname will save output files in dirname, if dirname does not exist it will be created.
-outputfile filename will save output files with basename "filename", i.e. filename.csv and filename.html
-png will create the old type of html output with png images, which was default until version 2.0. This is compatible with older web browsers, but makes SMARTCyp run slower, and will make the html pages load slower.
-smiles smilesstring will use the smiles string as input molecule.
-noempcorr will not use the new empirical N-oxidation correction implemented by default in version 2.3 and forward.
-filter XX will in addition to standard functionality also filter the input structures. All molecules containing a site with a score less than XX will be removed, and a new structure file will be saved as output without such molecules.
HTML and CSV file output is generated in the working directory
- L. Olsen, P. Rydberg, T. H. Rod, U. Ryde. Prediction of Activation Energies for Hydrogen Abstraction by Cytochrome P450 J. Med. Chem., 2006, 49, 6489-6499
- P. Rydberg, U. Ryde, L. Olsen. Prediction of Activation Energies for Aromatic Oxidation by Cytochrome P450 J. Phys. Chem. A, 2008, 112, 13058-13065
- P. Rydberg, P. Vasanthanathan, C. Oostenbrink, L. Olsen. Fast Prediction of Cytochrome P450 Mediated Drug Metabolism ChemMedChem, 2009, 4, 2070-2079
- P. Rydberg, D. E. Gloriam, J. Zaretzki, C. Breneman, L. Olsen. SMARTCyp: A 2D Method for Prediction of Cytochrome P450-Mediated Drug Metabolism ACS Med. Chem Lett., 2010, 1, 96-100
- P. Rydberg, U. Ryde, L. Olsen. Sulfoxide, Sulfur, and Nitrogen Oxidation and Dealkylation by Cytochrome P450 J. Chem. Theory Comput., 2008, 4, 1369-1377
- P. Rydberg, D.E. Gloriam, L. Olsen. The SMARTCyp cytochrome P450 metabolism prediction server Bioinformatics, 2010, 26, 2988-2989
- P. Rydberg and L. Olsen. Ligand-based Site of Metabolism Prediction for Cytochrome P450 2D6 ACS Med. Chem Lett., 2012, 3, 69-73
- P. Rydberg and L. Olsen. Predicting Drug Metabolism by Cytochrome P450 2C9 - Comparison to the 2D6 and 3A4 Isoforms ChemMedChem, 2012, 7, 1202-1209
- P. Rydberg et al.,Nitrogen Inversion Barriers Affect the N-Oxidation of Tertiary Alkylamines by Cytochromes P450 Angew. Chem, Int. Ed. 2013, 52, 993-997
- P. Rydberg et al., The Contribution of Atom Accessibility to Site of Metabolism Models for Cytochromes P450 Mol. Pharmaceutics 2013, 10, 1216-1223
The SMARTCyp Vortex Script
UPDATE There is an improved version of this script here
The first part of the script imports the smartcyp.jar, the script assumes the smartcyp.jar file is in /Users/username/vortex/modules/ if you decide to use a different location then you will need to edit the script accordingly. We then get the SMILES string for the structure in the selected row, display an alert showing the SMILES string and then run SMARTCyp with the required arguments saving the output file temp2.html to a temporary folder. Finally we create the chart and load the URL, I used slightly different syntax here because I suspect users may have multiple plots visible.
# 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 # sys.path.append('/Users/username/vortex/libs/smartcyp.jar') if Util.getPlatform() == Util.PlatformIsWindows: sys.path.append(vortex.getVortexFolder() + '\\modules\\smartcyp.jar') else: sys.path.append(vortex.getVortexFolder() + '/modules/smartcyp.jar') from smartcyp import SMARTCyp 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') vortex.alert('SMILES = '+smiles) # Command for SMARTCyp tmpdir = tempfile.mkdtemp() args = ['-outputdir', tmpdir, '-outputfile', 'temp2', '-nocsv', '-smiles', smiles] SMARTCyp.main(args) chart = vws.addChart(31) plot = vws.findPlot(chart) plot.loadURL('file://%s/temp2.html' % tmpdir) # Created by Macs in Chemistry (http://www.macinchem.org) # Copyright (c) 2011, Chris Swain # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The results are shown in the image below.
The movie below shows the script in action.
The script can be downloaded from here UseSMARTcyp.vpy.zip, this script needs to be put in the context folder that is in the Vortex add ins folder.
There are a number of other similar scripts in the Other Hints, Tips and Tutorials
Page Updated 25 June 2014