I was recently asked if I could generate IUPAC names for a series of molecules for a patent filing. There are many chemical drawing packages that will generate the IUPAC for a single compound and whilst I could have spent several hours cutting and pasting I decided to write a simple Vortex script to do the task.
The command line tool cxcalc from ChemAxon is the command line version of ChemAxon’s Calculator Plugins, and can be used to calculate a wide variety of properties including the IUPAC name.
The command has the following syntax:
cxcalc [general options] [input file(s)/string(s)] <plugin> [plugin option(s)] [input file(s)/string(s)]
And so to calculate the name the command would be (where sdfFile is the path to the sdf file containing the structures.
/Applications/MarvinSuite/bin/cxcalc', sdfFile, 'name'
As shown below
/Applications/MarvinSuite/bin/cxcalc /Users/username/Desktop/SampleFiles/emend3D.sdf name
id Preferred IUPAC Name
We can use subprocess to run the command and capture the output.
The Vortex Script
# Created by http://www.macinchem.org
# Generates IUPAC names using ChemAxon cxcalc
# Get the path to the currently open sdf file
sdfFile = vortex.getFileForPropertyCalculation(vtable)
# Run cxcalc on the file
p = subprocess.Popen(['/Applications/MarvinSuite/bin/cxcalc', sdfFile, 'name'], stdout=subprocess.PIPE)
output = p.communicate()
# Create new columns in table
lines = output.split('\n')
colName = lines.split('\t')
for c in colName:
column = vtable.findColumnWithName(c, 1, 3)
keys = 
for i in lines:
words = i.split('\t')
if len(words) == 2:
# Parse the output
rows = lines[1:len(lines)]
for r in range(0, vtable.getRealRowCount()):
vals = rows[r].split('\t')
for j in range(0, len(vals)):
column = vtable.findColumnWithName(colName[j], 0)
The result is shown below
To get the names to wrap with the cell you need to open the “Look and Feel” dialog by clicking on the icon at the top right corner of the table view..
Then edit the Text wrapping options.
Last updated 21 Oct 2021