variable_correlation_heatmap: Computes the correlation of numerical variables with taxa...

View source: R/variable_correlation_heatmap.R

variable_correlation_heatmapR Documentation

Computes the correlation of numerical variables with taxa Function from the phylosmith-package.

Description

Computes the correlation of numerical variables with taxa

Usage

variable_correlation_heatmap(phyloseq_obj, variables, treatment = NULL,
subset = NULL, classification = NULL, method = "spearman", limits = c(-0.8, 0.8),
colors = "default", significance_color = "white", cores = 1, treatment_labels = NULL,
sample_labels = NULL, classification_labels = NULL)

Arguments

phyloseq_obj

A phyloseq-class object.

variables

Numerical factors within the in the sample_data to correlate with the abundance data.

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.

classification

Column name as a string or numeric in the tax_table for the factor to conglomerate by.

method

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

limits

The range for the legend, smaller limits will accentuate smaller correlations.

colors

the palette to use for the heatmap, default is viridis.

significance_color

the color to use for the significance stars.

cores

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

treatment_labels

a vector of names to be used as labels for treatments/facets.

sample_labels

a vector of names to be used as labels for Samples.

classification_labels

a vector of names to be used as labels for the taxonomic classifications.

Value

data.table

See Also

permute_rho phylosmith

Examples

variable_correlation_heatmap(soil_column, variables = 'Day',
treatment = c('Matrix', 'Treatment'), subset = 'Amended',
classification = 'Phylum', method = 'spearman', cores = 1,
colors = c("#2C7BB6", "white", "#D7191C"),
significance_color = 'black')

schuyler-smith/phyloschuyler documentation built on March 27, 2024, 4:29 p.m.