emzed.annotate¶
annotate_adducts(peaks, adducts, mz_tol, rt_tol, explained_abundance=0.2)
¶
Annotate peaks with adduct hypotheses that are mutually consistent.
The algorithm generates adduct and adduct-isotope hypotheses for each input peak, converts each hypothesis into an inferred neutral mass, and then links hypotheses that agree in both retention time and inferred neutral mass. Connected components of that hypothesis graph are reported as adduct clusters.
Input rows must provide mz and rt. Other columns are preserved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
peaks
|
input peak table containing at least |
required | |
adducts
|
adduct-definition table, typically from |
required | |
mz_tol
|
tolerance used when comparing inferred neutral masses
( |
required | |
rt_tol
|
tolerance used when comparing retention times and for partitioning the peak table into RT windows. |
required | |
explained_abundance
|
cumulative theoretical isotope abundance to
include when generating centroids for the
adduct addition/subtraction formulas. For
example, |
0.2
|
Returns:
| Type | Description |
|---|---|
|
table with the original peak rows plus annotation columns:
Notes:
- Peaks are compared in inferred neutral-mass space, not by direct m/z
matching alone.
- |