sc-RNA matrix appears to be empty
Entering edit mode
13 months ago

I'm trying to load the gene count sparse matrix from this source in R:

However the matrix's contents appear to be empty. To download I used wget on the command line:

wget -O - | head > data.txt

And then load matrix like so:

matrix <- Matrix::readMM(file="~/scratch/rtrujillo/RNA-seq/sci-seq/data.txt")

To ensure these two steps are successful I attempted to graph the counts per cell:

counts_per_cell <- Matrix::colSums(matrix)

plot <- ggplot() + aes(counts_per_cell)+ geom_histogram(binwidth=0.5, colour="black", fill="white") ggsave(plot,file="counts_per_cell.png")

Which returns this plot.enter image description here

My interpretation is that there are zero counts for all 2 millions of the cells. Am I performing any of these steps incorrectly or is the matrix really completely empty?

MatrixMarket sc-RNA-seq gene matrix RNA-seq • 539 views
Entering edit mode

Why are you piping your wget command? Save the file locally and then perform additional operations on it once you have a stable local copy. More importantly, you have head in that pipe, so you are not keeping most of the rows.

Entering edit mode
13 months ago
ATpoint 66k

Hey look, you should try to understand code users provided. I used head here converting a sc-RNA matrix from .txt to MatrixMarket .mtx file. simply because I did not want to download gigabytes of data for this example post to demonstrate that the format is correct. You of course have to remove that to download the entire dataset rather than the first 10 lines. Just download the entire file with wget and load the output, without any manipulation.


Login before adding your answer.

Traffic: 1024 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6