extracting count matrix from default cell ranger files
I am looking for a non programmatic method or additional software that can make count matrix of genes from three file: barcode.tsv feature.tsv matrix.mtx
Is there any tool or software? Thanks
• 2,146 views
•
link
1 answer
Non-programatical does not exist afaik.
Follow the cellranger manual:
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
If you really want a plain matrix then use as.matrix(mat) but I wonder what that would be good for. Single-cell matrices are in compressed formats for a reason (size, not feasble for manual inspection).
• 0 views
•
link
Log in to answer this question.
Ask whoever used cellranger to make those files to use celllranger to make the full non-sparse matrix.