Skip to content

Instructions for setting up environment for scRNA-seq analysis

Notifications You must be signed in to change notification settings

yelabucsf/ImmunoX_hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

ImmunoX hackathon 2020

Instructions for setting up environment for scRNA-seq analysis using scanpy for Python or seurat for R.
You don't need both packages, choose whatever you are familiar with.

Python scanpy setup for MacOS and Windows

Use the following link:
https://www.anaconda.com/distribution/#download-section

Select your operating system and click download for Python 3.8 version
Open downloaded file and follow the instructions.

MacOS setup

  1. Open terminal.
  2. conda create -n immunox_hack pip
  3. source activate immunox_hack - this will activate your environment where you will install packages and perform analysis.
  4. conda install pandas numpy scipy
  5. Next set of commands will install scanpy and dependencies
conda install seaborn scikit-learn statsmodels numba pytables
conda install -c conda-forge python-igraph louvain
pip install leidenalg
pip install scanpy python-igraph louvain

NOTE: Advanced users feel free to set up your environment as you please.

  1. In your Anaconda Navigator select created environment and click install button under Jupyter Lab icon.
  2. Launch Jupyter Lab from Anaconda Navigator and start your magic!

Windows setup

  1. Launch Anaconda Prompt.
  2. create -n immunox_hack pip
  3. activate immunox_hack - this will activate your environment where you will install packages and perform analysis.
  4. conda install pandas numpy scipy
  5. Next set of commands will install scanpy and dependencies
conda install seaborn scikit-learn statsmodels numba pytables seaborn
conda install -c conda-forge python-igraph louvain
pip install leidenalg
pip install scanpy python-igraph louvain

NOTE: Advanced users feel free to set up your environment as you please.

  1. In your Anaconda Navigator select created environment and click install button under Jupyter Lab icon.
  2. Launch Jupyter Lab from Anaconda Navigator and start your magic!

R seurat setup for MacOS and Windows

Use the following link:
https://www.rstudio.com/products/rstudio/download/

Select RStudio Desktop and click download
Open downloaded file and follow the instructions.

MacOS and Windows setup

  1. Open Rstudio.
  2. install.packages('Seurat')
  3. Start your magic!

Tutorial links:

These links will get you more familiar with the single cell analysis.

PBMC clustering with scanpy

https://scanpy-tutorials.readthedocs.io/en/latest/visualizing-marker-genes.html

Cell clustering with Seurat

https://satijalab.org/seurat/vignettes.html

Importing your datasets

This will help you to import your datasets for gene and surface protein expression

scanpy

import scanpy as sc
adata = sc.read_10x_h5("FULL_PATH_TO_FILE", gex_only=False)

seurat

library(Matrix)
matrix_dir = "/opt/sample345/outs/filtered_feature_bc_matrix/"
barcode.path <- paste0(matrix_dir, "barcodes.tsv.gz")
features.path <- paste0(matrix_dir, "features.tsv.gz")
matrix.path <- paste0(matrix_dir, "matrix.mtx.gz")
mat <- readMM(file = matrix.path)
feature.names = read.delim(features.path, 
                           header = FALSE,
                           stringsAsFactors = FALSE)
barcode.names = read.delim(barcode.path, 
                           header = FALSE,
                           stringsAsFactors = FALSE)
colnames(mat) = barcode.names$V1
rownames(mat) = feature.names$V1

About

Instructions for setting up environment for scRNA-seq analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published