-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
63 lines (50 loc) · 1.79 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# cobiclust
<!-- badges: start -->
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![R build status](https://github.com/julieaubert/cobiclust/workflows/R-CMD-check/badge.svg)](https://github.com/julieaubert/cobiclust/actions)
<!-- badges: end -->
The goal of cobiclust is to perform a biclustering of over-dispersed count data such as those produced by amplicon-based sequencing for example.
## Installation
You can install the released version of cobiclust from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("cobiclust")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("julieaubert/cobiclust")
```
## Example
This is a basic example which shows you how to perform a biclustering on simulated data:
```{r example}
library(cobiclust)
## basic example code
# npc <- c(50, 40) # nodes per class
# KG <- c(2, 3) # classes
# nm <- npc * KG # nodes
# Z <- diag( KG[1]) \%x\% matrix(1, npc[1], 1)
# W <- diag(KG[2]) \%x\% matrix(1, npc[2], 1)
# L <- 70 * matrix( runif( KG[1] * KG[2]), KG[1], KG[2])
# M_in_expectation <- Z \%*\% L \%*\% t(W)
# size <- 50
# M<-matrix(
# rnbinom(
# n = length(as.vector(M_in_expectation)),
# mu = as.vector(M_in_expectation), size = size)
# , nm[1], nm[2])
# rownames(M) <- paste("OTU", 1:nrow(M), sep = "_")
# colnames(M) <- paste("S", 1:ncol(M), sep = "_")
# res <- cobiclust(M, K = 2, G = 3, nu_j = rep(1,120), a = 1/size, cvg_lim = 1e-5)
```