Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.DataPoint


      if (line.startsWith("DATA POINTS: ")) {
        int numOfDataPoints = Integer.parseInt(line
            .substring("DATA POINTS: ".length()));

        DataPoint completeDataPoints[] = new DataPoint[numOfDataPoints];

        // Because Intel CPU is using little endian natively, we
        // need to use LittleEndianDataInputStream instead of normal
        // Java DataInputStream, which is big-endian.
        LittleEndianDataInputStream dis = new LittleEndianDataInputStream(
            dumpStream);
        for (int i = 0; i < numOfDataPoints; i++) {
          double mz = dis.readDouble();
          double intensity = dis.readDouble();
          completeDataPoints[i] = new SimpleDataPoint(mz, intensity);
        }

        boolean centroided = ScanUtils.isCentroided(completeDataPoints);

        DataPoint optimizedDataPoints[] = ScanUtils
            .removeZeroDataPoints(completeDataPoints, centroided);

        /*
         * If this scan is a full scan (ms level = 1), it means that the
         * previous scans stored in the stack, are complete and ready to
View Full Code Here


    Index massValuesIndex = massValueArray.getIndex();
    Index intensityValuesIndex = intensityValueArray.getIndex();

    int arrayLength = massValueArray.getShape()[0];

    DataPoint completeDataPoints[] = new DataPoint[arrayLength];

    for (int j = 0; j < arrayLength; j++) {
      Index massIndex0 = massValuesIndex.set0(j);
      Index intensityIndex0 = intensityValuesIndex.set0(j);

      double mz = massValueArray.getDouble(massIndex0)
          * massValueScaleFactor;
      double intensity = intensityValueArray.getDouble(intensityIndex0)
          * intensityValueScaleFactor;
      completeDataPoints[j] = new SimpleDataPoint(mz, intensity);

    }

    scanNum++;

    // Auto-detect whether this scan is centroided
    boolean centroided = ScanUtils.isCentroided(completeDataPoints);

    // Remove zero data points
    DataPoint optimizedDataPoints[] = ScanUtils.removeZeroDataPoints(
        completeDataPoints, centroided);

    SimpleScan buildingScan = new SimpleScan(null, scanNum, 1,
        retentionTime.doubleValue(), -1, 0, 0, null,
        optimizedDataPoints, centroided);
View Full Code Here

      }

      // <spectrum>
      if (qName.equalsIgnoreCase("spectrum")) {

        DataPoint completeDataPoints[] = new DataPoint[peaksCount];
        spectrumInstrumentFlag = false;

        // Copy m/z and intensity data
        for (int i = 0; i < completeDataPoints.length; i++) {
          completeDataPoints[i] = new SimpleDataPoint(
              (double) mzDataPoints[i],
              (double) intensityDataPoints[i]);
        }

        // Auto-detect whether this scan is centroided
        boolean centroided = ScanUtils.isCentroided(completeDataPoints);

        // Remove zero data points
        DataPoint optimizedDataPoints[] = ScanUtils
            .removeZeroDataPoints(completeDataPoints, centroided);

        buildingScan = new SimpleScan(null, scanNumber, msLevel,
            retentionTime, parentScan, precursorMz,
            precursorCharge, null, optimizedDataPoints, centroided);
View Full Code Here

        // Get next scan
        Scan scan = dataFile.getScan(scanNumber);

        // Find most intense m/z peak
        DataPoint basePeak = ScanUtils.findBasePeak(scan, mzRange);

        if (basePeak != null) {
          if (basePeak.getIntensity() > 0)
            dataPointFound = true;
          newPeak.addDatapoint(scan.getScanNumber(), basePeak);
        } else {
          DataPoint fakeDataPoint = new SimpleDataPoint(
              mzRange.getAverage(), 0);
          newPeak.addDatapoint(scan.getScanNumber(), fakeDataPoint);
        }

        processedScans++;
View Full Code Here

    int allScanNumbers[] = CollectionUtils
        .toIntArray(dataPointMap.keySet());

    // Find the data point with top intensity and use its RT and height
    for (int i = 0; i < allScanNumbers.length; i++) {
      DataPoint dataPoint = dataPointMap.get(allScanNumbers[i]);
      double rt = dataFile.getScan(allScanNumbers[i]).getRetentionTime();
      if (dataPoint.getIntensity() > height) {
        height = dataPoint.getIntensity();
        representativeScan = allScanNumbers[i];
        this.rt = rt;
      }
    }
View Full Code Here

        // Get parent scan number
        int parentScan = extractParentScanNumber(spectrum);
        double precursorMz = extractPrecursorMz(spectrum);
        int precursorCharge = extractPrecursorCharge(spectrum);

        DataPoint dataPoints[] = extractDataPoints(spectrum);

        // Auto-detect whether this scan is centroided
        boolean centroided = ScanUtils.isCentroided(dataPoints);

        // Remove zero data points
        DataPoint optimizedDataPoints[] = ScanUtils
            .removeZeroDataPoints(dataPoints, centroided);

        SimpleScan scan = new SimpleScan(null, scanNumber, msLevel,
            retentionTime, parentScan, precursorMz,
            precursorCharge, null, optimizedDataPoints, centroided);
View Full Code Here

    BinaryDataArray mzArray = dataList.getBinaryDataArray().get(0);
    BinaryDataArray intensityArray = dataList.getBinaryDataArray().get(1);
    Number mzValues[] = mzArray.getBinaryDataAsNumberArray();
    Number intensityValues[] = intensityArray.getBinaryDataAsNumberArray();
    DataPoint dataPoints[] = new DataPoint[mzValues.length];
    for (int i = 0; i < dataPoints.length; i++) {
      double mz = mzValues[i].doubleValue();
      double intensity = intensityValues[i].doubleValue();
      dataPoints[i] = new SimpleDataPoint(mz, intensity);
    }
View Full Code Here

    candidatePeaks.addAll(Arrays.asList(mzPeaks));

    while (candidatePeaks.size() > 0) {

      // Always take the biggest (intensity) peak
      DataPoint currentCandidate = candidatePeaks.first();

      // Add this candidate to the final tree set sorted by MZ and remove
      // from tree set sorted by intensity
      finalMZPeaks.add(currentCandidate);
      candidatePeaks.remove(currentCandidate);
View Full Code Here

    // We search over all peak candidates and remove all of them that are
    // under the curve defined by our peak model
    Iterator<DataPoint> candidatesIterator = candidates.iterator();
    while (candidatesIterator.hasNext()) {

      DataPoint lateralCandidate = candidatesIterator.next();

      // Condition in x domain (m/z)
      if ((lateralCandidate.getIntensity() < peakModel
          .getIntensity(lateralCandidate.getMZ()))) {
        candidatesIterator.remove();
      }
    }

  }
View Full Code Here

      if (massList == null) {
        processedScans++;
        continue;
      }

      DataPoint mzPeaks[] = massList.getDataPoints();

      DataPoint newMzPeaks[] = ShoulderPeaksFilter.filterMassValues(
          mzPeaks, parameters);

      SimpleMassList newMassList = new SimpleMassList(massListName + " "
          + suffix, scan, newMzPeaks);
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.