Description Usage Arguments Value Examples

View source: R/nullmodel_GoM.R

Use null models (popular in ecology) to generate randomized matrix of counts given the observed data matrix, fit the GoM model to these null matrices and compare the fit on null model data with that on the observed data. Used for validating the GoM clusters

1 2 3 | ```
nullmodel_GoM(counts, K, tol = 0.1, null.model = c("frequency", "richness",
"independentswap", "trialswap"), iter_fill = 1000, iter_randomized = 100,
plot = TRUE)
``` |

`counts` |
The counts matrix (N x G): N- the number of samples, G- number of features |

`K` |
The number of clusters to fit |

`tol` |
The tolerance of the GoM model fitted |

`null.model` |
The type of nullmodel used (similar to the randomizeMatrix() function argument in picante package) |

`iter_fill` |
The number of swaps/fills in each randomized matrix build |

`iter_randomized` |
The number of randomization matrices generated |

`plot` |
If TRUE, plots density of log Bayes factor |

Returns a list with

`GoMBF.obs` |
log BF for the observed counts with K=2 against the null with no clusters |

`GoMBF.rand` |
a vector of log BF for each randomized count matrix with K=2 against the null with no clusters |

`pval` |
the p-value of the observed log Bayes factor against the ones from randomized matrices |

1 2 3 4 5 6 7 | ```
data("ex.counts")
nullmodel_GoM(ex.counts,
K=2,
tol=500,
null.model="frequency",
iter_randomized=3,
plot=FALSE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.