ChemSpotlight v1.2.1

ChemSpotlight is a Spotlight metadata importer plugin for Mac OS X 10.4 Tiger, which reads common chemical file formats (ChemDraw .cdx, .cdxml, MDL .mol, .mdl, .sd, .sdf, Tripos .mol2, Protein Data Bank .pdb, Chemical Markup Language .cml, and XYZ) using the Open Babel chemistry library. It is provided as a Universal Binary for PowerPC and Intel, for optimized performance on both.

It’s probably easier to show the results from ChemSpotlight than to describe it. ChemSpotlight indexes chemistry files, adds molecular formulas (complete with subscripts in the Finder), molecular weight, and a variety of other information for Spotlight searches and “Get Info” windows. Notice the computed chemical formula and molecular weight information for this file:
ChemSpotlight Get Info

ChemSpotlight adds all of this information to the Spotlight index, allowing chemical searches for a range of properties. Since Spotlight indexes automatically in the background as files are created or modified, after installing, you don’t need to worry about updating the database.

Version History

Still to Come

Known Bugs and Limitations

Suggestions? Bugs? Coding contributions? E-mail me at <geoff.hutchison at gmail.com> and please try to include “ChemSpotlight” in the subject of your message. If you have a file which does not appear to index, please try to send me a copy.

For discussing ChemSpotlight and announcements of new versions, please subscribe to the mailing list: chemspotlight@lists.openmolecules.net.

Technical Details

ChemSpotlight reads in files using the Open Babel library and then generates the following fields for any molecules it finds:

Metadata FieldNotes
net_sourceforge_openbabel_ChiralityTrue/False (1/0)
net_sourceforge_openbabel_Dimension0D/2D/3D depending on the coordinates found
net_sourceforge_openbabel_DisplayFormulaFormula with subscripts for Finder “Get Info” windows
net_sourceforge_openbabel_FormulaChemical formula in standard “Hill Order
net_sourceforge_openbabel_MassStandard molecular weight in a.m.u. (g/mol)
net_sourceforge_openbabel_ExactMassMolecular mass of most common isotopes for mass spectra
net_sourceforge_openbabel_NumAtomsNumber of atoms in the molecule
net_sourceforge_openbabel_NumBondsNumber of bonds in the molecule
net_sourceforge_openbabel_NumMolsNumber of molecules in the file
net_sourceforge_openbabel_NumResiduesNumber of biomolecule residues
net_sourceforge_openbabel_SMILESDaylight SMILES string for this molecule
net_sourceforge_openbabel_InChIIUPAC/NIST canonical identifier
net_sourceforge_openbabel_SequenceBiomolecule residue sequence

All of these are available for searching from Spotlight, including command-line searches. For example, you can search for C6H6 in a regular search and return molecules with C6H6 as part of the formula. Or try the following command-line searches:

# Return all files with at least one molecule with mass < 200
mdfind "net_sourceforge_openbabel_Mass < 200"
# The next line matches all files containing molecules with mass < 200 AND molecules with > 10 atoms
mdfind "net_sourceforge_openbabel_Mass < 200 && net_sourceforge_openbabel_NumAtoms > 10"
# Match the c1(c(cccc1)Br SMILES string (i.e., a literal string)
mdfind "net_sourceforge_openbabel_SMILES = '*c1(c(cccc1)Br*'"

Note that the SMILES matching is for literal strings of SMILES. I don’t (yet) know how to use the Daylight SMARTS matching system inside Spotlight, although perhaps other tools can filter the results from Spotlight using the SMARTS system.

Source Code

ChemSpotlight is provided under the GNU General Public License (GPL) and is free software. The source code (in XCode) is available.

Thanks

Thanks to Henry Rzepa and Chris Swain for the original idea and pushing to get this started. Thanks to Simon Saubern, Fredrik Wallner, and Bill Day for debugging help and suggestions.

We must be the change we wish to see in the world.

— Mahatma Ghandi