Search in sources :

Example 1 with RTTolerance

use of net.sf.mzmine.parameters.parametertypes.tolerances.RTTolerance in project mzmine2 by mzmine.

the class RansacAlignerSetupDialog method getVectorAlignment.

/**
 * Create the vector which contains all the possible aligned peaks.
 *
 * @return vector which contains all the possible aligned peaks.
 */
private Vector<AlignStructMol> getVectorAlignment(PeakList peakListX, PeakList peakListY, RawDataFile file, RawDataFile file2) {
    Vector<AlignStructMol> alignMol = new Vector<AlignStructMol>();
    for (PeakListRow row : peakListX.getRows()) {
        // Calculate limits for a row with which the row can be aligned
        MZTolerance mzTolerance = super.parameterSet.getParameter(RansacAlignerParameters.MZTolerance).getValue();
        RTTolerance rtTolerance = super.parameterSet.getParameter(RansacAlignerParameters.RTToleranceBefore).getValue();
        Range<Double> mzRange = mzTolerance.getToleranceRange(row.getAverageMZ());
        Range<Double> 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));
            } else {
                if (candidateRow.getPeak(file2) != null) {
                    alignMol.addElement(new AlignStructMol(row, candidateRow, file, file2));
                }
            }
        }
    }
    return alignMol;
}
Also used : MZTolerance(net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) RTTolerance(net.sf.mzmine.parameters.parametertypes.tolerances.RTTolerance) Vector(java.util.Vector)

Aggregations

Vector (java.util.Vector)1 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)1 MZTolerance (net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance)1 RTTolerance (net.sf.mzmine.parameters.parametertypes.tolerances.RTTolerance)1