Package net.sf.mzmine.data.impl

Examples of net.sf.mzmine.data.impl.SimplePeakList


  PeakList getIntensityThresholdPeakList(double intensity) {
    PeakList selectedPeakList = (PeakList) peakListSelector
        .getSelectedItem();
    if (selectedPeakList == null)
      return null;
    SimplePeakList newList = new SimplePeakList(selectedPeakList.getName(),
        selectedPeakList.getRawDataFiles());

    for (PeakListRow peakRow : selectedPeakList.getRows()) {
      ChromatographicPeak peak = peakRow.getPeak(dataFile);
      if (peak == null)
        continue;
      if (peak.getRawDataPointsIntensityRange().getMax() > intensity) {
        newList.addRow(peakRow);
      }
    }
    return newList;
  }
View Full Code Here


    PeakList selectedPeakList = (PeakList) peakListSelector
        .getSelectedItem();
    if (selectedPeakList == null)
      return null;
    SimplePeakList newList = new SimplePeakList(selectedPeakList.getName(),
        selectedPeakList.getRawDataFiles());

    Vector<PeakListRow> peakRows = new Vector<PeakListRow>();

    Range mzRange = selectedPeakList.getRowsMZRange();
    Range rtRange = selectedPeakList.getRowsRTRange();

    PeakThresholdMode selectedPeakOption = (PeakThresholdMode) thresholdCombo
        .getSelectedItem();
    if (selectedPeakOption == PeakThresholdMode.TOP_PEAKS_AREA) {
      mzRange = masterFrame.getPlot().getXYPlot().getAxisRange();
      rtRange = masterFrame.getPlot().getXYPlot().getDomainRange();
    }

    for (PeakListRow peakRow : selectedPeakList.getRows()) {
      if (mzRange.contains(peakRow.getAverageMZ())
          && rtRange.contains(peakRow.getAverageRT())) {
        peakRows.add(peakRow);
      }
    }

    Collections.sort(peakRows, new PeakListRowSorter(
        SortingProperty.Intensity, SortingDirection.Descending));

    if (threshold > peakRows.size())
      threshold = peakRows.size();
    for (int i = 0; i < threshold; i++) {
      newList.addRow(peakRows.elementAt(i));
    }
    return newList;
  }
View Full Code Here

    scanNumbers = dataFile.getScanNumbers(1);
    totalScans = scanNumbers.length;

    // Create new peak list
    newPeakList = new SimplePeakList(dataFile + " " + suffix, dataFile);

    Chromatogram[] chromatograms;
    HighestDataPointConnector massConnector = new HighestDataPointConnector(
        minimumTimeSpan, minimumHeight, mzTolerance);
View Full Code Here

    binTime = parameters.getParameter(MsMsPeakPickerParameters.rtWindow)
        .getValue();

    msLevel = parameters.getParameter(MsMsPeakPickerParameters.msLevel)
        .getValue();
    newPeakList = new SimplePeakList(dataFile.getName() + " MS/MS peaks",
        dataFile);
  }
View Full Code Here

    // Calculate total number of scans in all files
    totalScans = dataFile.getNumOfScans(1);

    // Create new peak list
    processedPeakList = new SimplePeakList(dataFile.getName() + " "
        + suffix, dataFile);

    List<PeakInformation> peaks = this.readFile();

    if (peaks == null || peaks.isEmpty()) {
View Full Code Here

      // Get filter weights.
      final double[] filterWeights = SavitzkyGolayFilter
          .getNormalizedWeights(filterWidth);

      // Create new peak list
      newPeakList = new SimplePeakList(origPeakList + " " + suffix,
          origPeakList.getRawDataFiles());
      int peakID = 1;

      // Process each row.
      for (final PeakListRow row : origPeakList.getRows()) {
View Full Code Here

    for (RawDataFile dataFile : peakList.getRawDataFiles()) {
      totalScans += dataFile.getNumOfScans(1);
    }

    // Create new peak list
    processedPeakList = new SimplePeakList(peakList + " " + suffix,
        peakList.getRawDataFiles());

    // Fill new peak list with empty rows
    for (int row = 0; row < peakList.getNumberOfRows(); row++) {
      PeakListRow sourceRow = peakList.getRow(row);
View Full Code Here

    // Get peak list columns
    RawDataFile columns[] = peakList.getRawDataFiles();

    // Create new peak list
    processedPeakList = new SimplePeakList(peakList + " " + suffix, columns);

    // Fill gaps in given column
    for (int row = 0; row < totalRows; row++) {

      // Canceled?
View Full Code Here

    // Get data file information
    RawDataFile dataFile = originalPeakList.getRawDataFile(0);

    // Create new peak list
    newPeakList = new SimplePeakList(originalPeakList + " " + suffix,
        dataFile);

    totalRows = originalPeakList.getNumberOfRows();
    int[] scanNumbers;
    double[] retentionTimes, intensities;
View Full Code Here

    final MZmineProcessingStep<PeakResolver> resolver = parameters
        .getParameter(PEAK_RESOLVER).getValue();

    // Create new peak list.
    final PeakList resolvedPeaks = new SimplePeakList(peakList + " "
        + parameters.getParameter(SUFFIX).getValue(), dataFile);

    // Load previous applied methods.
    for (final PeakListAppliedMethod method : peakList.getAppliedMethods()) {

      resolvedPeaks.addDescriptionOfAppliedTask(method);
    }

    // Add task description to peak list.
    resolvedPeaks
        .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
            "Peak deconvolution by " + resolver, resolver
                .getParameterSet()));

    // Initialise counters.
    processedRows = 0;
    totalRows = peakList.getNumberOfRows();
    int peakId = 1;

    // Process each chromatogram.
    final ChromatographicPeak[] chromatograms = peakList.getPeaks(dataFile);
    final int chromatogramCount = chromatograms.length;
    for (int index = 0; !isCanceled() && index < chromatogramCount; index++) {

      final ChromatographicPeak chromatogram = chromatograms[index];

      // Load the intensities into array.
      final double[] intensities = new double[scanCount];
      for (int i = 0; i < scanCount; i++) {

        final DataPoint dp = chromatogram.getDataPoint(scanNumbers[i]);
        intensities[i] = dp != null ? dp.getIntensity() : 0.0;
      }

      // Resolve peaks.
      final PeakResolver resolverModule = resolver.getModule();
      final ParameterSet resolverParams = resolver.getParameterSet();
      final ChromatographicPeak[] peaks = resolverModule.resolvePeaks(
          chromatogram, scanNumbers, retentionTimes, intensities,
          resolverParams);

      // Add peaks to the new peak list.
      for (final ChromatographicPeak peak : peaks) {

        final PeakListRow newRow = new SimplePeakListRow(peakId++);
        newRow.addPeak(dataFile, peak);
        resolvedPeaks.addRow(newRow);
      }

      processedRows++;
    }
View Full Code Here

TOP

Related Classes of net.sf.mzmine.data.impl.SimplePeakList

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.