Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IMoleculeSet


        return theMoleculeSet;
    }

    private IMoleculeSet __getChemicalShiftAndMpeoeAndCdeapBySDFormat(Nmr1dUnitList thePeakList, int theMoleculeIndex, String theFunctionalGroup) {
        IMoleculeSet theMoleculeSet = new MoleculeSet();
        List<String> theFunctionalGroupList = this.__getFunctionalGroupList(this.getMoleculeSet().getMolecule(theMoleculeIndex));

        for (Nmr1dUnit thePeak : thePeakList.getPeakList()) {
            if (thePeak.getAnnotatedAtomNumber() != this.INCORRECT_ATOM_NUMBER) {
                int theFunctionalGroupIndex = this.__getFunctionalGroupIndex(thePeak.getAnnotatedAtomNumber(), theMoleculeIndex);

                if (theFunctionalGroupList.contains(theFunctionalGroup)) {
                    theMoleculeSet.addMolecule(this.__getChemicalShiftAndMpeoeAndCdeapBySDFormat(thePeak, theMoleculeIndex));
                }
            }
        }

        return theMoleculeSet;
View Full Code Here


        return theStringBuilder.toString();
    }

    public IMoleculeSet findMatchedMoleculeForChemicalShiftAndMpeoeAndCdeap(double theChemicalShift, double theMpeoe, double theCdeap) {
        IMoleculeSet theMoleculeSet = new MoleculeSet();

        for (int mi = 0, mEnd = this.getMoleculeSet().getMoleculeCount(); mi < mEnd; mi++) {
            if (this.__isMatchedMoleculeForChemicalShiftAndMpeoeAndCdeap(mi, theChemicalShift, theMpeoe, theCdeap)) {
                theMoleculeSet.addMolecule(this.getMoleculeSet().getMolecule(mi));
            }
        }

        return theMoleculeSet;
    }
View Full Code Here

        }
    }

    private void __writeHoseCodeDescriptorBySolventForSDFormat(String theResultDir, String theFunctionalGroup, String theSolvent, int theHoseCodeLevel) throws IOException {
        StringBuilder theResultFilePath = new StringBuilder();
        IMoleculeSet theMoleculeSet = this.__getHoseCodeDescriptorBySolventForSDForamt(theFunctionalGroup, theSolvent, theHoseCodeLevel);

        theResultFilePath.append(theResultDir);

        if (!theResultDir.substring(theResultDir.length() - 1).equals("\\")) {
            theResultFilePath.append(this.BACK_SLASH_STRING);
View Full Code Here

        theResultFilePath.append(theFunctionalGroup).append(this.UNDER_BAR).append(theSolvent).append(this.MOLECULE_SUFFIX);
        SDFWriter.writeSDFile(theMoleculeSet, new File(theResultFilePath.toString()));
    }

    private IMoleculeSet __getHoseCodeDescriptorBySolventForSDForamt(String theFunctionalGroup, String theSolvent, int theHoseCodeLevel) {
        IMoleculeSet theMoleculeSet = new MoleculeSet();

        for (int mi = 0, mEnd = this.getHydrogenPeakListByMolecules().size(); mi < mEnd; mi++) {
            if (this.__calculateMolecularWeight(this.getMoleculeSet().getMolecule(mi)) > 200) {
                for (Nmr1dUnitList thePeakList : this.getHydrogenPeakListByMolecules().get(mi)) {
                    theMoleculeSet.add(this.__getHoseCodeDescriptorBySolventForSDForamt(thePeakList, theHoseCodeLevel, theFunctionalGroup, mi, theSolvent));
                }
            }
        }

        return theMoleculeSet;
View Full Code Here

        return theMoleculeSet;
    }

    private IMoleculeSet __getHoseCodeDescriptorBySolventForSDForamt(Nmr1dUnitList thePeakList, int theHoseCodeLevel, String theFunctionalGroup, int theMoleculeIndex, String theSolvent) {
        IMoleculeSet theMoleculeSet = new MoleculeSet();
        List<String> theFunctionalGroupList = this.__getFunctionalGroupList(this.getMoleculeSet().getMolecule(theMoleculeIndex));
        NMRShiftDBSolventList theSolventList = new NMRShiftDBSolventList();
        List<Integer> theUsedAtomNumberList = new ArrayList<Integer>();

        for (Nmr1dUnit thePeak : thePeakList.getPeakList()) {
            if (!theSolvent.equals(theSolventList.modifyStandardSolventName(thePeak.getSolvent()))) {
                return new MoleculeSet();
            } else if (thePeak.getAnnotatedAtomNumber() != this.INCORRECT_ATOM_NUMBER && !theUsedAtomNumberList.contains(thePeak.getAnnotatedAtomNumber())) {
                int theFunctionalGroupIndex = this.__getFunctionalGroupIndex(thePeak.getAnnotatedAtomNumber(), theMoleculeIndex);

                if (theFunctionalGroupList.get(theFunctionalGroupIndex).equals(theFunctionalGroup)) {
                    theMoleculeSet.addMolecule(this.__getHoseCodeDescriptorBySDFormat(thePeak, theHoseCodeLevel, theMoleculeIndex));
                    theUsedAtomNumberList.add(thePeak.getAnnotatedAtomNumber());
                }
            }
        }
View Full Code Here

        theFileWriter.close();
    }

    public void writeMoleculeFileHavingNumberUnderTolerence(int theTolerence, File theResultFile) {
        Nmr1dUnitList theChemicalShiftRangeList = this.__getChemicalShiftRangeList(theTolerence);
        IMoleculeSet theMoleculeSet = this.__getMoleculeSetHavingNumberUnderTolerenceInPeakDistribution(theChemicalShiftRangeList);

        SDFWriter.writeSDFile(theMoleculeSet, theResultFile);
    }
View Full Code Here

        return theChemicalShiftRange;
    }

    private IMoleculeSet __getMoleculeSetHavingNumberUnderTolerenceInPeakDistribution(Nmr1dUnitList theChemicalShiftRangeList) {
        IMoleculeSet theMoleculeSet = new MoleculeSet();

        for (int hi = 0, hEnd = this.getHydrogenChemicalShiftDataInMoleculeSet().size(); hi < hEnd; hi++) {
            if (this.__isMoleculeInRange(theChemicalShiftRangeList, hi)) {
                this.getMoleculeSet().getMolecule(hi).setProperty(this.KEY_VALUE_OF_MOLECULE_IN_TOLERENCE, this.__getPropertyValueInMatchedShift(theChemicalShiftRangeList, hi));
                theMoleculeSet.addMolecule(this.getMoleculeSet().getMolecule(hi));
            }
        }

        return theMoleculeSet;
    }
View Full Code Here

        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

        theFrame.setInputArea().add(Box.createVerticalStrut(theInputBoxVerticalMargin));
        theFrame.setInputArea().add(theFrame.generateInputBox(new JLabel("Result File : "), new JTextField(20), new JButton("select")));
    }

    public void splitedMoleculeFile(String theMoleculeFilePath, String theResultDir) {
        IMoleculeSet theMoleculeSet = SDFReader.openMoleculeFile(new File(theMoleculeFilePath));
       
        this.setMainFrame().setLogTextArea().append("Split Molecule File Start!!\n");
        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

            theFileWriter.flush();
            theFileWriter.write(theResultString);
            theFileWriter.close();

            IMoleculeSet theMoleculeSet = SDFReader.openMoleculeFile(new File(theResultFilePath.toString()));
            SDFWriter.writeSDFile(theMoleculeSet, new File(theResultFilePath.toString()));
        }

        theFileReader.close();
    }
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.