corr_metric {MetProc} | R Documentation |
Calculate Correlation of Missing Rates between Pooled Plasma and Biological Samples
Description
Calculates the correlation of missing rates between the two flanking pooled plasma samples and intervening biological samples for each block in the injection order. A block is defined as a set of biological samples and their flanking pooled plasma samples. See sampledata
for an example of the data format and block structure. Requires 2 arguments as input: 1. The metabolomics dataset formatted from the read.met
function and 2. A list of 2 elements output from the get_group
function containing column indices of pooled plasma samples and biological samples, respectively. If either pooled plasma or biological samples are entirely absent or entirely present, the function will return NA for the metric of that metabolite as the standard deviation of a vector will be 0.
Usage
corr_metric(df, grps)
Arguments
df |
The metabolomics dataset, ideally read from the |
grps |
A list of 2 elements from the |
Value
Returns a vector of equal length to the number of rows in df
(representing metabolites) with the correlation of missing rates between flanking pooled plasma and intervening biological samples across all blocks.
See Also
See MetProc-package
for examples of running the full process.
Examples
library(MetProc)
#Read metabolomics data
metdata <- read.met(system.file("extdata/sampledata.csv", package="MetProc"),
headrow=3, metidcol=1, fvalue=8, sep=",", ppkey="PPP", ippkey="BPP")
#Get indices of samples and pooled plasma
grps <- get_group(metdata,'PPP','X')
#get correlation metrics of metabolites
corrs <- corr_metric(metdata,grps)