decon.diff: Calculates summary statistics for results of decontamination

View source: R/decon.diff.R

decon.diffR Documentation

Calculates summary statistics for results of decontamination

Description

Takes your original data and decontaminated data and returns summary statistics such as the reads removed for each OTU and sample ($reads.removed), mean reads removed for each group and all samples ($difference.mean), sum of reads removed for each group and all samples ($difference.sum), IDs of OTUs that were totally removed from at least one group ($OTUs.removed), and the decontaminated data frame after removing any OTUs that were entirely contamination ($decon.table).

Usage

decon.diff(data, output, numb.blanks = 1, numb.ind, taxa = T)

Arguments

data

The original data frame that you input into remove.cont(). Individuals must have been ordered by groups (populations, species, etc.) as in remove.thresh().

output

The data frame that was returned by remove.cont() or remove.thresh().

numb.blanks

Numeric (default = 1). Specifies the number of blanks included in the “data” argument (if multiple blanks are included, they must be in consecutive columns, starting with column 2). This only applies to the number in the data argument. The number in the output argument will always be 1 because remove.cont() returns a single mean blank.

numb.ind

A vector of numbers listing the number of individuals in each user-specified group (e.g., different populations could be treated as different groups). Data must have been sorted by these groups before running remove.cont().

taxa

Logical (T/F). Specifies whether or not the last column contains taxonomic information (default = T).

Value

A list of five data frames that can be accessed with $. These are useful for both seeing and recording the changes microDecon made, as well as checking that the changes make sense based on the biological understanding of the system under study.

NA values indicate that an OTU had zero reads for a given group or sample prior to decontamination.

$decon.table = A data frame of decontaminated OTU data. It is structured the same as the original data frame (data). However, if several blanks were input, the output will include only a single Mean.blank column that is the mean of the proportions of those blanks multiplied by the mean number of reads in the blanks. Additionally, the order of the rows may be different, and any OTUs for which all reads were removed will have been deleted (their information will still be shown in the other outputs).

$reads.removed = An OTU table showing the number of reads that were removed from each OTU that amplified in the blank (per individual).

$difference.sum = The total number of reads that were removed from each OTU that amplified in the blank (per group as well as for the entire data set; groups are in the same order as specified by the numb.ind argument).

$difference.mean = The average number of reads that were removed from each OTU that amplified in the blank (per group as well as for the entire data set; groups are in the same order as specified by the numb.ind argument).

$OTUs.removed = A data frame showing the identities of OTUs that were completely removed from either particular groups or the entire data set.


donaldtmcknight/microDecon documentation built on Oct. 23, 2023, 10:57 a.m.