Package org.bmdrc.nmr

Examples of org.bmdrc.nmr.Nmr2dCHUnit


    }

    private void __addPeakDataFromACDLab(final List<String> theLines) throws NumberFormatException {
        for (int i = 0; i < theLines.size(); i++) {
            String[] theSplitedString = theLines.get(i).split("\t");
            Nmr2dCHUnit thePeak = new Nmr2dCHUnit();

            if (theLines.get(i).trim().isEmpty() || theSplitedString.length < ACDLAB_LEAST_OF_NUMBER_OF_TABLES) {
                continue;
            }

            thePeak.setCarbonShift(Double.parseDouble(theSplitedString[ACDLAB_CARBONC_SHIFT_INDEX]));
            thePeak.setHydrogenShift(Double.parseDouble(theSplitedString[ACDLAB_HYDROGEN_SHIFT_INDEX]));
            thePeak.setIntensity(Double.parseDouble(theSplitedString[ACDLAB_INTENSITY_INDEX]));

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


        this.__removeNoisePeak();
    }

    private void __generatedMedianPeak(Nmr2dCHUnitList theCopiedPeakList, Nmr1dUnit theCriterion1HPeak, Nmr1dUnit theCriterion13CPeak) {
        Nmr2dCHUnit theCriterionPeakBasedOnNmr1D = new Nmr2dCHUnit();
        Nmr2dCHUnit theFirstPeakInGroup = new Nmr2dCHUnit();
        Nmr2dCHUnitList theClosePeakSet = new Nmr2dCHUnitList();

        theCriterionPeakBasedOnNmr1D.setPeak(theCriterion13CPeak.getChemicalShift(), theCriterion1HPeak.getChemicalShift());

        theFirstPeakInGroup = this.__getClosestPeak(theCriterionPeakBasedOnNmr1D);
View Full Code Here

            }
        }
    }

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

        for (Nmr2dCHUnit thePeak : this.getPeak().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

    private Double __calculateDistance(double theFirstShift, double theSecondShift) {
        return Math.abs(theFirstShift - theSecondShift);
    }

    private Nmr2dCHUnit __calculateMedianPosition(Nmr2dCHUnitList thePeakList) {
        Nmr2dCHUnit theMedianPosition = new Nmr2dCHUnit();
        double theSumOfCarbonShift = 0;
        double theSumOfHydrogenShift = 0;
        int theSizeOfPeakList = thePeakList.size();

        for (Nmr2dCHUnit thePeak : thePeakList.toList()) {
            theSumOfCarbonShift += thePeak.getCarbonShift();
            theSumOfHydrogenShift += thePeak.getHydrogenShift();
        }

        theMedianPosition.setCarbonShift(theSumOfCarbonShift / (double) theSizeOfPeakList);
        theMedianPosition.setHydrogenShift(theSumOfHydrogenShift / (double) theSizeOfPeakList);

        return theMedianPosition;
    }
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.