sim_par: Function for community similarity calculation used by 'tina',...

Description Usage Arguments Value Examples

View source: R/com_dis.R

Description

Function for community similarity calculation used by 'tina', modified from https://github.com/defleury/Schmidt_et_al_2016_community_similarity/blob/ master/functions.community_similarity.R

Usage

1
sim_par(x, y, sim_method = "w_ja", threads = 80, nblocks = 400)

Arguments

x

An quantitative matrix.

y

The Cij matrix, which is correlation matrix of adjusted sparcc matrix of x.

sim_method

The method for similarity, "w_ja" and "uw_ja" are available for weighted and unweighted Jaccard similarity respectively.

threads

The number of threads used for parallel running, 80 by default.

nblocks

The number of row / column for splitted sub-matrix, 400 by default.

Value

s The output similarity matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data(maize_asv)
maize_tab <- maize_asv[1 : 1000, 1 : 200]
asv <- norm_tab(maize_tab, method = "raref", depth = 100)
asv[is.na(asv)] <- 0
asv_sparcc <- sparcc(asv, threads = 8, nblocks = 40)
tmp.S <- adj(asv_sparcc, method = "spearman")
y <- 0.5 * (tmp.S + 1)
s <- sim_par(asv_sparcc, y, sim_method = "w_ja", threads = 8, nblocks = 40)

## End(Not run)

Guan06/mina documentation built on Feb. 21, 2022, 11:56 a.m.