Examples of PeakListRow


Examples of net.sf.mzmine.data.PeakListRow

        double normalizationFactorWeights[] = null;

        if (normalizationType == StandardUsageType.Nearest) {

          // Search for nearest standard
          PeakListRow nearestStandardRow = null;
          double nearestStandardRowDistance = Double.MAX_VALUE;

          for (int standardRowIndex = 0; standardRowIndex < standardRows.length; standardRowIndex++) {
            PeakListRow standardRow = standardRows[standardRowIndex];

            double stdMZ = standardRow.getAverageMZ();
            double stdRT = standardRow.getAverageRT();
            double distance = MZvsRTBalance * Math.abs(mz - stdMZ)
                + Math.abs(rt - stdRT);
            if (distance <= nearestStandardRowDistance) {
              nearestStandardRow = standardRow;
              nearestStandardRowDistance = distance;
            }

          }

          assert nearestStandardRow != null;

          // Calc and store a single normalization factor
          normalizationFactors = new double[1];
          normalizationFactorWeights = new double[1];
          ChromatographicPeak standardPeak = nearestStandardRow
              .getPeak(file);
          if (peakMeasurementType == PeakMeasurementType.HEIGHT) {
            normalizationFactors[0] = standardPeak.getHeight();
          } else {
            normalizationFactors[0] = standardPeak.getArea();
          }
          logger.finest("Normalizing row #" + row.getID()
              + " using standard peak " + standardPeak
              + ", factor " + normalizationFactors[0]);
          normalizationFactorWeights[0] = 1.0f;

        }

        if (normalizationType == StandardUsageType.Weighted) {

          // Add all standards as factors, and use distance as weight
          normalizationFactors = new double[standardRows.length];
          normalizationFactorWeights = new double[standardRows.length];

          for (int standardRowIndex = 0; standardRowIndex < standardRows.length; standardRowIndex++) {
            PeakListRow standardRow = standardRows[standardRowIndex];

            double stdMZ = standardRow.getAverageMZ();
            double stdRT = standardRow.getAverageRT();
            double distance = MZvsRTBalance * Math.abs(mz - stdMZ)
                + Math.abs(rt - stdRT);

            ChromatographicPeak standardPeak = standardRow
                .getPeak(file);
            if (standardPeak == null) {
              // What to do if standard peak is not
              // available? (Currently this is ruled out by the
              // setup dialog, which shows only peaks that are
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

          RansacAlignerParameters.RTToleranceBefore).getValue();
      Range mzRange = mzTolerance.getToleranceRange(row.getAverageMZ());
      Range rtRange = rtTolerance.getToleranceRange(row.getAverageRT());

      // Get all rows of the aligned peaklist within parameter limits
      PeakListRow candidateRows[] = peakListY
          .getRowsInsideScanAndMZRange(rtRange, mzRange);

      for (PeakListRow candidateRow : candidateRows) {
        if (file == null || file2 == null) {
          alignMol.addElement(new AlignStructMol(row, candidateRow));
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

  @Override
  public ExitCode showSetupDialog() {

    PeakList selectedPeakList[] = getParameter(peakList).getValue();
    PeakListRow rowChoices[];
    if (selectedPeakList.length == 1) {
      rowChoices = selectedPeakList[0].getRows();
    } else {
      rowChoices = new PeakListRow[0];
    }
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

      PeakListRow base, List<List<PeakListRow>> listOfPeaksInFiles) {
    int len = listOfPeaksInFiles.size();
    AlignmentPath path = new AlignmentPath(len, base, col);
    for (int i = (col + 1) % len; i != col; i = (i + 1) % len) {

      PeakListRow bestPeak = null;
      double bestPeakScore = c.getWorstScore();
      for (PeakListRow curPeak : listOfPeaksInFiles.get(i)) {
        if (curPeak == null || !c.matches(path, curPeak, params)) {
          // Either there isn't any peak left or it doesn't fill
          // requirements of current score calculator (for example,
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

  }

  private void removePeaks(AlignmentPath p,
      List<List<PeakListRow>> listOfPeaks) {
    for (int i = 0; i < p.length(); i++) {
      PeakListRow d = p.getPeak(i);
      if (d != null) {
        listOfPeaks.get(i).remove(d);
      }
    }
  }
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

      int ID = 1;
      for (AlignmentPath p : addedPaths) {
        // Convert alignments to original order of files and add them to
        // final
        // Alignment data structure
        PeakListRow row = (PeakListRow) p.convertToAlignmentRow(ID++);
        alignment.addRow(row);

      }
    }
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

    for (PeakList peakList : peakLists) {

      HashMap<PeakListRow, PeakListRow> alignmentMapping = this
          .getAlignmentMap(peakList);

      PeakListRow allRows[] = peakList.getRows();

      // Align all rows using mapping
      for (PeakListRow row : allRows) {
        PeakListRow targetRow = alignmentMapping.get(row);

        // If we have no mapping for this row, add a new one
        if (targetRow == null) {
          targetRow = new SimplePeakListRow(newRowID);
          newRowID++;
          alignedPeakList.addRow(targetRow);
        }

        // Add all peaks from the original row to the aligned row
        for (RawDataFile file : row.getRawDataFiles()) {
          targetRow.addPeak(file, row.getPeak(file));
        }

        // Add all non-existing identities from the original row to the
        // aligned row
        PeakUtils.copyPeakListRowProperties(row, targetRow);
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

    // RANSAC algorithm
    List<AlignStructMol> list = ransacPeakLists(alignedPeakList, peakList);
    PolynomialFunction function = this.getPolynomialFunction(list);

    PeakListRow allRows[] = peakList.getRows();

    for (PeakListRow row : allRows) {
      // Calculate limits for a row with which the row can be aligned
      Range mzRange = mzTolerance.getToleranceRange(row.getAverageMZ());

      double rt;
      try {
        rt = function.value(row.getAverageRT());
      } catch (NullPointerException e) {
        rt = row.getAverageRT();
      }
      if (Double.isNaN(rt) || rt == -1) {
        rt = row.getAverageRT();
      }

      Range rtRange = rtToleranceAfter.getToleranceRange(rt);

      // Get all rows of the aligned peaklist within parameter limits
      PeakListRow candidateRows[] = alignedPeakList
          .getRowsInsideScanAndMZRange(rtRange, mzRange);

      for (PeakListRow candidate : candidateRows) {
        RowVsRowScore score;
        if (sameChargeRequired
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

      Range mzRange = mzTolerance.getToleranceRange(row.getAverageMZ());
      Range rtRange = rtToleranceBefore.getToleranceRange(row
          .getAverageRT());

      // Get all rows of the aligned peaklist within parameter limits
      PeakListRow candidateRows[] = peakListY
          .getRowsInsideScanAndMZRange(rtRange, mzRange);

      for (PeakListRow candidateRow : candidateRows) {
        alignMol.add(new AlignStructMol(row, candidateRow));
      }
View Full Code Here

Examples of net.sf.mzmine.data.PeakListRow

      oldPeak = sortedPeaks[ind];

      if (oldPeak.getHeight() >= minimumHeight) {
        ChromatographicPeak newPeak = this.getExtendedPeak(oldPeak);
        // Get previous pekaListRow
        PeakListRow oldRow = peakList.getPeakRow(oldPeak);

        // keep old ID
        int oldID = oldRow.getID();
        SimplePeakListRow newRow = new SimplePeakListRow(oldID);
        PeakUtils.copyPeakListRowProperties(oldRow, newRow);
        newRow.addPeak(dataFile, newPeak);
        extendedPeakList.addRow(newRow);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.