null.structural: Absolute Structural Specificity Null Models

Description Usage Arguments Details Value References Examples

View source: R/specificity_scripts.R

Description

Generate null models of structural specificity by calculating absolute structural specificity per symbiont within each community randomization.

Usage

1
2
3
4
5
6
7
8
9
null.structural(
  x,
  iterations = 100,
  abundance.weighted = TRUE,
  randomization.method = c("r2dtable", "swap.web", "vaznull", "shuffle.web", "mgen"),
  trim = TRUE,
  notify = TRUE,
  randomized.object = NULL
)

Arguments

x

Data frame. Host by symbiont data frame with hosts populating rows and symbionts populating columns.

iterations

Integer. Indicate the number of randomized communities to generate.

abundance.weighted

Logical. TRUE calculates Shannon's H per symbiont. FALSE calculates host richness per symbiont.

randomization.method

Randomization method. Usage borrowed directly from bipartite::nullmodel. Specify as "r2dtable", "swap.web", "vaznull", "shuffle.web" or "mgen".

trim

Logical. TRUE removes symbionts that occupy one host species. FALSE keeps all symbionts.

notify

Logical. TRUE prints the current iteration of the for loop. NOTE: This function can take some time.

randomized.object

List. If your preferred null model is not represented in bipartite::nullmodel you can use any other function to generate randomized communities (e.g., vegan::permatswap) outside of 'lotus'. Make sure your output is formatted as a list of matrices (match output from bipartite::nullmodel) and you can supply this to the 'randomized.object' argument. The 'iterations' argument should match the number of iterations in the provided 'randomized.object'.

Details

Hosts are labeled by their species name with a period and number identifier (e.g., hostA.1) to differentiate host samples that are of the same species. This naming scheme is required because host specificity is quantified at the level of host species and not host samples. If this naming scheme does not apply to your experimental design, you should still add in identifiers (e.g., .1, .2, .3, etc.) after each host species or sample identifer.

Host specificity for a symbiont is evaluated across the entire host community. More positive values indicate a narrower symbiont niche and higher host specificity. Structural specificity is negated (multipled by -1) to make this consistent across all metrics.

Value

A data frame with columns that refer to symbiont identifiers, absolute read abundance, absolute structural specificities and randomization identifiers.

References

Austen Apigo and Ryoko Oono. 2021. Novel metrics reveal plant abundance, but not plant evolutionary history, shape host specificity in foliar fungal symbionts. In review.

Examples

1
2
# Generate randomized communities and calculate structural specificity per symbiont 
null.str <- null.structural(comm.matrix, randomization.method = "shuffle.web")

austenapigo/lotus documentation built on Aug. 8, 2021, 10:54 a.m.