Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.Scan


      return exitCode;

    for (RawDataFile file : selectedFiles) {
      int scanNums[] = file.getScanNumbers(selectedMSLevel);
      for (int scanNum : scanNums) {
        Scan s = file.getScan(scanNum);
        if (s.isCentroided())
          centroidData = true;
      }
    }

    // Check the selected mass detector
View Full Code Here


        .getIntensityFormat();

    int parentNumber = currentScan.getParentScanNumber();
    if ((currentScan.getMSLevel() > 1) && (parentNumber > 0)) {

      Scan parentScan = dataFile.getScan(parentNumber);
      if (parentScan != null) {
        String itemText = "Parent scan #" + parentNumber + ", RT: "
            + rtFormat.format(parentScan.getRetentionTime())
            + ", precursor m/z: "
            + mzFormat.format(currentScan.getPrecursorMZ());

        if (currentScan.getPrecursorCharge() > 0)
          itemText += " (chrg " + currentScan.getPrecursorCharge()
              + ")";

        msmsSelector.addItem(itemText);
        msmsVisible = true;
      }
    }

    // Add all fragment scans to MS/MS selector combo
    int fragmentScans[] = currentScan.getFragmentScanNumbers();
    if (fragmentScans != null) {
      for (int fragment : fragmentScans) {
        Scan fragmentScan = dataFile.getScan(fragment);
        if (fragmentScan == null)
          continue;
        final String itemText = "Fragment scan #" + fragment + ", RT: "
            + rtFormat.format(fragmentScan.getRetentionTime())
            + ", precursor m/z: "
            + mzFormat.format(fragmentScan.getPrecursorMZ());
        // Updating the combo in other than Swing thread may cause
        // exception
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            msmsSelector.addItem(itemText);
View Full Code Here

    for (int i = 0; i < totalScans; i++) {

      if (isCanceled())
        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
      scan.addMassList(newMassList);

      processedScans++;
    }

    setStatus(TaskStatus.FINISHED);
View Full Code Here

      for (int scanIndex = 0; scanIndex < scanNumbers.length; scanIndex++) {

        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();
        }

        double[] binnedIntensities = ScanUtils.binValues(scanMZValues,
            scanIntensityValues, mzRange, mzResolution,
            !scan.isCentroided(), BinningType.MAX);

        int scanBinIndex;

        double rt = scan.getRetentionTime();
        scanBinIndex = (int) ((rt - rtRange.getMin()) / rtStep);

        // last scan falls into last bin
        if (scanBinIndex == rtResolution)
          scanBinIndex--;
View Full Code Here

   *
   * @param scanNumber
   */
  protected void loadPreview(SpectraPlot spectrumPlot, Scan previewScan) {

    Scan newScan = rawDataFilter.filterScan(previewScan, filterParameters);

    ScanDataSet spectraDataSet = new ScanDataSet("Filtered scan", newScan);
    ScanDataSet spectraOriginalDataSet = new ScanDataSet("Original scan",
        previewScan);

View Full Code Here

        if (isCanceled()) {
          return;
        }

        Scan scan = dataFile.getScan(scanNumbers[i]);
        if ((scan.getMSLevel() != 1)
            && (scan.getParentScanNumber() <= 0)) {
          return;
        }
        Scan newScan = rawDataFilter.getModule().filterScan(scan,
            rawDataFilter.getParameterSet());
        if (newScan != null) {
          rawDataFileWriter.addScan(newScan);
        }
View Full Code Here

    XYItemRenderer newRenderer;

    if (dataSet instanceof ScanDataSet) {
      ScanDataSet scanDataSet = (ScanDataSet) dataSet;
      Scan scan = scanDataSet.getScan();
      if (scan.isCentroided())
        newRenderer = new PeakRenderer(color, transparency);
      else {
        newRenderer = new ContinuousRenderer(color, transparency);
        ((ContinuousRenderer) newRenderer)
            .setBaseShapesVisible(dataPointsVisible);
View Full Code Here

    // Process each scan.
    for (int index = 0; status != CANCELED && index < totalScans; index++) {

      // 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();

      // Update min and max.
      if (index == 0) {

        intensityMin = intensity;
View Full Code Here

      // Cancel?
      if (status == TaskStatus.CANCELED)
        return;

      Scan scan = rawDataFile.getScan(scanNumber);

      // check parent m/z
      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;
      }

      // topPeaks will contain indexes to mzValues peaks of top intensity
      int topPeaks[] = new int[numOfFragments];
      Arrays.fill(topPeaks, -1);

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

        fragmentsCycle : for (int j = 0; j < numOfFragments; j++) {

          // Cancel?
          if (status == TaskStatus.CANCELED)
            return;

          if ((topPeaks[j] < 0)
              || (scanDataPoints[i].getIntensity()) > scanDataPoints[topPeaks[j]]
                  .getIntensity()) {

            // shift the top peaks array
            for (int k = numOfFragments - 1; k > j; k--)
              topPeaks[k] = topPeaks[k - 1];

            // add the peak to the appropriate place
            topPeaks[j] = i;

            break fragmentsCycle;
          }
        }

      }

      // add the data points
      for (int i = 0; i < topPeaks.length; i++) {

        int peakIndex = topPeaks[i];

        // if we have a very few peaks, the array may not be full
        if (peakIndex < 0)
          break;

        NeutralLossDataPoint newPoint = new NeutralLossDataPoint(
            scanDataPoints[peakIndex].getMZ(),
            scan.getScanNumber(), scan.getParentScanNumber(),
            scan.getPrecursorMZ(), scan.getPrecursorCharge(),
            scan.getRetentionTime());

        dataSeries.get(0).add(newPoint);

      }
View Full Code Here

      int childCount = getChildCount(dataFilesNode);
      insertNodeInto(newNode, dataFilesNode, childCount);
      RawDataFile dataFile = (RawDataFile) object;
      int scanNumbers[] = dataFile.getScanNumbers();
      for (int i = 0; i < scanNumbers.length; i++) {
        Scan scan = dataFile.getScan(scanNumbers[i]);
        DefaultMutableTreeNode scanNode = new DefaultMutableTreeNode(
            scan);
        treeObjects.put(scan, scanNode);
        insertNodeInto(scanNode, newNode, i);

        MassList massLists[] = scan.getMassLists();
        for (int j = 0; j < massLists.length; j++) {
          DefaultMutableTreeNode mlNode = new DefaultMutableTreeNode(
              massLists[j]);
          treeObjects.put(massLists[j], mlNode);
          insertNodeInto(mlNode, scanNode, j);

        }
      }

    }

    if (object instanceof MassList) {
      Scan scan = ((MassList) object).getScan();

      final DefaultMutableTreeNode scNode = treeObjects.get(scan);
      assert scNode != null;

      int index = scNode.getChildCount();
View Full Code Here

TOP

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

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.