corrPhenotype: Scatterplot of a feature and a phenotype

View source: R/correlation_functions.R

corrPhenotypeR Documentation

Scatterplot of a feature and a phenotype

Description

This function plots a scatterplot of a feature and a phenotype along with sample correlation statistics.

Usage

corrPhenotype(
  aggdat,
  feature,
  phenotype,
  log = TRUE,
  method = c("spearman", "pearson", "kendall"),
  addRegression = TRUE,
  col_by = NULL,
  facet1 = NULL,
  facet2 = NULL,
  plotTitle = "",
  xlab = NULL,
  ylab = NULL,
  allowWebGL = TRUE,
  pwidth = 550,
  pheight = 200
)

Arguments

aggdat

aggregated MRExperiment

feature

Feature input.

phenotype

Phenotype input (must be numeric)

log

Log2 transform data. Default is TRUE.

method

Correlation coefficient. One of "spearman" (default), "pearson", or "kendall".

addRegression

boolean parameter indicating whether linear regression line should be drawn; default: TRUE

col_by

Phenotype for coloring.

facet1

Phenotype for facet 1.

facet2

Phenotype for facet 2. (WIP/TODO)

plotTitle

Plot title. Default is no title.

xlab

X-axis label. Default is feat1.

ylab

Y-axis label. Default is feat2.

allowWebGL

boolean indicating if WebGL should be used for large data

pwidth

overall plot width; default is 550

pheight

overall plot height; default is 200

Value

list holding plotly plot and lm fit

Examples

data("mouseData", package = "metagenomeSeq")
aggdat <- aggFeatures(mouseData, level = "genus")
corrPhenotype(aggdat, feature = "Bacteroides", phenotype = "relativeTime")


zoecastillo/microbiomeExplorer documentation built on Sept. 11, 2022, 7:40 a.m.