converting a sc-RNA matrix from .txt to MatrixMarket .mtx file.
2
0
Entering edit mode
7 months ago

Hello, this is my first post on biostars! Thank you in advance for any help.

I'm having trouble converting a RNA-seq gene count sparse matrix from .txt to MatrixMarket .mtx file. I'm working with the gene count sparse matrix from this dataset.

And wanted to load the matrix in R so that I can filter cells by barcode out of the dataset. The first line of the .txt file is:

%%MatrixMarket matrix coordinate integer general

So I figured I'd be able to use the readMM() function however doing this gave me the error message:

Error in readMM(file = "~/scratch/rtrujillo/RNA-seq/sci-seq/gene_count.txt") : file is not a MatrixMarket file

How can I load this file in R?

MatrixMarket RNA-seq sc-RNA-seq • 650 views
1
Entering edit mode
7 months ago
ATpoint 60k

It works on my machine:

#/ download
wget -O - https://shendure-web.gs.washington.edu/content/members/cao1025/public/mouse_embryo_atlas/gene_count.txt | head > data.txt

library(Matrix)
26183 x 2058652 sparse Matrix of class "dgTMatrix"
(...)

0
Entering edit mode
7 months ago

and never did anything after to manipulate the file. Is it possible the curl command altered gene_count.txt in some way wget didn't?