Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.PeakListRow


  static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);

  public Component getListCellRendererComponent(JList combo, Object value,
      int index, boolean isSelected, boolean cellHasFocus) {

    PeakListRow row = (PeakListRow) value;
    if (row == null)
      return new JPanel();
    ChromatographicPeak peak = row.getPeaks()[0];

    String labelText = "#"
        + row.getID()
        + " "
        + MZmineCore.getConfiguration().getMZFormat()
            .format(row.getAverageMZ()) + " m/z ";
    JLabel textComponent = new JLabel(labelText);
    textComponent.setFont(combo.getFont());

    PeakXICComponent shapeComponent = new PeakXICComponent(peak);
    shapeComponent.setBorder(null);
View Full Code Here


    setStatus(TaskStatus.PROCESSING);

    logger.info("Starting glycerophospholipid search in " + peakList);

    PeakListRow rows[] = peakList.getRows();

    // Calculate how many possible lipids we will try
    totalSteps = selectedLipids.length * (maxChainLength + 1)
        * (maxDoubleBonds + 1) * (maxChainLength + 1)
        * (maxDoubleBonds + 1);
View Full Code Here

      errorMessage = "Error connecting to the SQL database: "
          + e.toString();
      return;
    }

    PeakListRow rows[] = peakList.getRows();

    try {
      for (PeakListRow row : rows) {
        if (getStatus() != TaskStatus.PROCESSING)
          break;
View Full Code Here

    // Loop through all peak list rows
    processedRows = 0;
    totalRows = rowCount;
    for (int firstRowIndex = 0; !isCanceled() && firstRowIndex < rowCount; firstRowIndex++) {

      final PeakListRow firstRow = peakListRows[firstRowIndex];
      if (firstRow != null) {

        for (int secondRowIndex = firstRowIndex + 1; !isCanceled()
            && secondRowIndex < rowCount; secondRowIndex++) {

          final PeakListRow secondRow = peakListRows[secondRowIndex];
          if (secondRow != null) {

            // Compare identifications
            final boolean sameID = !requireSameId
                || PeakUtils.compareIdentities(firstRow,
                    secondRow);

            // Compare m/z
            final boolean sameMZ = mzTolerance.getToleranceRange(
                firstRow.getAverageMZ()).contains(
                secondRow.getAverageMZ());

            // Compare rt
            final boolean sameRT = rtTolerance.getToleranceRange(
                firstRow.getAverageRT()).contains(
                secondRow.getAverageRT());

            // Duplicate peaks?
            if (sameID && sameMZ && sameRT) {

              peakListRows[secondRowIndex] = null;
            }
          }
        }
      }

      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);
      }
    }
View Full Code Here

          bestFitPeaks = fittedPeaks;
        }

      }

      PeakListRow oldRow = peakList.getPeakRow(aPeak);

      assert bestFitPeaks != null;

      // Verify the number of detected isotopes. If there is only one
      // isotope, we skip this left the original peak in the peak list.
      if (bestFitPeaks.size() == 1) {
        deisotopedPeakList.addRow(oldRow);
        processedPeaks++;
        continue;
      }

      // Convert the peak pattern to array
      ChromatographicPeak originalPeaks[] = bestFitPeaks
          .toArray(new ChromatographicPeak[0]);

      // Create a new SimpleIsotopePattern
      DataPoint isotopes[] = new DataPoint[bestFitPeaks.size()];
      for (int i = 0; i < isotopes.length; i++) {
        ChromatographicPeak p = originalPeaks[i];
        isotopes[i] = new SimpleDataPoint(p.getMZ(), p.getHeight());

      }
      SimpleIsotopePattern newPattern = new SimpleIsotopePattern(
          isotopes, IsotopePatternStatus.DETECTED, aPeak.toString());

      // Depending on user's choice, we leave either the most intenst, or
      // the lowest m/z peak
      if (chooseMostIntense) {
        Arrays.sort(originalPeaks, new PeakSorter(
            SortingProperty.Height, SortingDirection.Descending));
      } else {
        Arrays.sort(originalPeaks, new PeakSorter(SortingProperty.MZ,
            SortingDirection.Ascending));
      }

      ChromatographicPeak newPeak = new SimpleChromatographicPeak(
          originalPeaks[0]);
      newPeak.setIsotopePattern(newPattern);
      newPeak.setCharge(bestFitCharge);

      // Keep old ID
      int oldID = oldRow.getID();
      SimplePeakListRow newRow = new SimplePeakListRow(oldID);
      PeakUtils.copyPeakListRowProperties(oldRow, newRow);
      newRow.addPeak(dataFile, newPeak);
      deisotopedPeakList.addRow(newRow);
View Full Code Here

  }

  public boolean containsSame(AlignmentPath anotherPath) {
    boolean same = false;
    for (int i = 0; i < peaks.length; i++) {
      PeakListRow d = peaks[i];
      if (d != null) {
        same = d.equals(anotherPath.peaks[i]);
      }
      if (same) {
        break;
      }
    }
View Full Code Here

  public int length() {
    return peaks.length;
  }

  public PeakListRow convertToAlignmentRow(int ID) {
    PeakListRow newRow = new SimplePeakListRow(ID);
    try {
      for (PeakListRow row : this.peaks) {
        if (row != null) {
          for (ChromatographicPeak peak : row.getPeaks()) {
            newRow.addPeak(peak.getDataFile(), peak);
          }
        }
      }
    } catch (NullPointerException e) {
      e.printStackTrace();
View Full Code Here

    // 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);
    }
View Full Code Here

    // Create PeakList
    int id = 0;

    for (Double averageRT : matchedCandidates.keySet()) {
      List<MassCandidate> masses = matchedCandidates.get(averageRT);
      PeakListRow row = new SimplePeakListRow(id++);

      for (MassCandidate m : masses)
        row.addPeak(m.getDataFile(), m);

      peakList.addRow(row);
    }

    MZmineCore.getCurrentProject().addPeakList(peakList);
View Full Code Here

      hd.endElement("", "", PeakListElementName.RAWFILE.getElementName());
    }

    // <ROW>
    PeakListRow row;
    for (int i = 0; i < numberOfRows; i++) {

      if (canceled)
        return;

      atts.clear();
      row = peakList.getRow(i);
      atts.addAttribute("", "", PeakListElementName.ID.getElementName(),
          "CDATA", String.valueOf(row.getID()));
      if (row.getComment() != null) {
        atts.addAttribute("", "",
            PeakListElementName.COMMENT.getElementName(), "CDATA",
            row.getComment());
      }

      hd.startElement("", "", PeakListElementName.ROW.getElementName(),
          atts);
      fillRowElement(row, hd);
View Full Code Here

TOP

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

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.