MbecData: Define MbecData-class

Description Usage Arguments Details Value Slots Examples

View source: R/mbecs_classes.R

Description

An extension of phyloseq-class that contains the additional attributes 'tss', 'clr', 'corrections' and 'assessments' to enable the MBECS functionality.

Constructor for the package class MbecData. Minimum input is an abundance matrix for the argument 'cnt_table' and any type of frame that contains columns of covariate information. The argument 'cnt_table' requires col/row- names that correspond to features and samples. The correct orientation will be handled internally. The argument 'meta_data' requires row-names that correspond to samples. Although it is an exported function, the user should utilize the function 'mbecProcessInput()' for safe initialization of an MbecData-object from phyloseq or list(counts, metadata) inputs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MbecData(
  cnt_table = NULL,
  meta_data = NULL,
  tax_table = NULL,
  phy_tree = NULL,
  refseq = NULL,
  assessments = list(),
  corrections = list(),
  tss = NULL,
  clr = NULL
)

MbecData(
  cnt_table = NULL,
  meta_data = NULL,
  tax_table = NULL,
  phy_tree = NULL,
  refseq = NULL,
  assessments = list(),
  corrections = list(),
  tss = NULL,
  clr = NULL
)

Arguments

cnt_table

either class phyloseq or a matrix of counts

meta_data

A table with covariate information, whose row-names correspond to sample-IDs

tax_table

taxonomic table from phyloseq as optional input

phy_tree

phylogenetic tree as optional input

refseq

reference sequences as optional input

assessments

A list for the results of BEAAs.

corrections

A list for the results of BECAs.

tss

Total-sum-squared features matrix.

clr

Cumulative log-ratio transformed feature matrix.

Details

Additional (OPTIONAL) arguments are 'tax_table', 'phy_tree' and 'ref_seq' from phyloseq-objects.

The (OPTIONAL) arguments 'tss' and 'clr' are feature abundance matrices that should contain total-sum-scaled or cumulative log-ratio transformed counts respectively. They should however be calculated by the package-function 'mbecTransform()'.

The lists for Assessments and Corrections will be initialized empty and should only be accessed via the available Get/Set-functions.

Value

produces an R-object of type MbecData

Slots

otu_table

Class phyloseq::otu_table, (usually sparse) matrix of abundance values.

sample_data

Dataframe of covariate variables.

tax_table

Taxonomic table from phyloseq as optional input

phy_tree

Phylogenetic tree as optional input

refseq

Reference sequences as optional input

assessments

A list for the results of batch effect assessment algorithms (BEAA) that produce p-values for all features.

corrections

A list for the results of batch effect correction algorithms (BECA) that produce adjusted abundance matrices.

tss

Total-sum-squared feature abundance matrix.

clr

Cumulative log-ratio transformed feature abundance matrix.

Examples

1
2
3
4
5
6
# use constructor with default parameters to create object from count-matrix
# and meta-data table.
mbec.obj <- MbecData(cnt_table=dummy.list$cnts, meta_data = dummy.list$meta)
# use constructor with default parameters to create object from count-matrix
# and meta-data table.
mbec.obj <- MbecData(cnt_table=dummy.list$cnts, meta_data = dummy.list$meta)

buschlab/MBECS documentation built on Jan. 21, 2022, 1:27 a.m.