Package org.bmdrc.nmr

Examples of org.bmdrc.nmr.Nmr1dUnitList


    public HydrogenQueryGeneratorInNmr2d() {
        this.set1HNMRFilePath(new String());
        this.set13CNMRFilePath(new String());
        this.setHMQCFilePath(new String());
        this.setHMBCFilePath(new String());
        this.set1HPeakList(new Nmr1dUnitList());
        this.set13CPeakList(new Nmr1dUnitList());
        this.setHMQCPeakList(new Nmr2dCHUnitList());
        this.__setStartPeakListInHMBC(new Nmr2dCHUnitList());
        this.__setStartPeakListInHMQC(new Nmr2dCHUnitList());
    }
View Full Code Here


    }

    private Nmr2dCHUnitList __convertMedianPeakInMergeHMBCAndHMQC(Integer theNumberOfCarbon, Integer theNumberOfHydrogen, Integer theTypeOfInputFileFormat) {
        Nmr2dCHUnitList theHMQCPeakData = new Nmr2dCHUnitList();
        Nmr2dCHUnitList theHMBCPeakData = new Nmr2dCHUnitList();
        Nmr1dUnitList the1HPeakData = this.__read1DNMRACDLabFileFormat(this.get1HNMRFilePath(), theNumberOfHydrogen);;
        Nmr1dUnitList the13CPeakData = this.__read1DNMRACDLabFileFormat(this.get13CNMRFilePath(), theNumberOfCarbon);
        Nmr2dCHUnitList theMedianPeakInHMBC = new Nmr2dCHUnitList();
        Nmr2dCHUnitList theMedianPeakInHMQC = new Nmr2dCHUnitList();

        List<Nmr1dUnitList> theSortedByCarbonPeak = new ArrayList<>();
        List<Nmr1dUnitList> theSortedByHydrogenPeak = new ArrayList<>();
View Full Code Here

        return theMedianPeakInHMBC;
    }

    private Nmr1dUnitList __read1DNMRACDLabFileFormat(String theFilePath, Integer theNumberOfAtom) {
        Nmr1dUnitList theNMRData = new Nmr1dUnitList();
        Nmr1dUnitList theCopiedNMRData = new Nmr1dUnitList();

        try {
            theNMRData = this.__getPeakInACDFormat(new File(theFilePath));
            Comparator<Nmr1dUnit> theComparator = new Comparator() {
                @Override
View Full Code Here

        return this.__modifyNmrData(theNMRData, theNumberOfAtom);
    }

    private Nmr1dUnitList __modifyNmrData(Nmr1dUnitList theNMRData, Integer theNumberOfAtom) {
        for (Object thePeak : theNMRData) {
            Nmr1dUnitList theCopiedNMRData = new Nmr1dUnitList(theNMRData);
            double theMinimumIntensity = ((Nmr1dUnit) thePeak).getIntensity();
            int theNumberOfHydrogenInCase = 0;


            for (Object theCopiedPeak : theCopiedNMRData) {
                ((Nmr1dUnit) theCopiedPeak).setIntensity(((Nmr1dUnit) theCopiedPeak).getIntensity() / theMinimumIntensity);
                theNumberOfHydrogenInCase += (int) Math.round(((Nmr1dUnit) theCopiedPeak).getIntensity());
            }

            if (theNumberOfAtom >= theNumberOfHydrogenInCase) {
                return theCopiedNMRData;
            }
        }

        return new Nmr1dUnitList();
    }
View Full Code Here

    }

    private Nmr1dUnitList __getPeakInACDFormat(File theACDFile) throws FileNotFoundException, IOException {
        BufferedReader theFileReader = new BufferedReader(new FileReader(theACDFile));
        String theFileInformationByLine = new String();
        Nmr1dUnitList thePeakList = new Nmr1dUnitList();

        theFileReader.readLine();
        theFileReader.readLine();

        while ((theFileInformationByLine = theFileReader.readLine()) != null) {
            thePeakList.addPeak(this.__getPeakInACDFormat(theFileInformationByLine));
        }

        return thePeakList;
    }
View Full Code Here

        return true;
    }

    private Boolean __isNoisePeak(Nmr2dCHUnit theMedianPeak, Integer theNumberOfCarbon, Integer theNumberOfHydrogen) {
        Nmr1dUnitList the1HPeakList = this.__read1DNMRACDLabFileFormat(this.get1HNMRFilePath(), theNumberOfHydrogen);
        Nmr1dUnitList the13CPeakList = this.__read1DNMRACDLabFileFormat(this.get13CNMRFilePath(), theNumberOfCarbon);
        Double theTolerenceOfHydrogen = this.__getTolerenceOfHydrogenInHMBC();
        Double theTolerenceOfCarbon = this.__getTolerenceOfCarbonInHMBC();
        List<Boolean> theJugmentArray = new ArrayList<>();
        final Integer CARBON_JUGMENT = 0;
        final Integer HYDROGEN_JUGMENT = 1;
View Full Code Here

        return thePeak2dList;
    }

    private Nmr1dUnitList __inputPeakListByMolecule(IMolecule theMolecule, String theSpectrumInformation, List<String> theExperimentEnvironmentList, boolean theJugmentOfCarbonPeak) {
        Nmr1dUnitList thePeakList = new Nmr1dUnitList();
        String[] theSplitedInformation = theSpectrumInformation.split(this.CRITERION_DIVIDED_PEAK);
        List<String> theList = new ArrayList<>();

        for (String thePeakInformation : theSplitedInformation) {
            if (!thePeakInformation.isEmpty()) {
                thePeakList.addAllPeaks(this.__generatePeakListInformation(theMolecule, thePeakInformation, theExperimentEnvironmentList, theJugmentOfCarbonPeak));
            }
        }

        return thePeakList;
    }
View Full Code Here

        return thePeakList;
    }

    private Nmr1dUnitList __generatePeakListInformation(IMolecule theMolecule, String thePeakInformation, List<String> theExperimentEnvironmentList, boolean theJugmentOfCarbonPeak) {
        Nmr1dUnitList thePeakList = new Nmr1dUnitList();
        String[] theSplitedPeakInformation = thePeakInformation.split(this.CRITERION_DIVIDED_PEAK_INFORMATION);

        theSplitedPeakInformation[this.ANNOTATED_ATOM_NUMBER_INDEX] =
                this.__getCorrectAnnotatedAtomNumber(theMolecule, theSplitedPeakInformation[this.ANNOTATED_ATOM_NUMBER_INDEX], theJugmentOfCarbonPeak);

        thePeakList.addPeak(this.__generatePeakInformation(theSplitedPeakInformation, theExperimentEnvironmentList));

        return thePeakList;
    }
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

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.