Search in sources :

Example 16 with ProcessedDataPoint

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.ProcessedDataPoint in project mzmine2 by mzmine.

the class IsotopePatternUtils method getIsotopePatternResults.

/**
 * Convenience method to get all isotope pattern results in a List<DPPIsotopePatternResult> list
 *
 * @param dp
 * @return
 */
@Nonnull
public static List<DPPIsotopePatternResult> getIsotopePatternResults(@Nonnull ProcessedDataPoint dp) {
    List<DPPIsotopePatternResult> results = new ArrayList<>();
    if (!dp.resultTypeExists(ResultType.ISOTOPEPATTERN))
        return results;
    List<DPPResult<?>> patternResults = dp.getAllResultsByType(ResultType.ISOTOPEPATTERN);
    for (int i = 0; i < patternResults.size(); i++) results.add((DPPIsotopePatternResult) patternResults.get(i));
    return results;
}
Also used : DPPResult(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPResult) DPPIsotopePatternResult(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPIsotopePatternResult) ArrayList(java.util.ArrayList) DataPoint(net.sf.mzmine.datamodel.DataPoint) SimpleDataPoint(net.sf.mzmine.datamodel.impl.SimpleDataPoint) ProcessedDataPoint(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.ProcessedDataPoint) Nonnull(javax.annotation.Nonnull)

Example 17 with ProcessedDataPoint

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.ProcessedDataPoint in project mzmine2 by mzmine.

the class IsotopePatternUtils method getChargeStates.

/**
 * @param dp a processed data point.
 * @return an empty list if no isotope pattern was detected, a list of the charge states if there
 *         was at least one charge detected.
 */
public static List<Integer> getChargeStates(ProcessedDataPoint dp) {
    List<Integer> charges = new ArrayList<>();
    List<DPPResult<?>> patternResults = dp.getAllResultsByType(ResultType.ISOTOPEPATTERN);
    for (int x = 0; x < patternResults.size(); x++) {
        DPPIsotopePatternResult pattern = (DPPIsotopePatternResult) patternResults.get(x);
        boolean add = true;
        for (int i = 0; i < charges.size(); i++) {
            if (charges.get(i).intValue() == pattern.getCharge()) {
                add = false;
            }
        }
        if (add) {
            charges.add(pattern.getCharge());
        }
    }
    return charges;
}
Also used : DPPResult(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPResult) DPPIsotopePatternResult(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPIsotopePatternResult) ArrayList(java.util.ArrayList) DataPoint(net.sf.mzmine.datamodel.DataPoint) SimpleDataPoint(net.sf.mzmine.datamodel.impl.SimpleDataPoint) ProcessedDataPoint(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.ProcessedDataPoint)

Aggregations

ProcessedDataPoint (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.ProcessedDataPoint)17 DataPoint (net.sf.mzmine.datamodel.DataPoint)14 ArrayList (java.util.ArrayList)9 SimpleDataPoint (net.sf.mzmine.datamodel.impl.SimpleDataPoint)7 DPPIsotopePatternResult (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPIsotopePatternResult)6 DPPIsotopicPeakResult (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPIsotopicPeakResult)5 DPPResult (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPResult)4 ExtendedIsotopePattern (net.sf.mzmine.datamodel.impl.ExtendedIsotopePattern)3 SimpleIsotopePattern (net.sf.mzmine.datamodel.impl.SimpleIsotopePattern)3 Nonnull (javax.annotation.Nonnull)2 IsotopePattern (net.sf.mzmine.datamodel.IsotopePattern)2 IsotopesDataSet (net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.IsotopesDataSet)2 MolecularFormulaRange (org.openscience.cdk.formula.MolecularFormulaRange)2 Color (java.awt.Color)1 Vector (java.util.Vector)1 MassDetector (net.sf.mzmine.modules.rawdatamethods.peakpicking.massdetection.MassDetector)1 DPPIsotopeCompositionResult (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPIsotopeCompositionResult)1 DPPSumFormulaResult (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.results.DPPSumFormulaResult)1 ScanDataSet (net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.ScanDataSet)1 MolecularFormulaGenerator (org.openscience.cdk.formula.MolecularFormulaGenerator)1