## Monday, January 31, 2011

### Extracting 3D coordinates from PDB files with Groovy CDK

BioStar featured a question today about how to extract 3D coordinates from PDB files. Now, a simple script may actually do, and BioJava was mentioned too. Of course, it can also be done with the CDK. For example using this Groovy code:

import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.io.*;
import org.openscience.cdk.tools.manipulator.*;
import org.openscience.cdk.*;
import java.io.File;
import java.util.zip.GZIPInputStream;

new GZIPInputStream(
new URL(
"http://www.pdb.org/pdb/files/1CRN.pdb.gz"
).openStream()
)
);