null.beta: Beta-Specificity Null Models

Description Usage Arguments Details Value References Examples

View source: R/specificity_scripts.R

Description

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

Usage

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

Arguments

x

Data frame of hosts populating rows and symbionts populating columns.

iterations

Integer. Indicate the number of randomized communities to generate.

index

Character. Method for calculation with the Morisita-Horn, Horn or Sorensen Indices.

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.

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'.

Value

A data frame with columns that refer to symbiont identifiers, absolute read abundance, beta-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 beta-specificity per symbiont 
null.beta <- null.beta(comm.matrix, index = "morisita.horn", randomization.method = "shuffle.web")

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