Skip to content

Instantly share code, notes, and snippets.

@egonw
Created October 30, 2009 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egonw/222305 to your computer and use it in GitHub Desktop.
Save egonw/222305 to your computer and use it in GitHub Desktop.
var smileses = new Array("CC(C)C", "CCCN", "CCC=O");
var unaligned = cdk.createMoleculeList();
for (i=0; i<smileses.length; i++) {
mol = cdk.fromSMILES(smileses[i]);
mol = cdk.generate3dCoordinates(mol)
unaligned.add(mol);
}
var aligned = cdk.kabsch(unaligned)
for (i=0; i<aligned.size(); i++) {
jmol.load(unaligned.get(i));
jmol.append(aligned.get(i));
}
jmol.load(aligned.get(0));
for (i=1; i<aligned.size(); i++) {
jmol.append(aligned.get(i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment