bin_taxonomy: Bin ASV count table at a specified level of taxonomic...

View source: R/bin_taxonomy.R

bin_taxonomyR Documentation

Bin ASV count table at a specified level of taxonomic classification

Description

This is the primary data formatting function of most bngal pipelines, including the first step of network analysis.

Usage

bin_taxonomy(
  asv.table,
  meta.data,
  tax.level,
  remove.singletons = TRUE,
  cutoff.val,
  direction,
  compositional = TRUE
)

Arguments

asv.table

ASV count table named by Silva-138 L7 taxonomies. Ideally rarefied and quality filtered as necessary, though this script automatically removes singletons in the dataset. First column must be named "sample-id" and must contain unique identifiers.

meta.data

Sample metadata corresponding to asv.table.

tax.level

Level of taxonomic classification at which to calculate relative abundance.

remove.singletons

Optional Drop singleton ASV observations from the dataset. Default = TRUE

cutoff.val

Optional Cutoff value for ASVs that comprise more or less than this fraction of a sample's community (values 0 to 1 accepted). Required if 'direction' specified.

direction

Optional Return binned data 'lessThan' or 'greaterThan' than cutoff.val. Required if 'cutoff.val' specified.

compositional

Optional Determines whether output returns relative abundance (TRUE) or binned count data (FALSE). Default = TRUE.

Examples

# return long-form class-level count data
bin_taxonomy(asv_table, metadata, "class", compositional = FALSE)

# return long-form family-level relative abundance data
bin_taxonomy(asv_table, metadata, "family")


mselensky/bngal documentation built on June 3, 2024, 6:27 a.m.