Does this seem correct ?
I used Kallisto-bustools to quantify a snRNA-seq run. I have output files: spliced.barcodes.txt, splided.genes.txt, spliced.mtx, output.bus, output.unfiltered.bus, and same set of unspliced files. How do I convert these files to seurat object format? I tried converting txt files to tsv and then zipped to their pbmc data files but there is an error:
pbmc.data <- Read10X(data.dir = "output/counts_unfiltered/")
Error in fixupDN.if.valid(value, x@Dim) :
length of Dimnames[[2]] (676991) is not equal to Dim[2] (57748)
Suggestions or redirections to others to methods for this are very welcome. Thanks for your time.
1 answer
The issue is that Seurat uses gene-by-cell matrices rather than cell-by-gene matrices (i.e. the matrix is transposed). You can do the following:
library(Seurat)
expression_matrix <- ReadMtx(mtx="matrix.mtx", features = "genes.txt",
cells = "barcodes.txt",
feature.column=1,
mtx.transpose = TRUE)
Just replace matrix.mtx, genes.txt, and barcodes.txt with your respective file names.
Yes, looks reasonable: You start off with 57,748 genes x 676,991 cells. After very light filtering, you are left with 31,477 genes by 13,206 cells.
Seems reasonable.
Log in to answer this question.