Introduction

inferCSN+ is an R package for inferring Cell-Specific gene regulatory Network from single-cell omics data.

inferCSN+ workflow diagram

Installation

You can install the released version from CRAN use:

install.packages("inferCSN")
# or
if (!require("pak", quietly = TRUE)) {
  install.packages("pak")
}
pak::pak("inferCSN")

You can install the development version from GitHub use pak:

if (!require("pak", quietly = TRUE)) {
  install.packages("pak")
}
pak::pak("mengxu98/inferCSNplus")

Usage

Examples

For a matrix object.

library(inferCSN)
data("example_matrix")

network <- inferCSN(
  example_matrix
)

For a matrix object, initiate it to Network object.

library(inferCSN)
data("example_matrix")

object <- initiate_object(
  example_matrix
)
object
object <- inferCSN(
  object
)

network_table <- export_csn(
  object
)
head(network_table)

For a Seurat object, it contains multiome data (scRNA-seq and/or scATAC-seq)

Multiome data from GSE204684.

library(inferCSN)
library(BSgenome.Hsapiens.UCSC.hg38)
data(motifs)

# initiate Seurat object to CSNObject
object <- initiate_object(
  object,
  peak_assay = "ATAC",
  filter_by = "celltype",
  celltype = NULL,
  celltype_by = "celltype"
)
object <- find_motifs(
  object,
  pfm = motifs,
  genome = BSgenome.Hsapiens.UCSC.hg38
)
object <- inferCSN(
  object,
  cores = 4
)
networks <- export_csn(
  object
)
head(networks[[1]])

# network processing
object <- find_modules(
  object,
  p_thresh = 0.3,
  nvar_thresh = 10,
  min_genes_per_module = 5,
  rsq_thresh = 0.05
)

modules <- NetworkModules(object)
modules[[1]]@meta

# network visualization
p <- plot_gof(object)
p[[1]]

p2 <- plot_module_metrics(object)
p2[[1]]

object <- get_network_graph(object)
plot_network_graph(object)

targets <- get_attribute(
  object,
  attribute = "targets"
)
targets <- targets[["RG"]]
tf <- targets[1:100]
object <- get_tf_network(
  object,
  tfs = tf,
  celltypes = "RG",
  verbose = FALSE
)

plot_list <- plot_tf_network(
  object,
  tfs = tf,
  edge_width = 0.5,
  celltypes = "RG",
  verbose = FALSE
)

plot_list$RG

More functions and usages about inferCSN+? Please reference here.

Citation

If you use inferCSN+ in your work, please cite it reference here.