Build Sankey node/link data from a CAMERA annotation result
Source:R/camera_plots.R
camera_sankey_data.RdExtracts the peak list from a CAMERA xsAnnotate result and builds
the node/link tables needed to draw a four-column Sankey diagram showing
how annotated peaks flow through isotope type, multiplicity, and adduct rule.
Arguments
- cam_result
An
xsAnnotateobject returned byCAMERA::findAdducts(). The rules used during annotation are read fromcam_result@ruleset.
Value
A list with two data frames:
nodesColumns
label,x,y.linksColumns
source,target,value(0-indexed node indices, as required by plotly).
Details
The four columns are:
All annotations — every annotated peak.
Isotope type —
no isotope annotation,[M],[M+1],[M+2], ... Satellite peaks ([M+1]etc.\ without an adduct match) terminate here.Multiplicity —
[1M],[2M], ...Adduct rule — the matched rule name, ordered by frequency.
Author
Jan Stanstrup, stanstrup@gmail.com