GroupPlot: Visualise group differences

View source: R/GroupPlot.R

GroupPlotR Documentation

Visualise group differences

Description

The function prints five different plots to visualise group differences in selected bacterial taxa.

Usage

GroupPlot(taxa = NULL, group = NULL, taxonomic.table, meta, readcount.cutoff = 0, 
         stacked = T, bar = T, box = T, bean = T, covariate = NULL, 
         smooth.method ='loess',select.by = NULL, select = NULL, pdf = F, label.direction = 1, logtrans = F,
         relative = T)

Arguments

taxa

Names of the taxa that should be visualised.

group

Grouping variable.

taxonomic.table

Taxonomic table file containing the taxa of interest. Should be the name of a text file.

meta

Metadata file containing the grouping variable. Should be the name of a text file.

readcount.cutoff

Lowest acceptable read count. Samples with fewer reads will be ignored.

stacked

Should a stacked barplot be printed? If yes, specify TRUE.

bar

Should a barplot of the means and standard errors with be printed? If yes, specify TRUE.

box

Should a box-and-whiskers plot be printed? If yes, specify TRUE.

bean

Should a bean plot be printed? If yes, specify TRUE.

covariate

Continuous variable to show associations with the bacterial taxa in the different groups.

smooth.method

Method to calculate the association between the taxa and the covariate. Set to 'lm' for a linear fit line, and 'loess' for a smooth fit line.

select.by

Name of a variable in the metadata file by which a subset will be selected for plotting.

select

Determines which value on the selection variable will be selected.

pdf

Should the figures be printed as pdf? If yes, specify TRUE.

label.direction

Direction of the x-axis labels: 1 = horizontal, 2 = vertical.

logtrans

Log-transform data for boxplots? TRUE or FALSE, default is FALSE.

relative

Plot relative abundances? Default is TRUE. FALSE will plot data as is.

Author(s)

Katri Korpela

See Also

CommonTaxa

Examples

## Not run: 	
#Make all five plots, showing the association between the most abundant
#genus-level bacterial taxa and treatment group, including a plot showing how the 
#taxa correlate with OTU richness in the different treatment groups, omitting samples 
#with <2000 reads.

common <- CommonTaxa(taxonomic.table = 'organised_genus_table.txt', mean.abundance = 0.05, prevalence = 10)
GroupPlot(taxa = unlist(common[1]),
          group = 'Treatment',
          taxonomic.table = 'organised_genus_table.txt', 
          meta = 'meta.txt', 
          readcount.cutoff = 2000,  
          covariate = 'Richness', 
          smooth.method = 'lm')	

## End(Not run)

katrikorpela/mare documentation built on July 17, 2022, 2:49 a.m.