CommunityComparison: Compare community structure

Description Usage Arguments Details Examples

Description

Multivariate patterns of sample similarity were compared between pairwised community matrices using Procrustes and Mantel tests.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
getDissimilarityList(cm.list, metric = "jaccard", ...)

mantelComparison(dist.list, method = "pearson", permutations = 999)

procrustesComparison(dist.list, scale = TRUE, symmetric = TRUE,
  permutations = 999)

sublistByPairs(m.p.list, pairs, subset.pairs)

plotProcrustes(proc.list, attr.df, colour.id = "Elevation",
  proc.list.pairs = list(), title.list = list(), plot.title.size = 8,
  colours = c("blue", "orange"), limits = NULL,
  legend.title = "Elevation (m)", legend.key.width = unit(0.65, "cm"))

Arguments

cm.list

A list of community matrices.

metric, ...

The distance metric, default to "jaccard", and other parametes passed to getDissimilarity.

dist.list

A list of dissimilarity in dist between pairwised community matrices, which can be calculated by getDissimilarityList.

method, permutations

Parameters used in mantel in vegan.

scale, symmetric, permutations

Parameters used in procrustes and protest.

m.p.list

Either m.list of the output from mantelComparison, or proc.list or prot.list from procrustesComparison.

pairs, subset.pairs

The list of the list of two pairs of community names, see example. The string names have to be exaclty same in order to find matches, but the order of the pair does not matter the 1st or 2nd come first.

proc.list

The list of procrustes results.

attr.df, colour.id

A data frame of meta data to define how the plot is coloured by colour.id. Default to "Elevation".

title.list, proc.list.pairs

The list of strings to make titles. Use title.list first, and then proc.list.pairs if title.list is empty, and then names(proc.list) if both are empty.

colours, legend.title, legend.key.width

The properties of colour legend

Details

getDissimilarityList calculates a list of similarity/dissimilarity given a list of community matrices and the distance metric.

mantelComparison makes Mantel tests for comparisons between the overall community structure.

procrustesComparison makes Procrustes comparisons between the overall community structure.

sublistByPairs takes a subset result from comparisons given the subset of pairwised communities.

plotProcrustes plots Procrustes correlations between pairwised communities.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
jaccard.dist <- getDissimilarityList(cm.list, metric="jaccard")
jaccard.dist$dist.list

mantel <- mantelComparison(jaccard.dist$dist.list)
mantel.tri <- getTriMatrix(mantel$m.df) 

procrustes <- procrustesComparison(jaccard.dist$dist.list) 
prot.tri <- getTriMatrix(procrustes$prot.df, order.by=order.by) 

# Mantel test (lower triangle) and Procrustes test (upper triangle)
corrs <- combineTriMatrix(mantel.tri, prot.tri)

sub.proc <- sublistByPairs(procrustes$proc.list, procrustes$pairs, subset.pairs=list(list("16S bacteria","18S protists"),list("18S animals","COI−300 animals")) )
sub.proc$sub.list

plotProcrustes(procrustes$proc.list)

walterxie/ComMA documentation built on May 3, 2019, 11:51 p.m.