Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.DataPoint


   *            m/z range maximum
   * @return double[2] containing base peak m/z and intensity
   */
  public static DataPoint findBasePeak(Scan scan, Range mzRange) {

    DataPoint dataPoints[] = scan.getDataPointsByMass(mzRange);
    DataPoint basePeak = null;

    for (DataPoint dp : dataPoints) {
      if ((basePeak == null)
          || (dp.getIntensity() > basePeak.getIntensity()))
        basePeak = dp;
    }

    return basePeak;
  }
View Full Code Here


      Scan scan = dataFile.getScan(number);

      if (mzRange.contains(scan.getPrecursorMZ())) {

        DataPoint basePeak = scan.getBasePeak();

        // If there is no peak in the scan, basePeak can be null
        if (basePeak == null)
          continue;

        if (basePeak.getIntensity() > topBasePeak) {
          bestFragmentScan = scan.getScanNumber();
          topBasePeak = basePeak.getIntensity();
        }
      }

    }
View Full Code Here

   * Find the highest data point in array
   *
   */
  public static DataPoint findTopDataPoint(DataPoint dataPoints[]) {

    DataPoint topDP = null;

    for (DataPoint dp : dataPoints) {
      if ((topDP == null) || (dp.getIntensity() > topDP.getIntensity())) {
        topDP = dp;
      }
    }

    return topDP;
View Full Code Here

    // make a data input stream
    ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes);
    DataInputStream peakStream = new DataInputStream(byteStream);

    DataPoint dataPoints[] = new DataPoint[dpCount];

    for (int i = 0; i < dataPoints.length; i++) {
      try {
        double mz = peakStream.readDouble();
        double intensity = peakStream.readDouble();
View Full Code Here

    int scaleLevel = parameters.getParameter(
        WaveletMassDetectorParameters.scaleLevel).getValue();
    double waveletWindow = parameters.getParameter(
        WaveletMassDetectorParameters.waveletWindow).getValue();

    DataPoint originalDataPoints[] = scan.getDataPoints();

    DataPoint waveletDataPoints[] = performCWT(originalDataPoints,
        waveletWindow, scaleLevel);

    DataPoint mzPeaks[] = getMzPeaks(noiseLevel, originalDataPoints,
        waveletDataPoints);

    return mzPeaks;
  }
View Full Code Here

    return dataPoints;
  }

  public static DataPoint[] decodeDataPointsBase64(char encodedData[]) {
    byte[] bytes = Base64.decode(new String(encodedData));
    DataPoint dataPoints[] = decodeDataPointsFromBytes(bytes);
    return dataPoints;
  }
View Full Code Here

    // Set raw data point ranges, height, rt and representative scan
    height = Double.MIN_VALUE;
    for (int i = 0; i < scanNumbers.length; i++) {

      DataPoint dp = chromatogram.getDataPoint(scanNumbers[i]);
      if (dp == null) {
        String error = "Cannot create a resolved peak in a region with missing data points: chromatogram "
            + chromatogram
            + " scans "
            + chromatogramScanNumbers[regionStart]
            + "-"
            + chromatogramScanNumbers[regionEnd]
            + ", missing data point in scan " + scanNumbers[i];
        throw new IllegalArgumentException(error);
      }

      dataPointMZValues[i] = dp.getMZ();
      dataPointIntensityValues[i] = dp.getIntensity();

      if (rawDataPointsIntensityRange == null) {
        rawDataPointsIntensityRange = new Range(dp.getIntensity());
        rawDataPointsRTRange = new Range(dataFile.getScan(
            scanNumbers[i]).getRetentionTime());
        rawDataPointsMZRange = new Range(dp.getMZ());
      } else {
        rawDataPointsRTRange.extendRange(dataFile.getScan(
            scanNumbers[i]).getRetentionTime());
        rawDataPointsIntensityRange.extendRange(dp.getIntensity());
        rawDataPointsMZRange.extendRange(dp.getMZ());
      }

      if (height < dp.getIntensity()) {
        height = dp.getIntensity();
        rt = dataFile.getScan(scanNumbers[i]).getRetentionTime();
        representativeScan = scanNumbers[i];
      }
    }
View Full Code Here

    for (endIndex = startIndex; endIndex < dataPoints.length; endIndex++) {
      if (dataPoints[endIndex].getMZ() > mzRange.getMax())
        break;
    }

    DataPoint pointsWithinRange[] = new DataPoint[endIndex - startIndex];

    // Copy the relevant points
    System.arraycopy(dataPoints, startIndex, pointsWithinRange, 0, endIndex
        - startIndex);
View Full Code Here

    for (index = 0; index < dataPoints.length; index++) {
      if (dataPoints[index].getIntensity() >= intensity)
        points.add(dataPoints[index]);
    }

    DataPoint pointsOverIntensity[] = points.toArray(new DataPoint[0]);

    return pointsOverIntensity;
  }
View Full Code Here

    if (qName.equals(PeakListElementName_2_5.ISOTOPE.getElementName())) {
      String text = getTextOfElement();
      String items[] = text.split(":");
      double mz = Double.valueOf(items[0]);
      double intensity = Double.valueOf(items[1]);
      DataPoint isotope = new SimpleDataPoint(mz, intensity);
      currentIsotopes.add(isotope);
    }

    if (qName.equals(PeakListElementName_2_5.METHOD_NAME.getElementName())) {
      String appliedMethod = getTextOfElement();
View Full Code Here

TOP

Related Classes of net.sf.mzmine.data.DataPoint

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.