-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
67 lines (52 loc) · 1.73 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
63
64
65
66
67
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.dev = "grDevices::png",
dpi = 300L,
dev.args = list(),
fig.ext = "png",
fig.height=8,
fig.width=12,
fig.retina = 2L,
fig.align = "center"
)
```
# scstruc
The package for analysing the gene regulatory network based on the Bayesian network structure of single-cell transcriptomics data. The function works with `SingleCellExperiment`.
<!-- badges: start -->
[![R-CMD-check](https://github.com/noriakis/scstruc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/noriakis/scstruc/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
## Installation
Using `devtools`:
```{r, eval=FALSE}
devtools::install_github("noriakis/scstruc")
```
For using the CCDr algorithm in the latest R version, please install `ccdrAlgorithm` package from the following repository, which removes the `||` usage error.
```{r, eval=FALSE}
devtools::install_github("noriakis/ccdrAlgorithm")
```
## Examples
```{r message=FALSE, warning=FALSE, fig.width=12, fig.height=12}
library(scran)
library(scstruc)
library(ggraph)
library(bnlearn)
sce <- mockSCE()
sce <- logNormCounts(sce)
included_genes <- sample(row.names(sce), 100)
gs <- scstruc(sce, included_genes, changeSymbol=FALSE)
plotNet(gs$net, gs$data, showText=FALSE)
```
Using the bootstrapping, the averaged network is obtained.
```{r message=FALSE, warning=FALSE, fig.width=8, fig.height=8}
library(glmnet)
gs2 <- scstruc(sce, included_genes, algorithm="glmnet_BIC", boot=TRUE,
changeSymbol=FALSE, R=20)
plotAVN(gs2$net, sizeRange=c(1,3))
```