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.
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.
- Open terminal.
conda create -n immunox_hack pip
source activate immunox_hack
- this will activate your environment where you will install packages and perform analysis.conda install pandas numpy scipy
- 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.
- In your Anaconda Navigator select created environment and click install button under Jupyter Lab icon.
- Launch Jupyter Lab from Anaconda Navigator and start your magic!
- Launch Anaconda Prompt.
create -n immunox_hack pip
activate immunox_hack
- this will activate your environment where you will install packages and perform analysis.conda install pandas numpy scipy
- 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.
- In your Anaconda Navigator select created environment and click install button under Jupyter Lab icon.
- Launch Jupyter Lab from Anaconda Navigator and start your magic!
Use the following link:
https://www.rstudio.com/products/rstudio/download/
Select RStudio Desktop and click download
Open downloaded file and follow the instructions.
- Open Rstudio.
install.packages('Seurat')
- Start your magic!
These links will get you more familiar with the single cell analysis.
https://scanpy-tutorials.readthedocs.io/en/latest/visualizing-marker-genes.html
https://satijalab.org/seurat/vignettes.html
This will help you to import your datasets for gene and surface protein expression
import scanpy as sc
adata = sc.read_10x_h5("FULL_PATH_TO_FILE", gex_only=False)
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