Package org.openscience.cdk

Examples of org.openscience.cdk.MoleculeSet


        return itsMainFrame;
    }

    public void mergeMoleculeFile(String theInputDir, String theResultFilePath) {
        List<File> theFileList = Module.getFileList(theInputDir);
        IMoleculeSet theResultMoleculeSet = new MoleculeSet();
        int theNumberOfFile = theFileList.size();

        this.setMainFrame().setLogTextArea().append("Merge Molecule File Start!!\n");
        for (File theFile : theFileList) {
            try {
                IMoleculeSet theMoleculeSet = SDFReader.openMoleculeFile(theFile);

                theResultMoleculeSet.addMolecule(theMoleculeSet.getMolecule(0));
            } catch (NullPointerException e) {
                this.setMainFrame().setLogTextArea().append(theFile.toString() + " ---> Error!!\n");
                theNumberOfFile--;
            }
        }
View Full Code Here


        if (!theResultDir.substring(theResultDir.length() - 1, theResultDir.length() - 1).equals("\\")) {
            theResultDir = theResultDir + "\\";
        }

        for (int mi = 0, mEnd = theMoleculeSet.getMoleculeCount(); mi < mEnd; mi++) {
            IMoleculeSet theResultMoleculeSet = new MoleculeSet();

            theResultMoleculeSet.addMolecule(theMoleculeSet.getMolecule(mi));
            SDFWriter.writeSDFile(theResultMoleculeSet, new File(theResultDir + String.format("%04d", mi) + ".sdf"));
        }
        this.setMainFrame().setLogTextArea().append("Split Molecule End!!\n");
        this.setMainFrame().setLogTextArea().append("Total Number of File : " + theMoleculeSet.getMoleculeCount() + "\n");
    }
View Full Code Here

    private final int NUMBER_OF_BOUNDED_ATOM_IN_ZERO_CELL = 3;
    private final int FIRST_POSITION = 0;
    private final int SECOND_POSITION = 1;
   
    public FunctionalGroupGenerator() {
        this.setMoleculeSet(new MoleculeSet());
        this.__generateUsualAtomicNumberList();
    }
View Full Code Here

    private final int CDEAP_INDEX = 3;
    //constant double variable
    private final double NOT_CONTAIN_PROPERTY_VALUE = Double.NaN;

    public MpeoeAndCdeapCalculator() {
        this.setMoleculeSet(new MoleculeSet());
        this.setMpeoe2dList(new TwoDimensionList<Double>());
        this.setCdeap2dList(new TwoDimensionList<Double>());
        this.__makeNewDir(this.TOTAL_TEMP_DIR);
    }
View Full Code Here

        }
    }
   
    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

    private final String SPACE_STRING = "\\s";
    private final String COMMA_STRING = ",";

    public CorrelationTableManipulator() {
        this.setChemicalShiftDataByFunctionalGroup(new HashMap<String, Nmr1dUnit>());
        this.setMoleculeSet(new MoleculeSet());
        this.setHydrogenChemicalShiftDataInMoleculeSet(new ArrayList<Nmr1dUnitList>());
        this.setFunctionalGroupListInMoleculeSet(new ArrayList<FunctionalGroupList>());
        this.__generateReferenceCorrlationTable();
    }
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

    private final int NUMBER_OF_BOUNDED_HYDROGEN_IN_QUTERNARY_CARBON = 0;
    private final int SIZE_OF_CARBON_QUERY_SIZE = 4;

    public DBSearcher(File theDBMoleculeFile, int theMaximumCouplingDistanceDistanceInQuternary, int theMaximumCouplingDistanceDistanceInOther) {
        this.setDBMoleculeSet(SDFReader.openMoleculeFile(theDBMoleculeFile));
        this.setResultMoleculeSet(new MoleculeSet());
        this.setCarbonQueryList(new ArrayList<CarbonQuery>());
        this.setHydrogenQueryList(new ArrayList<HydrogenQuery>());
        this.setMaximumCouplingDistanceDistanceInQuternary(theMaximumCouplingDistanceDistanceInQuternary);
        this.setMaximumCouplingDistanceDistanceInOther(theMaximumCouplingDistanceDistanceInOther);
    }
View Full Code Here

TOP

Related Classes of org.openscience.cdk.MoleculeSet

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.