Package net.sf.mzmine.data.impl

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


  private void initializePeakList() {

    RawDataFile[] dataFiles = currentPeakListDataFiles
        .toArray(new RawDataFile[0]);

    buildingPeakList = new SimplePeakList(peakListName, dataFiles);

    for (int i = 0; i < appliedMethods.size(); i++) {
      String methodName = appliedMethods.elementAt(i);
      String methodParams = appliedMethodParameters.elementAt(i);
      PeakListAppliedMethod pam = new SimplePeakListAppliedMethod(
View Full Code Here


  private void initializePeakList() {

    RawDataFile[] dataFiles = currentPeakListDataFiles
        .toArray(new RawDataFile[0]);

    buildingPeakList = new SimplePeakList(peakListName, dataFiles);

    for (int i = 0; i < appliedMethods.size(); i++) {
      String methodName = appliedMethods.elementAt(i);
      String methodParams = appliedMethodParameters.elementAt(i);
      PeakListAppliedMethod pam = new SimplePeakListAppliedMethod(
View Full Code Here

      processedRows++;
    }

    // Create the new peak list.
    final PeakList newPeakList = new SimplePeakList(origPeakList + " "
        + suffix, origPeakList.getRawDataFiles());

    // Add all remaining rows to a new peak list.
    for (int i = 0; !isCanceled() && i < rowCount; i++) {

      final PeakListRow row = peakListRows[i];

      if (row != null) {

        // Copy the peak list row.
        final PeakListRow newRow = new SimplePeakListRow(row.getID());
        PeakUtils.copyPeakListRowProperties(row, newRow);

        // Copy the peaks.
        for (final ChromatographicPeak peak : row.getPeaks()) {

          final ChromatographicPeak newPeak = new SimpleChromatographicPeak(
              peak);
          PeakUtils.copyPeakProperties(peak, newPeak);
          newRow.addPeak(peak.getDataFile(), newPeak);
        }

        newPeakList.addRow(newRow);
      }
    }

    if (!isCanceled()) {

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

        newPeakList.addDescriptionOfAppliedTask(method);
      }

      // Add task description to peakList
      newPeakList
          .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
              "Duplicate peak list rows filter", parameters));
    }

    return newPeakList;
View Full Code Here

    // We assume source peakList contains one datafile
    RawDataFile dataFile = peakList.getRawDataFile(0);

    // Create a new deisotoped peakList
    deisotopedPeakList = new SimplePeakList(peakList + " " + suffix,
        peakList.getRawDataFiles());

    // Collect all selected charge states
    int charges[] = new int[maximumCharge];
    for (int i = 0; i < maximumCharge; i++)
View Full Code Here

      });
      dataFiles.addAll(Arrays.asList(files));
    }

    // Produce new PeakList
    PeakList peakList = new SimplePeakList("Mass Candidates",
        dataFiles.toArray(new RawDataFile[dataFiles.size()]));

    // Start the comparison task to filter and sort the candidate masses
    SpectraMatcherComparisonTask comparisonTask = new SpectraMatcherComparisonTask(
        processingTasks, parameters, massCandidatesByFile, peakList);
View Full Code Here

        return a.getName().compareTo(b.getName());
      }
    });

    // Produce new PeakList
    PeakList peakList = new SimplePeakList(
        "Retention Index Correction Results",
        dataFiles.toArray(new RawDataFile[dataFiles.size()]));

    // Create PeakListRows
    int id = 0;

    for (String name : FameData.FAME_NAMES) {
      PeakListRow row = new SimplePeakListRow(++id);
      row.setComment(name);

      for (FameAlignmentProcessingTask task : processingTasks) {
        if (task.getResults().containsKey(name))
          row.addPeak(task.getResults().get(name).getDataFile(), task
              .getResults().get(name));
      }

      peakList.addRow(row);
    }

    // Add table to the GUI
    ResultsListTableWindow window = new ResultsListTableWindow(peakList);
    MZmineCore.getDesktop().addInternalFrame(window);
View Full Code Here

  private void initializePeakList() {

    RawDataFile[] dataFiles = currentPeakListDataFiles
        .toArray(new RawDataFile[0]);

    buildingPeakList = new SimplePeakList(peakListName, dataFiles);

    for (int i = 0; i < appliedMethods.size(); i++) {
      String methodName = appliedMethods.elementAt(i);
      String methodParams = appliedMethodParameters.elementAt(i);
      PeakListAppliedMethod pam = new SimplePeakListAppliedMethod(
View Full Code Here

    logger.finest("Starting standard compound normalization of "
        + originalPeakList + " using " + normalizationType + " (total "
        + standardRows.length + " standard peaks)");

    // Initialize new alignment result for the normalized result
    normalizedPeakList = new SimplePeakList(
        originalPeakList + " " + suffix,
        originalPeakList.getRawDataFiles());

    // Copy raw data files from original alignment result to new alignment
    // result
View Full Code Here

   *         filtering.
   */
  private PeakList filterPeakListRows(final PeakList peakList) {

    // Create new peak list.
    final PeakList newPeakList = new SimplePeakList(peakList.getName()
        + ' ' + parameters.getParameter(SUFFIX).getValue(),
        peakList.getRawDataFiles());

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

      newPeakList.addDescriptionOfAppliedTask(method);
    }

    // Add task description to peakList.
    newPeakList
        .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
            getTaskDescription(), parameters));

    // Get parameters.
    final boolean identified = parameters.getParameter(HAS_IDENTITIES)
        .getValue();
    final String groupingParameter = (String) parameters.getParameter(
        GROUPSPARAMETER).getValue();
    final int minPresent = parameters.getParameter(MIN_PEAK_COUNT)
        .getValue();
    final int minIsotopePatternSize = parameters.getParameter(
        MIN_ISOTOPE_PATTERN_COUNT).getValue();
    final Range mzRange = parameters.getParameter(MZ_RANGE).getValue();
    final Range rtRange = parameters.getParameter(RT_RANGE).getValue();
    final Range durationRange = parameters.getParameter(PEAK_DURATION)
        .getValue();

    // Filter rows.
    final PeakListRow[] rows = peakList.getRows();
    totalRows = rows.length;
    for (processedRows = 0; !isCanceled() && processedRows < totalRows; processedRows++) {

      final PeakListRow row = rows[processedRows];
      boolean rowIsGood = true;

      // Check number of peaks.
      final int peakCount = getPeakCount(row, groupingParameter);
      if (peakCount < minPresent) {

        rowIsGood = false;
      }

      // Check identities.
      if (identified && row.getPreferredPeakIdentity() == null) {

        rowIsGood = false;
      }

      // Check average m/z.
      if (!mzRange.contains(row.getAverageMZ())) {

        rowIsGood = false;
      }

      // Check average RT.
      if (!rtRange.contains(row.getAverageRT())) {

        rowIsGood = false;
      }

      // Calculate average duration and isotope pattern count.
      int maxIsotopePatternSizeOnRow = 1;
      double avgDuration = 0.0;
      final ChromatographicPeak[] peaks = row.getPeaks();
      for (final ChromatographicPeak p : peaks) {

        final IsotopePattern pattern = p.getIsotopePattern();
        if (pattern != null
            && maxIsotopePatternSizeOnRow < pattern
                .getNumberOfIsotopes()) {

          maxIsotopePatternSizeOnRow = pattern.getNumberOfIsotopes();
        }

        avgDuration += p.getRawDataPointsRTRange().getSize();
      }

      // Check isotope pattern count.
      if (maxIsotopePatternSizeOnRow < minIsotopePatternSize) {

        rowIsGood = false;
      }

      // Check average duration.
      avgDuration /= (double) peakCount;
      if (!durationRange.contains(avgDuration)) {

        rowIsGood = false;
      }

      // Good row?
      if (rowIsGood) {

        newPeakList.addRow(copyPeakRow(row));
      }
    }

    return newPeakList;
  }
View Full Code Here

      peaksTotal = 0;
      for (int i = 0; i < peakList.size(); i++) {
        peaksTotal += peakList.get(i).size();
      }
      alignment = new SimplePeakList(params.getParameter(
          PathAlignerParameters.peakListName).getValue(),
          allDataFiles.toArray(new RawDataFile[0]));

      List<AlignmentPath> addedPaths = getAlignmentPaths();
      int ID = 1;
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.