Learn R Programming

patPRO (version 1.1.0)

patproPlotTwo: Generate Patient Profile of Two Plots.

Description

Use this function to generate a patient profile containing two figures. The figures included are the alpha diversity and top taxa plots over time. This should be used when there is no bacterial load data, or when the normalized top taxa plot is used.

Usage

patproPlotTwo(alpha.div.plot, norm.top.taxa.plot, patpro.plot.title, legend.one.h=0.70, legend.two.h=0.30)

Arguments

alpha.div.plot
The alpha diversity plot to be used in the patient profile.
norm.top.taxa.plot
The normalized or non-normalized taxonomic relative abundance plot to be included in the patient profile.
patpro.plot.title
The desired plot title.
legend.one.h
Allows the user to manually set the height of the first figure legend (decimal digit between 0 and 1). Very important if adjusting legend text size. Defalut is 0.70.
legend.two.h
Allows the user to manually set the height of the second figure legend (decimal digit between 0 and 1). Very important if adjusting legend text size. Defalut is 0.30.

Details

Package:
patPRO
Type:
Package
Version:
1.0.0
Date:
2015-09-18
License:
GPLv3
An overview of how to use the package, including the most important functions, is included in the supplemental R notebook patPROExampleWorkflow.html.

References

patPRO: An R package for the visualization of longitudinal microbiome data. Hannigan GD, Loesche MA, Hodkinson BP, Mehta S, Grice EA.

Examples

Run this code
# Plot individual patient
data("PatProAlphaDiv",package="patPRO")
data("PatProMap",package="patPRO")
data("PatProOTU",package="patPRO")
data("PatProBacLoad",package="patPRO")
# Alpha Diversity
mergedMapAlpha <- mergeMapMetaData(map.file=PatProMap, 
	merging.file=PatProAlphaDiv, 
	map.sub.id="SubjectID", 
	map.tmpt="Time_point", 
	map.smpl.id="SampleID", 
	sample.id.col="SampleID")
testNormAlphaDiv <- normalizeAlphaDiv(mergedMapAlpha, c("chao1","shannon"), 1)
alphaDivPlot <- plotNormalizedAlphaDiv(testNormAlphaDiv, 
	c("chao1","shannon"), 
	plot.title="Subject One Diversity", 
	color.brewer.set="Set2", 
	legend.text.size = 12)
# Absolute Abundance Estimation
transTestRelAbund <- transposeRelAbund(PatProOTU)
mergedMapTransRA <- mergeMapMetaData(map.file=PatProMap, 
	merging.file=transTestRelAbund, 
	map.sub.id="SubjectID", 
	map.tmpt="Time_point", 
	map.smpl.id="SampleID", 
	sample.id.col="SampleID")
top5RelAbund <- topRelAbundDataFrame(x=mergedMapTransRA, top.taxa.num=5)
mergedMapBacLoad <- mergeMapMetaData(map.file=PatProMap, 
	merging.file=PatProBacLoad, 
	map.sub.id="SubjectID", 
	map.tmpt="Time_point", 
	map.smpl.id="SampleID", 
	sample.id.col="SampleID")
absAbundOutDf <- topAbsAbundDataFrame(top5RelAbund, mergedMapBacLoad, bac.load.id="Num_Bacteria")
normTopTaxa <- topAbsAbundPlot(absAbundOutDf, 
	1, 
	bac.load.col="Num_Bacteria", 
	plot.title="Subject One Normalized Taxonomy", 
	color.brewer.set="Set2", 
	mark.events=TRUE, 
	mark.times=c(2,6), 
	mark.text="Surgery", 
	legend.text.size = 8)
patproPlotTwo(alphaDivPlot, normTopTaxa, "Subject One Profile")

Run the code above in your browser using DataLab