MockCommunity: Apply a cut-off based on Mock Community sequencing results

MockCommunityR Documentation

Apply a cut-off based on Mock Community sequencing results

Description

This function reads an OTU table in a specific format and remove those ASV which represent less than a calculated percentage of sequences. This percentage is calculated based on MOCK community members (more information in details).

Usage

MockCommunity(data, MOCK_composition, ASV_column, choose.first = FALSE)

Arguments

data

a data frame, rows corresponding to OTUs and columns to classification, followed by sample composition. MOCK community samples should include the word MOCK in their names.

MOCK_composition

a data frame containing classification for the MOCK community, usually provided by the company. The first column is the one to be used by the function, corresponding to genus level.

ASV_column

name of the column in data where ASV or OTU names are stored.

choose.first

whether to choose first spurious ASV found to calculate the percentage or not. Default is FALSE.

Details

This function is supposed to be used in the following situation. Imagine a metabarcoding experiment for the study of microbial communities. In the same run, some samples of a commercial MOCK community are analysed. Then, they are processed at bioinformatic level, alongside the main experiment samples. The MOCK community results are analyzed through this function, comparing its composition with the real composition (known design or provided by the company). When a microorganism is found that should not be in the MOCK community, it is attributed to sequencing errors. Based on the abundance of this microorganism (ASV or OTU), the function calculates the percentage of sequences that it represents to the total of the MOCK community samples. This percentage is used as a cut-off for the main experiment samples, where ASVs or OTUs representing less than this percentage are removed.

Value

Returns a data frame with the same structure as data, but with a cut-off applied based on MOCK community information and with MOCK samples removed.

Examples


ASV_table_cleaned <- MockCommunity(ASV_table_classified_raw, mock_composition, "ASV_names",
choose.first=TRUE)


nuriamw/micro4all documentation built on May 2, 2024, 9:18 a.m.