Package org.bmdrc.nmr

Examples of org.bmdrc.nmr.Nmr1dUnitList


        theFileWriter.write(theResultFileString.toString());
        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


        SDFWriter.writeSDFile(theMoleculeSet, theResultFile);
    }

    private Nmr1dUnitList __getChemicalShiftRangeList(int theTolerence) {
        Nmr1dUnitList theChemicalShiftRangeList = new Nmr1dUnitList();

        for (int di = 0, dEnd = this.getPeakDistributionList().size(); di < dEnd; di++) {
            if (this.getPeakDistributionList().get(di) <= theTolerence && this.getPeakDistributionList().get(di) != 0) {
                Nmr1dUnit theChemicalShiftRange = this.__setChemicalShiftRange(di);

                theChemicalShiftRangeList.addPeak(theChemicalShiftRange);
            }
        }

        return theChemicalShiftRangeList;
    }
View Full Code Here

    }

    private List<Double> __getChemicalShiftListInRange(Nmr1dUnit theRange, int theIndexOfShiftData) {
        List<Double> theChemicalShiftListInRange = new ArrayList<>();
       
        Nmr1dUnitList thePeakListInMolecule = this.getHydrogenChemicalShiftDataInMoleculeSet().get(theIndexOfShiftData);

        for (Nmr1dUnit thePeak : thePeakListInMolecule.getPeakList()) {
            if (this.__isMatchedFunctionalGroup(thePeak, theIndexOfShiftData) && this.__isMatchedInRange(thePeak, theRange)) {
                theChemicalShiftListInRange.add(thePeak.getChemicalShift());
            }
        }
View Full Code Here

        return false;
    }

    private boolean __isMoleculeInRange(Nmr1dUnit theRange, int theIndexOfShiftData) {
        Nmr1dUnitList thePeakListInMolecule = this.getHydrogenChemicalShiftDataInMoleculeSet().get(theIndexOfShiftData);

        for (Nmr1dUnit thePeak : thePeakListInMolecule.getPeakList()) {
            if (this.__isMatchedFunctionalGroup(thePeak, theIndexOfShiftData) && this.__isMatchedInRange(thePeak, theRange)) {
                return true;
            }
        }
View Full Code Here

            this.setHydrogenChemicalShiftDataInMoleculeSet().add(this.__inputHydrogenChemicalShiftDataInMolecule(this.getMoleculeSet().getMolecule(mi)));
        }
    }

    private Nmr1dUnitList __inputHydrogenChemicalShiftDataInMolecule(IMolecule theMolecule) {
        Nmr1dUnitList theSpectrumPeakList = new Nmr1dUnitList();

        for (int pi = 0; pi < this.MAXIMUM_SPECTRUM_NUMBER; pi++) {
            String theKeyValue = this.KEY_VALUE_OF_1H_SPECTRUM + pi;

            if (theMolecule.getProperties().keySet().contains(theKeyValue) && !this.__isPredictedPeak(theMolecule, pi)) {
                theSpectrumPeakList.addAllPeaks(this.__inputHydrogenChemicalShiftDataInOneSpectrum(theMolecule, theKeyValue, pi));
            }
        }

        return theSpectrumPeakList;
    }
View Full Code Here

    private Nmr1dUnitList __inputHydrogenChemicalShiftDataInOneSpectrum(IMolecule theMolecule, String theKey, int theSpectrumNumber) {
        String theSpectrumData = theMolecule.getProperty(theKey).toString();
        String[] thePeakInformationArrayInFile = theSpectrumData.split(this.REGEX_DIVIDED_PEAK_INFORMATION);
        List<String> theSolventList = this.__getSolventList(theMolecule);
        List<Integer> theSolventIndexList = this.__getSolventIndexList(theMolecule);
        Nmr1dUnitList thePeakList = new Nmr1dUnitList();

        for (String theSpectrumPeak : thePeakInformationArrayInFile) {
            String[] theSplitedInformation = theSpectrumPeak.split(";");
            Nmr1dUnit thePeak = new Nmr1dUnit();

            thePeak.setAnnotatedAtomNumber(Integer.parseInt(theSplitedInformation[this.INDEX_OF_ATOM_NUMBER_IN_NMRSHIFTDB]));
            thePeak.setChemicalShift(Double.parseDouble(theSplitedInformation[this.INDEX_OF_CHEMICAL_SHIFT_IN_NMRSHIFTDB]));
            try {
                thePeak.setSolvent(theSolventList.get(theSolventIndexList.indexOf(theSpectrumNumber)));
            } catch (ArrayIndexOutOfBoundsException e) {
                e.printStackTrace();
                System.err.println(theKey + " " + theSpectrumNumber + " " + theMolecule.getProperty(this.KEY_VALUE_OF_NMRSHIFTDB2_ID).toString());
            }
            thePeakList.addPeak(thePeak);
        }

        return thePeakList;
    }
View Full Code Here

        return theOutlierMoleculeSet;
    }

    private boolean __isOutlierMolecule(int theMoleculeIndex, String theFunctionalGroup) {
        Nmr1dUnitList theCheckPeakList = this.__getPeakListInMoleculeContainFunctionalGroup(theMoleculeIndex, theFunctionalGroup);
        Nmr1dUnit theShiftRangeInReferenceCorrelationTable = this.getReferenceCorrelationTable().get(theFunctionalGroup);

        for (int li = 0, lEnd = theCheckPeakList.getPeakList().size(); li < lEnd; li++) {
            if (!this.__isShiftInRange(theCheckPeakList.getPeak(li), theFunctionalGroup)) {
                return true;
            }
        }

        return false;
View Full Code Here

        return false;
    }

    private boolean __isMatchedMolecule(int theMoleculeIndex, String theFunctionalGroup) {
        Nmr1dUnitList theCheckPeakList = this.__getPeakListInMoleculeContainFunctionalGroup(theMoleculeIndex, theFunctionalGroup);
        Nmr1dUnit theShiftRangeInReferenceCorrelationTable = this.getReferenceCorrelationTable().get(theFunctionalGroup);

        for (int li = 0, lEnd = theCheckPeakList.getPeakList().size(); li < lEnd; li++) {
            if (this.__isShiftInRange(theCheckPeakList.getPeak(li), theFunctionalGroup)) {
                return true;
            }
        }

        return false;
View Full Code Here

        return false;
    }
   
    private void __setMatchedProperty(int theMoleculeIndex, String theFunctionalGroup) {
        Nmr1dUnitList theCheckPeakList = this.__getPeakListInMoleculeContainFunctionalGroup(theMoleculeIndex, theFunctionalGroup);
        StringBuilder thePropertyValue = new StringBuilder();

        thePropertyValue.append(this.STARTING_STRING_VALUE_OF_MATCHED_PROPERTY);

        for (int li = 0, lEnd = theCheckPeakList.getPeakList().size(); li < lEnd; li++) {
            if (this.__isShiftInRange(theCheckPeakList.getPeak(li), theFunctionalGroup)) {
                thePropertyValue.append(this.STARTING_STRING_VALUE_OF_MATCHED_PROPERTY_IN_ONE_GROUP).append(theCheckPeakList.getPeak(li).getChemicalShift())
                        .append(this.COMMA_STRING).append(theCheckPeakList.getPeak(li).getAnnotatedAtomNumber()).append(this.END_STRING_OF_MATCHED_PROPERTY_IN_ONE_GROUP);
            }
        }

        this.getMoleculeSet().getMolecule(theMoleculeIndex).setProperty(this.KEY_VALUE_OF_MATCHED_MOLECULE, thePropertyValue);
    }
View Full Code Here

        this.getMoleculeSet().getMolecule(theMoleculeIndex).setProperty(this.KEY_VALUE_OF_MATCHED_MOLECULE, thePropertyValue);
    }
   
    private void __setOutlierProperty(int theMoleculeIndex, String theFunctionalGroup) {
        Nmr1dUnitList theCheckPeakList = this.__getPeakListInMoleculeContainFunctionalGroup(theMoleculeIndex, theFunctionalGroup);
        StringBuilder thePropertyValue = new StringBuilder();

        thePropertyValue.append(this.STARTING_STRING_VALUE_OF_OUTLIER_PROPERTY);

        for (int li = 0, lEnd = theCheckPeakList.getPeakList().size(); li < lEnd; li++) {
            if (!this.__isShiftInRange(theCheckPeakList.getPeak(li), theFunctionalGroup)) {
                thePropertyValue.append(this.STARTING_STRING_VALUE_OF_OUTLIER_PROPERTY_IN_ONE_GROUP).append(theCheckPeakList.getPeak(li).getChemicalShift())
                        .append(this.COMMA_STRING).append(theCheckPeakList.getPeak(li).getAnnotatedAtomNumber()).append(this.END_STRING_OF_OUTLIER_PROPERTY_IN_ONE_GROUP);
            }
        }

        this.getMoleculeSet().getMolecule(theMoleculeIndex).setProperty(this.KEY_VALUE_OF_OUTLIER_MOLECULE, thePropertyValue);
    }
View Full Code Here

TOP

Related Classes of org.bmdrc.nmr.Nmr1dUnitList

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.