Package org.bmdrc.nmr

Examples of org.bmdrc.nmr.Nmr2dCHUnit


    private void __setStartPeak(Nmr2dCHUnitList theMedianPeakInMergeHMQCAndHMBC) {
        Nmr2dCHUnitList theStartPeakSetInHMQC = new Nmr2dCHUnitList();

        for (Object thePeak : this.getHMQCPeakList()) {
            Nmr2dCHUnit theClosestPeak = this.__getClosestPeak(theMedianPeakInMergeHMQCAndHMBC, (Nmr2dCHUnit) thePeak);

            this.__setStartPeakListInHMBC().addPeak(theClosestPeak);
            this.__setStartPeakListInHMQC().addPeak((Nmr2dCHUnit) thePeak);
        }
    }
View Full Code Here


        return thePeakData;
    }

    private Nmr2dCHUnit __getPeakDataInSparkFormat(String theFileString) {
        String[] theSplitedString = theFileString.split(this.SPACE_STRING);
        Nmr2dCHUnit thePeak = new Nmr2dCHUnit();

        thePeak.setCarbonShift(Double.parseDouble(theSplitedString[this.CARBON_CHEMICAL_SHIFT_2D_INDEX_IN_SPARKY]));
        thePeak.setHydrogenShift(Double.parseDouble(theSplitedString[this.HYDROGEN_CHEMICAL_SHIFT_2D_INDEX_IN_SPARKY]));
        thePeak.setIntensity(Double.parseDouble(theSplitedString[this.INTENSITY_2D_INDEX_IN_SPARKY]));

        return thePeak;
    }
View Full Code Here

        return thePeak;
    }

    private Nmr2dCHUnit __readACDLabFileFormat(String theFileString) throws NumberFormatException {
        String[] theSplitedString = theFileString.split(this.TAB_STRING);
        Nmr2dCHUnit thePeak = new Nmr2dCHUnit();

        if (!theFileString.isEmpty() && theSplitedString.length >= 8) {
            thePeak.setCarbonShift(Double.parseDouble(theSplitedString[this.CARBON_CHEMICAL_SHIFT_2D_INDEX_IN_ACD]));
            thePeak.setHydrogenShift(Double.parseDouble(theSplitedString[this.HYDROGEN_CHEMICAL_SHIFT_2D_INDEX_IN_ACD]));
            thePeak.setIntensity(Double.parseDouble(theSplitedString[this.INTENSITY_2D_INDEX_IN_ACD]));
        }

        return thePeak;
    }
View Full Code Here

        return theMedianPeakData;
    }

    private Nmr2dCHUnitList __getClusterPeakList(Nmr1dUnit the1HPeak, Nmr1dUnit the13CPeak, Nmr2dCHUnitList theCopiedPeakData) {
        Nmr2dCHUnit theClassStandardPeak = this.__getClassStandardPeak(the1HPeak, the13CPeak);
        Nmr2dCHUnit theStartPeak = this.__getClosestPeak(theCopiedPeakData, theClassStandardPeak);
        Nmr2dCHUnitList thePeakList = new Nmr2dCHUnitList();

        if (this.__containRange(theStartPeak, theClassStandardPeak) && this.__containHydrogenRange(theStartPeak, (Nmr1dUnit) the1HPeak)) {
            int theIndexOfStartPeak = this.__getIndexOfSamePeakIn2D(theCopiedPeakData, theStartPeak);
View Full Code Here

            }
        }
    }

    private Nmr2dCHUnit __getClassStandardPeak(Nmr1dUnit the1HPeak, Nmr1dUnit the13CPeak) {
        Nmr2dCHUnit theClassStandardPeak = new Nmr2dCHUnit();

        theClassStandardPeak.setCarbonShift(the13CPeak.getChemicalShift());
        theClassStandardPeak.setHydrogenShift(the1HPeak.getChemicalShift());

        return theClassStandardPeak;
    }
View Full Code Here

        return false;
    }

    private Nmr2dCHUnit __getClosestPeak(Nmr2dCHUnitList thePeakData, Nmr2dCHUnit theCheckPeak) {
        Nmr2dCHUnit theClosestPeak = new Nmr2dCHUnit();
        double theMinimumDistance = Math.sqrt(2.0);

        for (Object thePeak : thePeakData) {
            if (!this.__isSamePeak((Nmr2dCHUnit) thePeak, theCheckPeak)) {
                double theDistance = this.__calculateDistance((Nmr2dCHUnit) thePeak, theCheckPeak);
View Full Code Here

        return true;
    }

    private Nmr2dCHUnit __getMedianPosition(Nmr2dCHUnitList thePeakList) {
        Nmr2dCHUnit theMedianPosition = new Nmr2dCHUnit();
        double theSumOfCarbonShift = 0;
        double theSumOfHydrogenShift = 0;

        for (int i = 0; i < thePeakList.size(); i++) {
            theSumOfCarbonShift += thePeakList.get(i).getCarbonShift();
            theSumOfHydrogenShift += thePeakList.get(i).getHydrogenShift();
        }

        theMedianPosition.setCarbonShift(theSumOfCarbonShift / thePeakList.size());
        theMedianPosition.setHydrogenShift(theSumOfHydrogenShift / thePeakList.size());

        return theMedianPosition;
    }
View Full Code Here

    private Nmr2dCHUnitList __generateCriterionPeakList() {
        Nmr2dCHUnitList theCriterionPeakList = new Nmr2dCHUnitList();

        for (int qi = 0, qEnd = this.getHMQC().getMedianPeak().size(); qi < qEnd; qi++) {
            Nmr2dCHUnit theClosestPeak = this.__getClosestPeak(this.getMergedHmbcAndHmqc(), this.getHMQC().getMedianPeak().get(qi));

            theCriterionPeakList.addPeak(theClosestPeak);
        }

        return theCriterionPeakList;
View Full Code Here

        return theCriterionPeakList;
    }

    private Nmr2dCHUnit __getClosestPeak(Nmr2dCHUnitList thePeakList, Nmr2dCHUnit theCheckPeak) {
        Nmr2dCHUnit theClosestPeak = new Nmr2dCHUnit();
        double theMinimumDistance = MAXIMUM_DISTANCE_IN_NMR_2D;

        for (Nmr2dCHUnit thePeak : thePeakList.getPeakList()) {
            if (!__isSamePeak(thePeak, theCheckPeak)) {
                double theDistance = Math.sqrt(Math.pow(thePeak.getCarbonShift() / this.MAXIMUM_CARBON_NMR_CHEMICAL_SHIFT - theCheckPeak.getCarbonShift() / this.MAXIMUM_CARBON_NMR_CHEMICAL_SHIFT, 2.0)
View Full Code Here

                continue;
            }

            String[] theSplitedString = theLines.get(i).split(" ");
            List<Double> thePeakDataArray = new java.util.ArrayList<Double>();
            Nmr2dCHUnit thePeak = new Nmr2dCHUnit();

            for (int j = 0; j < theSplitedString.length; j++) {
                if (!theSplitedString[j].isEmpty() && !theSplitedString[j].contains("?-?")) {
                    thePeakDataArray.add(Double.parseDouble(theSplitedString[j].toString()));
                }
            }

            thePeak.setCarbonShift(thePeakDataArray.get(this.SPARKY_CARBON_SHIFT_INDEX));
            thePeak.setHydrogenShift(thePeakDataArray.get(this.SPARKY_HYDROGEN_SHIFT_INDEX));
            thePeak.setIntensity(thePeakDataArray.get(this.SPARKY_INTENSITY_INDEX));

            this.setPeak().addPeak(thePeak);
        }
    }
View Full Code Here

TOP

Related Classes of org.bmdrc.nmr.Nmr2dCHUnit

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.