heatmap_res {MetProc} | R Documentation |
Plot Patterns of Missing Data Across Metabolites
Description
Generates a heatmap to show patterns of missing data for metabolites. Useful to visualize the block structure of data to compare differences between removed metabolites and retained metabolites.
Usage
heatmap_res(df, ppkey = "PPP", sidkey = "X", missratecut = .01,title)
Arguments
df |
The metabolomics dataset, ideally read from the |
ppkey |
Unique prefix of pooled plasma columns. Default is |
sidkey |
Unique prefix of biological sample columns. Default is |
missratecut |
The missing rate limit for displaying a metabolite. Only metabolites with overall missing rates equal to or greater than this cutoff will be plotted. Useful for avoiding plotting too many metabolites as the heatmap generation can be an expensive computation. If a metabolite has a very small missing rate, plotting is uninformative as all data is present. Default set to |
title |
The title of the heatmap plotted |
Value
Returns a heatmap illustrating the patterns of missing data for metabolites.
See Also
See MetProc-package
for examples of running the full process.
Examples
library(MetProc)
#Read in metabolomics data
metdata <- read.met(system.file("extdata/sampledata.csv", package="MetProc"),
headrow=3, metidcol=1, fvalue=8, sep=",", ppkey="PPP", ippkey="BPP")
#Get the good versus bad metabolites
results <- met_proc(metdata)
#Plot Removed metabolites
#Similarly run for retained metabolites but
#replacing 'remove' with 'keep'
heatmap_res(results[['remove']],missratecut=.02,title='Removed Metabolites')