co_occurrence: Pair-wise Spearman rank co-occurrence.

View source: R/co_occurrence.R

co_occurrenceR Documentation

Pair-wise Spearman rank co-occurrence.

Description

A rewrite of the pair-wise Spearman rank co-occurrence routine written by Jin Choi. The routine has been adapted to integrate with the Rcpp-package API.

Usage

co_occurrence(phyloseq_obj, treatment = NULL, subset = NULL,
rho = 0, p = 0.05, method = 'spearman', cores = 1)

Arguments

phyloseq_obj

A phyloseq-class object.

treatment

Column name as a string or numeric in the sample_data. This can be a vector of multiple columns and they will be combined into a new column.

subset

A factor within the treatment. This will remove any samples that to not contain this factor. This can be a vector of multiple factors to subset on.

rho

numeric The rho-value cutoff. All returned co-occurrences will have a rho-value less than or equal to rho or less than or equal to -rho.

p

numeric The p-value cutoff. All returned co-occurrences will have a p-value less than or equal to p.

method

Which correlation method to calculate, "pearson", "spearman".

cores

numeric Number of CPU cores to use for the pair-wise permutations. Default (0) uses max cores available. Parallelization not available for systems running MacOS without openMP configuration.

Value

data.table

See Also

permute_rho phylosmith

Examples

co_occurrence(soil_column, treatment = c('Matrix', 'Treatment'),
subset = 'Amended', rho = 0.8, p = 0.05, cores = 1)

schuyler-smith/phylosmith documentation built on Aug. 17, 2024, 10:19 a.m.