Sign inSign up

shmohammadi86/actionet

By shmohammadi86

•Updated almost 6 years ago

Image
0

498

shmohammadi86/actionet repository overview

⁠Installation

⁠Setting Up the Environment (Preinstallation)

For Linux Users For the optimal performance on Intel-based architectures, installing Intel Math Kernel Library (MKL)⁠ is highly recommended. After installing, make sure MKLROOT is defined by running the setvars⁠ script.

Install library dependencies To install the ACTIONet dependencie on debian-based linux machines, run:

sudo apt-get install libhdf5-dev libsuitesparse-dev

For Mac-based systems, you can use brew⁠ instead:

brew install hdf5 suite-sparse
⁠Installing ACTIONet R Package
⁠Using devtools

This is the easiest way to install the package, and it automatically installs all package dependencies (except optional packages described below):

install.packages("devtools")
devtools::install_github("shmohammadi86/ACTIONet", ref = "R-release")

⁠Directly from the clone

This is the more flexible approach and allows for easily pulling the latest updates/changes. This can be done as follows:

  • Instaling dependencies: Unlike devtools, R script does not automatically install dependencies. To install all dependencies, run:
install.packages(c('Matrix', 'Rcpp', 'RcppArmadillo', 'R.utils', 'hdf5r', 'plotly', 'ggpubr', 'corrplot', 'wordcloud', 'threejs', 'RColorBrewer'))
BiocManager::install(c("SingleCellExperiment", "ComplexHeatmap"))
  • Clone ACTIONet repository: If you don't already have git, install it first.

On (Debian) Linux-based machines, run:

sudo apt-get install git

For Mac-based machines, run:

brew install git

Now clone a fresh copy of the repository:

git clone https://github.com/shmohammadi86/ACTIONet.git
  • Install ACTIONet: ACTIONet contains many different branchs. For installing the stable version, switch to the R-release branch:
cd ACTIONet
git checkout R-release

If you want to install the latest updates, switch to the R-devel branch:

cd ACTIONet
git checkout R-devel

and now you can install ACTIONet using the following command in the ACTIONet directory:

R CMD INSTALL .
⁠Install optional packages
⁠Batch correction
  • batchelor⁠: This Implements a variety of methods for batch correction of single-cell (RNA sequencing) data, including mutually-nearest neighbor (MNN) method. You can install it using bioconductor:
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("batchelor")

ACTIONet includes interface to run MNN: reduce.and.batch.correct.sce.fastMNN().

  • Harmony⁠: Harmony is another popular batch-correction method that has direct interface implemented in the ACTIONet framework:
install.packages("devtools")
devtools::install_github("immunogenomics/harmony")

ACTIONet includes interface to run harmony: reduce.and.batch.correct.sce.Harmony().

⁠Normalization & QC
  • scater⁠/scran⁠ packages provide great set of tools for normalization and quality-control of single-cell datasets stored as a SingleCellExperiment format. You can instal them using:
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("scater", "scran")

ACTIONet interfaces to scran normalization via normalize.scran() function.

  • Linnorm⁠ is another commonly used normalization technique. You can install it via:
## try http:// if https:// URLs are not supported
source("https://bioconductor.org/biocLite.R")

biocLite("Linnorm")

ACTIONet interfaces to scran normalization via normalize.Linnorm() function.

⁠Running ACTIONet

Note If you are using MKL, make sure to properly set the number of threads⁠ used prior to running ACTIONet.

⁠Example Run

Here is a simple example to get you started:

# Download example dataset from the 10X Genomics website
download.file('http://cf.10xgenomics.com/samples/cell-exp/3.0.0/pbmc_10k_v3/pbmc_10k_v3_filtered_feature_bc_matrix.h5', 'pbmc_10k_v3.h5') 

require(ACTIONet)
# Run ACTIONet
ace = import.ace.from.10X.h5('pbmc_10k_v3.h5', prefilter = T, min_cells_per_feat = 0.01, min_feats_per_cell = 1000)
ace = reduce.ace(ace)
ace = run.ACTIONet(ace)

# Annotate cell-types
data("curatedMarkers_human")
markers = curatedMarkers_human$Blood$PBMC$Ding2019$marker.genes
annot.out = annotate.cells.using.markers(ace, markers)
ace$celltypes = annot.out$Labels

# Visualize output
plot.ACTIONet(ace, "celltypes", transparency.attr = ace$node_centrality)

# Export results as AnnData
ACE2AnnData(ace, fname = "pbmc_10k_v3.h5ad")

⁠Visualizing results using cellxgene

ACTIONet framework introduces an extension of the SingleCellExperiment object that can be closely mapped to AnnData⁠ object. In fact, output of ACTIONet in the python implementation is internally stored as as AnnData object, and R ACE objects can be imported from/exported to AnnData using functions AnnData2ACE() and ACE2AnnData() functions, respectively. AnnData objects can be directly loaded into cellxgene⁠ package, an open-source viewer for interactive single-cell data visualization. cellxgene can be installed as:

pip install cellxgene

Then to visualize the results of ACTIONet, run:

cellxgene launch pbmc_10k_v3.h5ad

where pbmc_10k_v3.h5ad is the name of the file we exported using ACE2AnnData() function.

⁠Running ACTIONet with Docker

With Docker, no installation is required and users can directly start experimenting with ACTIONet instantly! Sounds easy, right? Here is how it goes.

  • Download Docker⁠ (if you don't already have, which in most linux distributions you do!)

  • Run ACTIONet docker:

$ docker run -p 8787:8787 shmohammadi86/actionet

If you wish to access your local data inside the docker, modify the command as:

$ docker run -v /your/data/file/path/:/data -w /data -p 8787:8787 shmohammadi86/actionet
  • Connect to the RStudio Server through your desktops browser on http://127.0.0.1:8787, and then enter "rstudio" as the username and password when prompted. ACTIONet and all of its dependencies, as well as a few other packages for single-cell analysis, are already installed in this environment for you.

  • Have a cup of coffee and enjoy running ACTIONet!

⁠Additional tutorials

You can access ACTIONet tutorials from:

  1. ACTIONet framework at a glance (human PBMC 3k dataset)⁠
  2. Introduction to the ACTIONet framework (human PBMC Granja et al. dataset)⁠
  3. Introduction to cluster-centric analysis using the ACTIONet framework⁠
  4. To batch correct or not to batch correct, that is the question!⁠
  5. PortingData: Import/export options in the ACTIONet framework⁠
  6. Interactive visualization, annotation, and exploration⁠
  7. Constructing cell-type/cell-state-specific networks using SCINET⁠

You can also find a step-by-step guide⁠ to learning the core functionalities of the ACTIONet framework.

Tag summary

Content type

Image

Digest

Size

5.2 GB

Last updated

almost 6 years ago

docker pull shmohammadi86/actionet