API align Module

MZ Alignment

emzed.align.mzAlign(table, mz_reference_table, tol=0.015, destination=None, minR2=0.95, maxTol=0.001, minPoints=5, interactive=False)[source]

performs affine linear mz-correction for a feature table.

and retention times of known metabolites. This table needs columns mz_calc for the mz value calculated from the mass of the isotope, rtmin, rtmax for the retention time window where the peak is expected to elute from the column in order to restrict the match of the table against the ``mz_reference_table`.

destination is a directory which will be used for storing the result and intermediate data. If you do not specify this value, a dialog for choosing the destination directory will be opened.

The input table is not modified in place, the function returns the aligned table.

the parameter tol is related to find matching peaks, maxTol and minR2 determine stop criterion when removing outlier points in non interactive mode.

RT Alignment

For an example see Aligning Features

emzed.align.rtAlign(tables, refTable=None, destination=None, nPeaks=-1, numBreakpoints=5, maxRtDifference=100, maxMzDifference=0.3, maxMzDifferencePairfinder=0.5, forceAlign=False, resetIntegration=False)[source]

aligns feature tables in respect to retention times. the algorithm produces new tables with aligned data. input tables including the assiciatoted peakmap(s) are not modified.


  • nPeaks: max number of peaks matched by superimposer, -1 means: all peaks
  • maxRtDifference: max allowed difference in rt values for searching matching features.
  • maxMzDifference: max allowed difference in mz values for super imposer.
  • maxMzDifferencePairfinder: max allowed difference in mz values for pair finding.
  • numBreakpoints: number of break points of fitted spline. default:5, more points result in splines with higher variation.
  • forceAlign: has to be True to align already rt aligned tables.
  • refTable: extra reference table, if None the table with most features among tables is taken.