nc.score: nc.score

nc.scoreR Documentation

nc.score

Description

nc.score calculates species-level co-variation and co-exclusion patterns based on an extension of the checkerboard score to ordinal data.

It is an extension to Diamond's checkerboard score (See references below) to ordinal data and implements a framework for robust detection of species-level association patterns in metagenomic data.

Usage

nc.score(x,
 y = NULL,
 use = "everything",
 nbins = NULL,
 bin.cutoffs = NULL
)

Arguments

x

A numeric vector, data frame, or matrix. The first entity to be processed. Columns are bugs, rows are samples.

y

NULL(default) or a numeric vector, data frame, or matrix with compatible dimensions to x. Columns are features, rows are samples.

use

An optional character string givinga method for computing covariances in the presence of missing values. This must be (an abbreviaion of) on of the strings "everything", "all.obs", "complete.obs","na.or.complete", or "pairwise.complete.obs".

nbins

A non-negative integer of the number of bins to generate (cutoffs will be generated by the discretize function from the infotheo package).

bin.cutoffs

A list of values demarcating the bin cutoffs. The binning is performed using the findInterval function.

Value

Matrix or vector of normalized scores.

Author(s)

Craig Bielski<craig.bielski@gmail.com>

References

Emma Schwager and Colleagues. Detecting statistically significant associtations between sparse and high dimensional compositioanl data. In Progress.

Examples

data <- matrix(rlnorm(40,meanlog=0,sdlog=1),nrow=10)
data.rowsum <- apply(data,1,sum)
data.norm <- data/data.rowsum
testdata <- data.norm
dimnames(testdata) <- list(paste("Sample",seq(1,10)),paste("Feature",seq(1,4)))

nc.score.results <- nc.score( x=testdata )
nc.score.results.bins <- nc.score( x=testdata  )
nc.score.results.bin.cutoffs <- nc.score( x=testdata  )
nc.score.results
nc.score.results.bins
nc.score.results.bin.cutoffs

AlmaasLab/micInt documentation built on April 1, 2022, 10:37 a.m.