I'm trying to load the gene count sparse matrix from this source in R:
https://oncoscape.v3.sttrcancer.org/atlas.gs.washington.edu.mouse.rna/downloads
However the matrix's contents appear to be empty. To download I used wget on the command line:
wget -O - https://shendure-web.gs.washington.edu/content/members/cao1025/public/mouse_embryo_atlas/gene_count.txt | 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.
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?
1 answer
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.
Log in to answer this question.
Why are you piping your
wgetcommand? Save the file locally and then perform additional operations on it once you have a stable local copy. More importantly, you haveheadin that pipe, so you are not keeping most of the rows.