Created
July 21, 2010 21:18
-
-
Save rajarshi/485155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gov.nih.ncgc; | |
import org.openscience.cdk.ChemFile; | |
import org.openscience.cdk.exception.CDKException; | |
import org.openscience.cdk.interfaces.IAtomContainer; | |
import org.openscience.cdk.interfaces.IChemFile; | |
import org.openscience.cdk.io.MDLV2000Reader; | |
import org.openscience.cdk.io.Mol2Reader; | |
import org.openscience.cdk.tools.manipulator.ChemFileManipulator; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.util.List; | |
/** | |
* A one line summary. | |
* | |
* @author Rajarshi Guha | |
*/ | |
public class Moltest { | |
public static void main(String[] args) throws FileNotFoundException, CDKException { | |
MDLV2000Reader reader1 = new MDLV2000Reader(new FileReader("/Users/guhar/work/fpcomp/aid692/actives.sdf")); | |
IChemFile chemFile = reader1.read(new ChemFile()); | |
List<IAtomContainer> mols1 = ChemFileManipulator.getAllAtomContainers(chemFile); | |
System.out.println("mols1.size() = " + mols1.size()); | |
Mol2Reader reader2 = new Mol2Reader(new FileReader("/Users/guhar/work/fpcomp/aid692/actives.sdf")); | |
chemFile = (IChemFile) reader2.read(new ChemFile()); | |
List<IAtomContainer> mols2 = ChemFileManipulator.getAllAtomContainers(chemFile); | |
System.out.println("mols2.size() = " + mols2.size()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment