Skip to content

Instantly share code, notes, and snippets.

//Demonstrates how to convert a CDKReactionScheme to ISpectrum
reactionScheme = reaction.loadReactionScheme("Sample Data/Reactions/reactionList.1.cml");
cmlSpectrum = medea.convertToSpectrum(reactionScheme)
spectrum.saveSpectrum(cmlSpectrum,"Virtual/spectrum.cml","cml")
ui.open("/Virtual/spectrum.cml");
//Demonstrates how to convert a CDKReactionScheme to ISpectrum
reactionScheme = reaction.loadReactionScheme("Sample Data/Reactions/reactionList.1.cml");
cmlSpectrum = medea.convertToSpectrum(reactionScheme)
spectrum.saveSpectrum(cmlSpectrum,"Virtual/spectrum.cml","cml")
ui.open("/Virtual/spectrum.cml");
//Demonstrates basic manipulation to predict a EI-MS in Bioclipse
//Requires medea data installed in default location
mol = cdk.loadMolecule("/Sample Data/Molecules/30460-92-5-2d.mol");
mol = cdk.generate2dCoordinates(mol);
ui.open(mol);
cmlSpectrum = medea.predictMassSpectrum(mol)
spectrum.saveSpectrum(cmlSpectrum,"Virtual/predictedSpectrum.cml","cml")
ui.open("/Virtual/predictedSpectrum.cml");
//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)