import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.io.*;
import org.openscience.cdk.tools.manipulator.*;
import org.openscience.cdk.io.IChemObjectReader.Mode;
import org.openscience.cdk.*;
import java.io.File;
import java.util.zip.GZIPInputStream;
reader = new PDBReader(
new GZIPInputStream(
new URL(
"http://www.pdb.org/pdb/files/1CRN.pdb.gz"
).openStream()
)
);
crambin = reader.read(new ChemFile());
for (container in
ChemFileManipulator.getAllAtomContainers(
crambin
)) {
for (atom in container.atoms()) {
println atom.point3d;
}
}
Wondering what the Bioclipse Scripting Language version would look like... and, it can likely be done with Jmol script too.
My first conference paper: http://www.ks.uiuc.edu/Publications/Papers/PDF/DALK97/DALK97.pdf "Using TCL for Molecular Visualization and Analysis."
ReplyDeleteIn VMD the code would be something like:
mol new 1CRN
set coords [[atomselect top all] get {x y z}]
Yeah, that's what you get when you write a few targeted commands. Nice! This is, BTW, what the Bioclipse Scripting Language is about too, defining a new scripting language with such shortcuts, while the CDK is just a library with no intention to do things with shortcuts, but create flexibility and traceability. (I would love to be able to quantify something like that :)
ReplyDelete