Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.DataPoint


        if (isCanceled())
          return;

        Scan scan = dataFile.getScan(scanNumbers[scanIndex]);

        DataPoint dataPoints[] = scan.getDataPoints();
        double[] scanMZValues = new double[dataPoints.length];
        double[] scanIntensityValues = new double[dataPoints.length];
        for (int dp = 0; dp < dataPoints.length; dp++) {
          scanMZValues[dp] = dataPoints[dp].getMZ();
          scanIntensityValues[dp] = dataPoints[dp].getIntensity();
View Full Code Here


        LocalMaxMassDetectorParameters.noiseLevel).getValue();

    // List of found mz peaks
    ArrayList<DataPoint> mzPeaks = new ArrayList<DataPoint>();

    DataPoint dataPoints[] = scan.getDataPoints();

    // All data points of current m/z peak

    // Top data point of current m/z peak
    DataPoint currentMzPeakTop = null;

    // True if we haven't reached the current local maximum yet
    boolean ascending = true;

    // Iterate through all data points
    for (int i = 0; i < dataPoints.length - 1; i++) {

      boolean nextIsBigger = dataPoints[i + 1].getIntensity() > dataPoints[i]
          .getIntensity();
      boolean nextIsZero = dataPoints[i + 1].getIntensity() == 0;
      boolean currentIsZero = dataPoints[i].getIntensity() == 0;

      // Ignore zero intensity regions
      if (currentIsZero)
        continue;

      // Check for local maximum
      if (ascending && (!nextIsBigger)) {
        currentMzPeakTop = dataPoints[i];
        ascending = false;
        continue;
      }

      assert currentMzPeakTop != null;

      // Check for the end of the peak
      if ((!ascending) && (nextIsBigger || nextIsZero)) {

        // Add the m/z peak if it is above the noise level
        if (currentMzPeakTop.getIntensity() > noiseLevel) {
          mzPeaks.add(currentMzPeakTop);
        }

        // Reset and start with new peak
        ascending = true;
View Full Code Here

        peakIndex = i;
      }

      // Copy RT and m/z.
      retentionTimes[i] = dataFile.getScan(scanNumber).getRetentionTime();
      final DataPoint dataPoint = peak.getDataPoint(scanNumber);
      if (dataPoint == null) {

        mzValues[i] = 0.0;
        intensities[i] = 0.0;

      } else {

        mzValues[i] = dataPoint.getMZ();
        intensities[i] = dataPoint.getIntensity();
      }
    }

    peakItem = peakIndex;
  }
View Full Code Here

    }

    int marginSize = (numOfDataPoints + 1) / 2 - 1;
    double sumOfInts;

    DataPoint oldDataPoints[] = scan.getDataPoints();
    int newDataPointsLength = oldDataPoints.length - (marginSize * 2);

    // only process scans with datapoints
    if (newDataPointsLength < 1) {
      return scan;
    }

    DataPoint newDataPoints[] = new DataPoint[newDataPointsLength];

    for (int spectrumInd = marginSize; spectrumInd < (oldDataPoints.length - marginSize); spectrumInd++) {

      // zero intensity data points must be left unchanged
      if (oldDataPoints[spectrumInd].getIntensity() == 0) {
View Full Code Here

    if (numberOfBins == 0) {
      numberOfBins++;
    }

    // ScanUtils.binValues needs arrays
    DataPoint dps[] = scan.getDataPoints();
    double[] x = new double[dps.length];
    double[] y = new double[dps.length];
    for (int i = 0; i < dps.length; i++) {
      x[i] = dps[i].getMZ();
      y[i] = dps[i].getIntensity();
View Full Code Here

      // Current scan.
      final Scan scan = dataFile.getScan(scanNumbers[index]);

      // Determine base peak value.
      final DataPoint basePeak = scan.getMZRange().isWithin(mzRange)
          ? scan.getBasePeak()
          : ScanUtils.findBasePeak(scan, mzRange);
      if (basePeak != null) {

        basePeakValues[index] = basePeak.getMZ();
      }

      // Determine peak intensity.
      double intensity = 0.0;
      if (plotType == PlotType.TIC) {

        // Total ion count.
        intensity = scan.getMZRange().isWithin(mzRange)
            ? scan.getTIC()
            : ScanUtils.calculateTIC(scan, mzRange);

      } else if (plotType == PlotType.BASEPEAK && basePeak != null) {

        intensity = basePeak.getIntensity();
      }

      intensityValues[index] = intensity;
      rtValues[index] = scan.getRetentionTime();
View Full Code Here

      if (!totalMZRange.contains(scan.getPrecursorMZ())) {
        continue;
      }

      // get m/z and intensity values
      DataPoint scanDataPoints[] = scan.getDataPoints();

      // skip empty scans
      if (scan.getBasePeak() == null) {
        processedScans++;
        continue;
View Full Code Here

    double hiLimit;
    double mzVal;

    double elSum;

    DataPoint oldDataPoints[] = sc.getDataPoints();
    DataPoint newDataPoints[] = new DataPoint[oldDataPoints.length];

    int addi = 0;
    for (int i = 0; i < oldDataPoints.length; i++) {

      currentMass = oldDataPoints[i].getMZ();
View Full Code Here

    double minimumMZPeakWidth = parameters.getParameter(
        RecursiveMassDetectorParameters.minimumMZPeakWidth).getValue();
    double maximumMZPeakWidth = parameters.getParameter(
        RecursiveMassDetectorParameters.maximumMZPeakWidth).getValue();

    DataPoint dataPoints[] = scan.getDataPoints();
    TreeSet<DataPoint> mzPeaks = new TreeSet<DataPoint>(
        new DataPointSorter(SortingProperty.MZ,
            SortingDirection.Ascending));

    // Find MzPeaks
View Full Code Here

    if ((scanRT > rtRange.getMax()) && (currentPeakDataPoints == null)) {
      return;
    }

    // Find top m/z peak in our range
    DataPoint basePeak = ScanUtils.findBasePeak(scan, mzRange);

    GapDataPoint currentDataPoint;
    if (basePeak != null) {
      currentDataPoint = new GapDataPoint(scan.getScanNumber(),
          basePeak.getMZ(), scanRT, basePeak.getIntensity());
    } else {
      currentDataPoint = new GapDataPoint(scan.getScanNumber(),
          mzRange.getAverage(), scanRT, 0);
    }
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.