ArchR Documentation

repository·master·Indexed 19 days ago

https://github.com/greenleaflab/archr

A high-performance R package for processing and analyzing single-cell ATAC-seq data, capable of analyzing up to 1 million cells on standard hardware. Features include paired scATAC-seq and scRNA-seq analysis, trajectory analysis via monocle3 and Slingshot, and peak matrix export for STREAM.

Tokens
1.1K
Snippets
3
Records
6
Agent score
16%

What's inside ArchR

  1. Manage ArchR dependencies using Docker

    master

    ArchR provides pre-compiled Docker images based on rocker/rstudio that include ArchR and all necessary dependencies.

    To run an interactive RStudio instance:

    1. Pull the greenleaflab/archr:latest image.
    2. Run the container, mapping your local workspace to /workspace and exposing port 8787.
    3. Access RStudio via localhost:<your_port_of_interest>.

    To run an interactive bash console instead of RStudio, replace the command with bash.

    # Pull the latest image
    docker image pull greenleaflab/archr:latest
    
    # Run RStudio container
    docker run -it --rm -v <your_workspace>:/workspace -p <your_port_of_interest>:8787
    
    # Run interactive bash console instead
    docker run -it --rm -v <your_workspace>:/workspace -p <your_port_of_interest>:8787 bash
  2. Manage ArchR dependencies using renv

    master

    You can use renv to create a reproducible environment. ArchR provides lock files for specific R versions. Supported R versions are 4.4 and 4.1.

    To use this method:

    1. Install and load renv.
    2. Create and set a project directory.
    3. Download the appropriate renv.lock file for your R version.
    4. Run renv::init() to bootstrap the environment.
    # Setup renv
    install.packages("renv")
    library(renv)
    
    # Create project directory
    dir.create(path = "./<project_name>", showWarnings = FALSE)
    setwd("./<project_name>")
    
    # Download lock file (Choose based on your R version)
    # For R 4.4:
    download.file(url = "https://pub-9ae435458ecc412abbbc9420a502ec38.r2.dev/renv.lock", destfile = "./renv.lock")
    
    # For R 4.1:
    # download.file(url = "https://pub-9ae435458ecc412abbbc9420a502ec38.r2.dev/renv_4_1.lock", destfile = "./renv.lock")
    
    # Initialize environment
    renv::init()
  3. Quick Installation of ArchR

    master

    To install ArchR directly in an R session, follow these steps in order. Ensure you install devtools and BiocManager first to handle GitHub and Bioconductor dependencies. After installing the ArchR package, you must run ArchR::installExtraPackages() to install any remaining dependencies required for full functionality.

    # 1. Install devtools
    if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
    
    # 2. Install BiocManager
    if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
    
    # 3. Install ArchR from GitHub
    devtools::install_github("GreenleafLab/ArchR", ref="master", repos = BiocManager::repositories())
    
    # 4. Install extra dependencies
    library(ArchR)
    ArchR::installExtraPackages()
  4. Trajectory Analysis features

    master

    ArchR provides direct support for trajectory analysis using monocle3 and Slingshot. Key functions include:

    • getMonocleTrajectories: Retrieve monocle3 trajectories.
    • addMonocleTrajectory: Add monocle3 trajectories to the ArchR object.
    • addSlingShotTrajectories: Add Slingshot trajectories to the ArchR object.
  5. Paired scATAC-seq and scRNA-seq Analysis features

    master

    ArchR supports integrated analysis of paired scATAC-seq and scRNA-seq data using the following functions:

    • importFeatureMatrix: Import feature matrices.
    • addGeneExpressionMatrix: Add gene expression data.
    • addIterativeLSI: Perform Iterative LSI.
    • addCombinedDims: Add combined dimensions.