Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IMoleculeSet


            HoseCodeGenerator.generateHoseCode(theFile.toString(), theResultDir.toString() + theFile.getName(), theLevelOfHoseCode);
        }
    }
   
    public static void generateHoseCode(String theInputFilePath, String theResultFilePath, int theLevelOfHoseCode) {
        IMoleculeSet theMoleculeSet = SDFReader.openMoleculeFile(new File(theInputFilePath));
        IMoleculeSet theResultMoleculeSet = new MoleculeSet();

        for (int mi = 0, mEnd = theMoleculeSet.getMoleculeCount(); mi < mEnd; mi++) {
            try {
                generateFunctionalGroup(theMoleculeSet.getMolecule(mi), theLevelOfHoseCode);
            } catch (CDKException e) {
                continue;
            }
            theResultMoleculeSet.addMolecule(theMoleculeSet.getMolecule(mi));
        }

        SDFWriter.writeSDFile(theResultMoleculeSet, new File(theResultFilePath));
    }
View Full Code Here


        final int FIRST_INDEX = 0;
        final String HOSE_CODE_DESCRIPTOR = "HOSE_CODE";
        final String TEMPLATE_FILE = "Template.sdf";
        final String MOLECULE_NAME_DESCRIPTOR = "cdk:Title";

        IMoleculeSet theMoleculeSet = new MoleculeSet();
        String theDescriptorValue = new String();

        Ring_Perception.setAromaticityBond(theMolecule);
        theMoleculeSet.addMolecule(theMolecule);

        for (int li = 1; li <= theLevelOfHoseCode; li++) {
            IMoleculeSet theTemplateMolecule = new MoleculeSet();
            StringBuilder theDescriptorName = new StringBuilder();

            try {
                runProgram(theMoleculeSet, li);
            } catch (Exception ex) {
                StringBuilder theErrorMessage = new StringBuilder();

                theErrorMessage.append(theMolecule.getProperty(MOLECULE_NAME_DESCRIPTOR).toString()).append(" ").append("Error!!");
                JOptionPane.showMessageDialog(null, theErrorMessage.toString(), "Error", JOptionPane.ERROR_MESSAGE);
            }

            theTemplateMolecule = SDFReader.openMoleculeFile(new File(TEMPLATE_FILE));
            theDescriptorName.append(HOSE_CODE_DESCRIPTOR).append("_").append(li);
            theDescriptorValue = theTemplateMolecule.getMolecule(FIRST_INDEX).getProperty(HOSE_CODE_DESCRIPTOR).toString();
            theMolecule.setProperty(theDescriptorName.toString(), theDescriptorValue);
        }
        File theFile = new File(TEMPLATE_FILE);
        theFile.delete();
    }
View Full Code Here

        }

        for (int ai = 0, aEnd = theCheckingFunctionalGroupList.size(); ai < aEnd; ai++) {
            String theOutlierFilePath = theResultDir + theCheckingFunctionalGroupList.get(ai) +"_F" + this.SD_FILE_SUFFIX;
            String theMatchedFilePath = theResultDir + theCheckingFunctionalGroupList.get(ai) +"_T" + this.SD_FILE_SUFFIX;
            IMoleculeSet theOutlierMoleculeSet = this.__getOutlierMoleculeSetInOneFunctionalGroup(theCheckingFunctionalGroupList.get(ai));
            IMoleculeSet theMatchedMoleculeSet = this.__getMatchedMoleculeSetInOneFunctionalGroup(theCheckingFunctionalGroupList.get(ai));

            if (!theOutlierMoleculeSet.isEmpty()) {
                List<Double> theMaximumAndMinimumShift = this.__getMaximumAndMinimumShift(theOutlierMoleculeSet);
               
                System.out.println(theCheckingFunctionalGroupList.get(ai) + " : " + theOutlierMoleculeSet.getMoleculeCount() + "\t[Min , Max] : [" +
                        theMaximumAndMinimumShift.get(this.MINIMUM_VALUE_INDEX) + " , " + theMaximumAndMinimumShift.get(this.MAXIMUM_VALUE_INDEX) + "] / Correlation Table : [" +
                        this.getReferenceCorrelationTable().get(theCheckingFunctionalGroupList.get(ai)).getMinOfRange() + " , " +
                        this.getReferenceCorrelationTable().get(theCheckingFunctionalGroupList.get(ai)).getMaxOfRange() + "]");
               
                SDFWriter.writeSDFile(theOutlierMoleculeSet, new File(theOutlierFilePath));
            }
           
            if(!theMatchedMoleculeSet.isEmpty()) {
                SDFWriter.writeSDFile(theMatchedMoleculeSet, new File(theMatchedFilePath));
            }
           
            this.__removeOutlierAndMatchedProperty();
        }
View Full Code Here

            }
        }
    }
   
    private IMoleculeSet __getMatchedMoleculeSetInOneFunctionalGroup(String theFunctionalGroup) {
        IMoleculeSet theMatchedMoleculeSet = new MoleculeSet();
       
        for (int mi = 0, mEnd = this.getMoleculeSet().getMoleculeCount(); mi < mEnd; mi++) {
            if (this.__isMatchedMolecule(mi, theFunctionalGroup)) {
                this.__setMatchedProperty(mi, theFunctionalGroup);
                theMatchedMoleculeSet.addMolecule(this.getMoleculeSet().getMolecule(mi));
            }
        }
       
        return theMatchedMoleculeSet;
    }
View Full Code Here

       
        return Double.parseDouble(theSplitedString[this.CHEMICAL_SHIFT_INDEX_IN_OUTLIER_PROPERTY].substring(this.STARTING_STRING_VALUE_OF_OUTLIER_PROPERTY_IN_ONE_GROUP.length()));
    }
   
    private IMoleculeSet __getOutlierMoleculeSetInOneFunctionalGroup(String theFunctionalGroup) {
        IMoleculeSet theOutlierMoleculeSet = new MoleculeSet();
       
        for (int mi = 0, mEnd = this.getMoleculeSet().getMoleculeCount(); mi < mEnd; mi++) {
            if (this.__isOutlierMolecule(mi, theFunctionalGroup)) {
                this.__setOutlierProperty(mi, theFunctionalGroup);
                theOutlierMoleculeSet.addMolecule(this.getMoleculeSet().getMolecule(mi));
            }
        }

        return theOutlierMoleculeSet;
    }
View Full Code Here

            theFrame.setLogTextArea().append(theMolecule.getProperty(MolecularPropertyCalculator.MOLECULAR_FORMULA_PROPERTY_NAME).toString());
        }
    }

    private static IMoleculeSet __readFolderWithTag(File theDir, String tagPropertyName, String theTag) {
        IMoleculeSet theResultMoleculeSet = new MoleculeSet();
        File[] theFileArray = theDir.listFiles();

        for (File theFile : theFileArray) {
            theResultMoleculeSet.add(SDFReader.openMoleculeFile(theFile));
        }

        for (int mi = 0, mEnd = theResultMoleculeSet.getMoleculeCount(); mi < mEnd; mi++) {
            theResultMoleculeSet.getMolecule(mi).setProperty(tagPropertyName, theTag);
        }

        return theResultMoleculeSet;
    }
View Full Code Here

        UrlParser theUrlParser = new UrlParser();
       
        new File(theOutputDir).mkdir();
        for (File theInputMoleculeFile : theInputFolder) {
            File theOutputMoleculeFile = new File(theOutputDir + theInputMoleculeFile.getName());
            IMoleculeSet inputMolSet = SDFReader.openMoleculeFile(theInputMoleculeFile);

            for (IAtomContainer eachMol : inputMolSet.molecules()) {
                List<String> cidList = theUrlParser.getCIDList("\"" + (String) eachMol.getProperty(inchiPropertyName) + "\"[INCHI]");
                for (String cid : cidList) {
                    StringBuilder propertyString = new StringBuilder();
                    for (String activityString : theUrlParser.getPubchemCSV(cid, new ArrayList<String>(Arrays.asList("active", activityName)))) {
                        if (!activityString.contains("Nohitsfor:")) {
View Full Code Here

TOP

Related Classes of org.openscience.cdk.interfaces.IMoleculeSet

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.