Package org.openscience.cdk.io.iterator

Examples of org.openscience.cdk.io.iterator.IteratingMDLReader


        return (Math.abs(theWeightInPeak - (Double) theSingleMolecule.getProperty(this.PROPERTY_NAME_OF_EXACT_MASS) - theAdductMass) < this.getTolerance());
    }

    private void __getMoleculeFromSDF(File theSdFile) {
        try {
            IteratingMDLReader reader = new IteratingMDLReader(
                    new FileInputStream(theSdFile),
                    DefaultChemObjectBuilder.getInstance());
            while (reader.hasNext()) {
                this.setMoleculeSet().addMolecule((IMolecule) reader.next());
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
View Full Code Here


       
        for (File[] theInputMoleculeFolder : theFileLists) {
            String theDBSourceText = theInputMoleculeFolder[0].getParent().split("\\\\")[3];
            for (File inputSDF : theInputMoleculeFolder) {
                try {
                    IteratingMDLReader reader = new IteratingMDLReader(new FileInputStream(inputSDF), DefaultChemObjectBuilder.getInstance());
                    while (reader.hasNext()) {
                        inputMolSet.addMolecule((IMolecule) reader.next());
                        //inputMolSet.getAtomContainer(inputMolSet.getMoleculeCount()).setProperty("DBSourceText", theDBSourceText);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
View Full Code Here

    }
    public static IMoleculeSet readFolderWithTag(File folder, String tagPropertyName, String tag){
        IMoleculeSet resultMol = new MoleculeSet();
        for (File inputSDF : folder.listFiles()) {
                try {
                    IteratingMDLReader reader = new IteratingMDLReader(new FileInputStream(inputSDF), DefaultChemObjectBuilder.getInstance());
                    while (reader.hasNext()) {
                        resultMol.addMolecule((IMolecule) reader.next());
                        //inputMolSet.getAtomContainer(inputMolSet.getMoleculeCount()).setProperty("DBSourceText", theDBSourceText);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
View Full Code Here

   
    public static IMoleculeSet openMoleculeFile(File theSdFile) {
        IMoleculeSet theMoleculeSet = new MoleculeSet();
       
        try {
            IteratingMDLReader reader = new IteratingMDLReader(
                    new FileInputStream(theSdFile),
                    DefaultChemObjectBuilder.getInstance());
            while (reader.hasNext()) {
                theMoleculeSet.addMolecule((IMolecule) reader.next());
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
       
View Full Code Here

    }

    public static java.util.ArrayList<IMolecule> getMoleculeList(String theFileName) {
        java.util.ArrayList<IMolecule> theMoleculeList = new java.util.ArrayList<IMolecule>();
        try {
            IteratingMDLReader theReader = new IteratingMDLReader(
                    new FileReader(theFileName),
                    DefaultChemObjectBuilder.getInstance());
            while (theReader.hasNext()) {
                theMoleculeList.add((IMolecule) theReader.next());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return theMoleculeList;
View Full Code Here

TOP

Related Classes of org.openscience.cdk.io.iterator.IteratingMDLReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.