emzed.align package¶
Submodules¶
Module contents¶
- emzed.align.align_peaks(tables, mz_tol, rt_tol)[source]¶
Assigns global peak ids over samples sucht that peaks which differ by given tolerances are are assigned to the sampe global peak id.
Tables are modified in-place by adding a new columns
global_peak_id
.- Parameters:
tables – list or tuple of peak tables with columns “id”, “mz” and “rt” at least.
mz_tol – mz tolerance in Da.
rt_tol – rt tolerance in seconds.
- Returns:
None
- emzed.align.mz_align(table, reference_table, tol=0.015, destination=None, min_r2=0.95, max_tol=0.001, min_points=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 thereference_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, max_tol and min_r2 determine stop criterion when removing outlier points in non interactive mode.
- emzed.align.rt_align(tables, reference_table=None, destination=None, reset_integration=False, n_peaks=-1, max_rt_difference=100, max_mz_difference=0.3, max_mz_difference_pair_finder=0.5, model='b_spline', **model_parameters)[source]¶
aligns feature tables in respect to retention times. the algorithm returns new tables with aligned data.
- Parameters:
reference_table – extra reference table, if None the table with most features among tables is taken.
destination – target folder for quality plots. If this value is None no plots will be created.
reset_integration – sets integration related column names to None if present. Else the alignment will fail for already integrated tables.
n_peaks – max number of peaks matched by superimposer, -1 means: all peaks, can be float between 0 and 1 to refer to fraction of peaks in reference table.
max_rt_difference – max allowed difference in rt values for searching matching features.
max_mz_difference – max allowed difference in mz values for super imposer.
max_mz_difference_pair_finder – max allowed difference in mz values for pair finding.
model – can be “b_spline” or “lowess”
model_parameters –
key word parameters depending on provided value for ‘model’. For ‘b_spline’ the user can set
- num_nodes: number of break points of fitted spline.
default:5, more points result in splines with higher variation.
For ‘lowess’ the parameters are:
- span: value between 0 and 1, larger values lead to more smoothing.
default is 2/3.
interpolation_type: either “cspline” or “linear”
- Returns:
aligned peak tables.