get_alphaindex: alpha index

Description Usage Arguments Value Author(s) Examples

Description

calculate the alpha index (Obseve,Chao1,Shannon,Simpson) of sample with diversity

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
get_alphaindex(obj, ...)

## S4 method for signature 'matrix'
get_alphaindex(obj, mindepth, sampleda, ...)

## S4 method for signature 'data.frame'
get_alphaindex(obj, ...)

## S4 method for signature 'integer'
get_alphaindex(obj, ...)

## S4 method for signature 'numeric'
get_alphaindex(obj, ...)

## S4 method for signature 'phyloseq'
get_alphaindex(obj, ...)

Arguments

obj

object, data.frame of (nrow sample * ncol taxonomy(feature)) or phyloseq.

...

additional arguments.

mindepth

numeric, Subsample size for rarefying community.

sampleda

data.frame,sample information, row sample * column factors.

Value

data.frame contained alpha Index.

Author(s)

Shuangbin Xu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(tidyverse)
otudafile <- system.file("extdata", "otu_tax_table.txt", 
                        package="MicrobiotaProcess")
otuda <- read.table(otudafile, sep="\t", 
             header=TRUE, row.names=1, 
             check.names=FALSE, skip=1, comment.char="")
otuda <- otuda[sapply(otuda, is.numeric)] %>% t() %>% 
          data.frame(check.names=FALSE)
set.seed(1024)
alphatab <- get_alphaindex(otuda)
head(as.data.frame(alphatab))
data(test_otu_data)
class(test_otu_data)
set.seed(1024)
alphatab2 <- get_alphaindex(test_otu_data)
head(as.data.frame(alphatab2))

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.