Created
May 5, 2017 20:44
-
-
Save dfjenkins3/a549a439c5bf178c2b0f722e97f5f6ee to your computer and use it in GitHub Desktop.
Using cellrangerRkit to read in 10X genomics results in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#credit to @myajima | |
library(cellrangerRkit) #install using https://s3-us-west-2.amazonaws.com/10x.files/supp/cell-exp/rkit-install-1.1.0.R | |
pipestance_path <-getwd() | |
download_sample(sample_name="pbmc3k", | |
sample_dir=pipestance_path, | |
host="https://s3-us-west-2.amazonaws.com/10x.files/samples/cell/") | |
gbm <- load_cellranger_matrix(pipestance_path) | |
analysis_results <-load_cellranger_analysis_results(pipestance_path) | |
use_genes <- get_nonzero_genes(gbm) | |
gbm_bcnorm <- normalize_barcode_sums_to_median(gbm[use_genes,]) | |
gbm_log <- log_gene_bc_matrix(gbm_bcnorm,base=10) | |
use_genes <- which(rowSums(exprs(gbm_log)>0)>100) | |
cmatp<-exprs(gbm_bcnorm)[use_genes,] | |
library(pheatmap) | |
pdf("heatmap.pdf") | |
pheatmap(log(cmatp)) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment