Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.DataPoint


   */
  public @Nonnull
  DataPoint[] getDataPointsOverIntensity(double intensity) {
    int index;
    Vector<DataPoint> points = new Vector<DataPoint>();
    DataPoint dataPoints[] = getDataPoints();

    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


  public void setRetentionTime(double retentionTime) {
    this.retentionTime = retentionTime;
  }

  void updateValues() {
    DataPoint dataPoints[] = getDataPoints();

    // find m/z range and base peak
    if (dataPoints.length > 0) {

      basePeak = dataPoints[0];
View Full Code Here

    StorableMassList storedMassList;
    if (massList instanceof StorableMassList) {
      storedMassList = (StorableMassList) massList;
    } else {
      DataPoint massListDataPoints[] = massList.getDataPoints();
      try {
        int mlStorageID = rawDataFile
            .storeDataPoints(massListDataPoints);
        storedMassList = new StorableMassList(rawDataFile, mlStorageID,
            massList.getName(), this);
View Full Code Here

          - (binTime / 2.0f), scan.getRetentionTime()
          + (binTime / 2.0f));
      Range mzWindow = new Range(
          scan.getPrecursorMZ() - (binSize / 2.0f),
          scan.getPrecursorMZ() + (binSize / 2.0f));
      DataPoint point;
      DataPoint maxPoint = null;
      int[] regionScanNumbers = dataFile.getScanNumbers(1, rtWindow);
      for (int regionScanNumber : regionScanNumbers) {
        Scan regionScan = dataFile.getScan(regionScanNumber);
        point = ScanUtils.findBasePeak(regionScan, mzWindow);
        // no datapoint found
        if (point == null) {
          continue;
        }
        if (maxPoint == null) {
          maxPoint = point;
        }
        int result = Double.compare(maxPoint.getIntensity(),
            point.getIntensity());
        if (result <= 0) {
          maxPoint = point;
          bestScan = regionScan;
        }

      }

      // if no representative dataPoint
      if (bestScan == null) {
        continue;
      }

      assert maxPoint != null;

      SimpleChromatographicPeak c = new SimpleChromatographicPeak(
          dataFile, scan.getPrecursorMZ(),
          bestScan.getRetentionTime(), maxPoint.getIntensity(),
          maxPoint.getIntensity(),
          new int[]{bestScan.getScanNumber()},
          new DataPoint[]{maxPoint}, PeakStatus.DETECTED,
          bestScan.getScanNumber(), scan.getScanNumber(), new Range(
              bestScan.getRetentionTime()), new Range(
              scan.getPrecursorMZ()), new Range(
              maxPoint.getIntensity()));

      PeakListRow entry = new SimplePeakListRow(scan.getScanNumber());
      entry.addPeak(dataFile, c);

      newPeakList.addRow(entry);
View Full Code Here

      // ignore scans of other ms levels
      if (scan.getMSLevel() != msLevel)
        continue;

      DataPoint scanBasePeak = scan.getBasePeak();
      if (scanBasePeak == null)
        continue;

      if ((maxBasePeak == null)
          || (scanBasePeak.getIntensity() > maxBasePeak))
        maxBasePeak = scanBasePeak.getIntensity();

    }

    // return -1 if no scan at this MS level
    if (maxBasePeak == null)
View Full Code Here

    dataPointsFile.seek(currentOffset);
    dataPointsFile.read(buffer.array(), 0, numOfBytes);

    FloatBuffer floatBuffer = buffer.asFloatBuffer();

    DataPoint dataPoints[] = new DataPoint[numOfDataPoints];

    for (int i = 0; i < numOfDataPoints; i++) {
      float mz = floatBuffer.get();
      float intensity = floatBuffer.get();
      dataPoints[i] = new SimpleDataPoint(mz, intensity);
View Full Code Here

    if (newScan instanceof StorableScan) {
      scans.put(newScan.getScanNumber(), (StorableScan) newScan);
      return;
    }

    DataPoint dataPoints[] = newScan.getDataPoints();
    final int storageID = storeDataPoints(dataPoints);

    StorableScan storedScan = new StorableScan(newScan, this,
        dataPoints.length, storageID);
View Full Code Here

          + " precursor m/z)";
    }

    subTitle += ", RT " + rtFormat.format(currentScan.getRetentionTime());

    DataPoint basePeak = currentScan.getBasePeak();
    if (basePeak != null) {
      subTitle += ", base peak: " + mzFormat.format(basePeak.getMZ())
          + " m/z ("
          + intensityFormat.format(basePeak.getIntensity()) + ")";
    }

    setTitle(title);
    spectrumPlot.setTitle(title, subTitle);
View Full Code Here

  @Override
  public @Nonnull
  DataPoint[] getDataPoints() {
    try {
      DataPoint result[] = rawDataFile.readDataPoints(storageID);
      return result;

    } catch (IOException e) {
      logger.severe("Could not read data from temporary file "
          + e.toString());
View Full Code Here

        return;

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

      MassDetector detector = massDetector.getModule();
      DataPoint mzPeaks[] = detector.getMassValues(scan,
          massDetector.getParameterSet());

      SimpleMassList newMassList = new SimpleMassList(name, scan, mzPeaks);

      // Add new mass list to the scan
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.