trimHS_maxC: Trims the H-S association matrix maximizing the congruence

trimHS_maxCR Documentation

Trims the H-S association matrix maximizing the congruence

Description

For N runs, it randomly chooses n unique one-to-one associations and trims the H-S association matrix to include only the n associations.

Usage

trimHS_maxC(N, HS, n, check.unique = TRUE, strat = "sequential", cl = 1)

Arguments

N

Number of runs.

HS

Host-Symbiont association matrix.

n

Number of unique associations.

check.unique

if TRUE discards duplicated trimmed matrices. This alternative is recommended if n is small, because the probability of obtaining the same trimmed matrix in different runs increases as n decreases.

strat

Flag indicating whether execution is to be "sequential" or "parallel". Default is "sequential", resolves R expressions sequentially in the current R process. If "parallel" resolves R expressions in parallel in separate R sessions running in the background.

cl

Number of cluster to be used for parallel computing. parallelly::availableCores() returns the number of clusters available. Default is cl = 1 resulting in "sequential" execution.

Value

A list of the N trimmed matrices.

Examples


data(nuc_cp)
N = 10  #for the example, we recommend 1e+4 value
n = 15
TNC <- trimHS_maxC(N, np_matrix, n, check.unique = TRUE)



Rtapas documentation built on June 22, 2024, 10:47 a.m.