patientMean: Calculate Mean Patient Values.

Description Usage Arguments Details Author(s) References Examples

Description

This function is used to create a data frame of the mean microbiome values from data frames for the top taxonomic relative abundance, normalized alpha diversity, and bacterial load. The resulting data frame is easy to use in downstream plotting applications. The means are calculated for each sampling time point.

Usage

1
2
3
4
5
6
patientMean(x, 
	sub.range, 
	subject.id.col="SubjectID", 
	tmpt.id.col="Time_point", 
	metric.col="Bacteria", 
	abundance.val="Abundance")

Arguments

x

The desired data.frame (top taxonomy, alpha diversity, or bacterial load) containing the values with which the means will be calculated.

sub.range

The numeric range of subject IDs for which the mean values are to be calcualted.

subject.id.col

The Sunject ID column name from data frame x. Default is "SubjectID".

tmpt.id.col

The time point ID column name from data frame x. Default is "Time_point".

metric.col

The metric ID column name from data frame x. This column includes the taxonomic IDs or alpha diversity metric categories. Default is "Bacteria".

abundance.val

The abundance column name from data frame x. This column includes the values which will be used to calcualte means across the categories and time points. Default is "Abundance".

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.

Author(s)

Geoffrey Hannigan <ghanni@upenn.edu>, Loesche MA, Hodkinson BP, Mehta S, Elizabeth Grice <egrice@upenn.edu>

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Relative Abundance Mean
data("PatProOTU",package="patPRO")
data("PatProMap",package="patPRO")
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)
topTaxaMean <- patientMean(x=top5RelAbund, 
  sub.range=c(1:5), 
  metric.col="Bacteria")
# Alpha Diversity Mean
data("PatProAlphaDiv",package="patPRO")
data("PatProMap",package="patPRO")
mergedMapAlpha <- mergeMapMetaData(map.file=PatProMap, 
  merging.file=PatProAlphaDiv, 
  map.sub.id="SubjectID", 
  map.tmpt="Time_point", 
  map.smpl.id="SampleID", 
  sample.id.col="SampleID")
testNormAlphaDivForMean <- normalizeAlphaDiv(mergedMapAlpha, c("chao1","shannon"), 1:5)
AlphaDivMean <- patientMean(x=testNormAlphaDivForMean, 
  sub.range=c(1:5), 
  metric.col="variable", 
  abundance.val="value")
# Bacterial Load Mean
data("PatProBacLoad",package="patPRO")
data("PatProMap",package="patPRO")
mergedMapBacLoad <- mergeMapMetaData(map.file=PatProMap, 
  merging.file=PatProBacLoad, 
  map.sub.id="SubjectID", 
  map.tmpt="Time_point", 
  map.smpl.id="SampleID", 
  sample.id.col="SampleID")
BacMean <- patientMean(x=mergedMapBacLoad, 
  sub.range=c(1:5), 
  metric.col="", 
  abundance.val="Num_Bacteria")

patPRO documentation built on May 1, 2019, 10:56 p.m.

Related to patientMean in patPRO...