getStackedTaxaMatrix: Obtained the stacked-taxa table

View source: R/moduleRelated.r

getStackedTaxaMatrixR Documentation

Obtained the stacked-taxa table

Description

Generate the stacked-taxa tabel for other correlation methods calculation outside C3NA.

Usage

getStackedTaxaMatrix(
  prevTrh = 0.1,
  phyloseqObj = phyloseqObj,
  nMinTotalCount = 1000,
  phenotype = NA
)

Arguments

prevTrh

(Required) Prevalence threshold of the samples, which is a number between 0 and 1. E.g., the default 0.1 represents 10% of the samples need to have given taxa.

phyloseqObj

(Required) Phyloseq phyloseq object. This should first undergo validatePhyloseq to ensure the diagnosis column are present.

nMinTotalCount

(Required) The Minimal number of reads per sample. Default: 1,000.

phenotype

(Required) The desired phenotype that present under the diagnosis column in the metadata from phyloseqObj

Value

countMatrix

Examples

data(CRC_Phyloseq)
curPhyloseq = validatePhloseq(phyloseqObj = CRC_Phyloseq)

# These steps are commented out due to time consuming step. The post sparcc correlation data will be 
# to avoid the step
# phyloseq_Cancer = phyloseq::subset_samples(physeq = CRC_Phyloseq, diagnosis == "Cancer")
# stackedTaxaMatrix = getStackedTaxaMatrix(phyloseqObj = phyloseq_Cancer, phenotype = "Cancer")

# Correlation method
# testCorMatrix = cor(t(stackedTaxaMatrix))

zhouLabNCSU/C3NA documentation built on Oct. 10, 2022, 4:43 a.m.