accu_samp_threshold: Compute the number of sequence to obtain a given proportion...

View source: R/plot_functions.R

accu_samp_thresholdR Documentation

Compute the number of sequence to obtain a given proportion of ASV in accumulation curves

Description

lifecycle-experimental

Note that as most bioinformatic pipeline discard singleton, accumulation curves from metabarcoding cannot be interpreted in the same way as with conventional biodiversity sampling techniques.

Usage

accu_samp_threshold(res_accuplot, threshold = 0.95)

Arguments

res_accuplot

the result of the function accu_plot()

threshold

the proportion of ASV to obtain in each samples

Value

a value for each sample of the number of sequences needed to obtain threshold proportion of the ASV

Author(s)

Adrien Taudière

See Also

accu_plot()

Examples


data("GlobalPatterns", package = "phyloseq")
GP <- subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
GP <- rarefy_even_depth(subset_samples_pq(GP, sample_sums(GP) > 3000))
p <- accu_plot(GP, "SampleType", add_nb_seq = TRUE, by.fact = TRUE, step = 10)

val_threshold <- accu_samp_threshold(p)

summary(val_threshold)

##'  Plot the number of sequences needed to accumulate 0.95% of ASV in 50%, 75%
##'  and 100% of samples
p + geom_vline(xintercept = quantile(val_threshold, probs = c(0.50, 0.75, 1)))


adrientaudiere/MiscMetabar documentation built on Oct. 13, 2024, 9:42 p.m.