plot_metric {MetProc} | R Documentation |
Plot Distribution of Metabolite Quality Metrics for Each Split of Data
Description
For a given number of splits of data based on pooled plasma missing rate, calculate the longest run metric (run_metric
) and the correlation metric (corr_metric
) for metabolites in each group. Plot the distribution of these metrics for each group color coding those that exceed thresholds.
Usage
plot_metric(df,ppkey='PPP',sidkey='X',numsplit=5,mincut=.02,maxcut=0.95,
scut=0.5,cor_rates=c(.6,.65,.65,.65,.6),runlengths=c(NA,15,15,15,NA),
histcolors=c('white'))
Arguments
df |
The metabolomics dataset, ideally read from the |
ppkey |
The unique prefix of pooled plasma samples. Default is |
sidkey |
The unique prefix of biological samples. Default is |
numsplit |
The number of equal sized sections to divide metabolites into based on missing rate of pooled plasma columns. Divides the range of missing rates between |
mincut |
A cutoff to specify that any metabolite with pooled plasma missing rate less than or equal to this value should be retained. Default is |
maxcut |
A cutoff to specify that any metabolite with pooled plasma missing rate greater than this value should be removed. Default is |
scut |
The cutoff of missingness to consider a metabolite as having data present in a given biological sample block. Relevant only to |
cor_rates |
A vector of length equal to |
runlengths |
A vector of length equal to |
histcolors |
A vector of length equal to |
Value
Returns histograms showing the correlation metric and longest run metric distributions for each group of the metabolites based on pooled plasma missing rate.
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")
#Plot distributions of the two metrics for each group
plot_metric(metdata,ppkey='PPP',sidkey='X',numsplit=5,mincut=0.02,maxcut=0.95,
scut=0.5,cor_rates=c(.6,.65,.65,.65,.6),runlengths=c(NA,15,15,15,NA),
histcolors=c('red','yellow','green','blue','purple'))