Created
December 18, 2018 15:23
-
-
Save daskelly/9ebe9db871c435edb10ebe21fba0a3e1 to your computer and use it in GitHub Desktop.
Version of Seurat's Read10X function for 10X cellranger 3 data
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
read10x <- function(dir) { | |
names <- c("barcodes.tsv", "features.tsv", "matrix.mtx") | |
for (i in 1:length(names)) { | |
R.utils::gunzip(paste0(dir, "/", names[i], ".gz")) | |
} | |
file.copy(paste0(dir, "/features.tsv"), paste0(dir, "/genes.tsv")) | |
mat <- Seurat::Read10X(dir) | |
file.remove(paste0(dir, "/genes.tsv")) | |
for (i in 1:length(names)) { | |
R.utils::gzip(paste0(dir, "/", names[i])) | |
} | |
mat | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment