Kallisto-bustools output to Seurat Object
1
1
Entering edit mode
11 months ago
myoui3122010 ▴ 20

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.

Bustools Kallisto Seurat • 898 views
ADD COMMENT
2
Entering edit mode
11 months ago
dsull ★ 6.9k

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.

ADD COMMENT
0
Entering edit mode

enter image description here

Does this seem correct ?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 1736 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6