aggregateASV: Aggregate ASVs to putative species

View source: R/aggregateASV.r

aggregateASVR Documentation

Aggregate ASVs to putative species

Description

Several ASVs will be assigned to same species name. This function aggregates ASVs according to a variable (species name, accession number etc) Caution be sure than only aggregate relieable species assignments.

Usage

aggregateASV(x, by, other_str, other_num)

Arguments

x

the columns containing number of reads

by

The grouping variable

other

Columns containing classification or other valuable information

Author(s)

Pedro Martinez Arbizu

See Also

taxFromWorms

Examples

data(deepMeio)
# grade >= 97 will give an indication of good species assignment
grade <- ((deepMeio$pident) + 2*(deepMeio$qcovs))/3
shortMeio <- deepMeio[grade>= 97,]
# grade > 97 will give an indication of good species assignment
# retrieve classification from WORMS
tax_deepMeio <- taxFromWorms(shortMeio$Species)

# aggregate ASVs  
agg_tax_deepMeio <- aggregateASV(x=shortMeio[,9:ncol(shortMeio)], by=shortMeio$Species,other_str=tax_deepMeio[,2:6],other_num=shortMeio[,2:5])

agg_tax_deepMeio_2 <- aggregateASV(x=shortMeio[,9:ncol(shortMeio)], by=shortMeio$Species,other_num=shortMeio[,2:5])


pmartinezarbizu/dada2pp documentation built on Feb. 7, 2024, 7:01 a.m.