Skip to content

Instantly share code, notes, and snippets.

@miquelrojascherto
Created July 21, 2009 08:37
Show Gist options
  • Save miquelrojascherto/151205 to your computer and use it in GitHub Desktop.
Save miquelrojascherto/151205 to your computer and use it in GitHub Desktop.
//Demonstrates basic manipulation to predict a EI-MS in Bioclipse using
//a sdf file containing a list of molecule.
//Requires medea data installed in default location
var mols = cdk.loadMolecules("/Sample Data/SDFfiles/CAS.5.sdf");
for (var i = 0; i < mols.size(); i++) {
var mol = mols.get(i);
mol = cdk.generate2dCoordinates(mol);
ui.open(mol);
cmlSpectrum = medea.predictMassSpectrum(mol)
spectrum.saveSpectrum(cmlSpectrum,"Virtual/predictedSpectrum_"+i+".cml","cml")
// ui.open("/Virtual/predictedSpectrum_"++".cml");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment