Entering edit mode

3.7 years ago

Za
▴
130

Hi,

I have a read counts file from single cell seq from RSEM, I want to store that in a matrix.mtx format required for Seurat pipeline, how can I do that?

```
> head(all.counts)
HSC1_1 HSC1_2 HSC1_3 HSC1_4 HSC1_5 HSC1_6 HSC1_7
0610005C13Rik 0 0 0 0 0 0 0
0610007P14Rik 25 0 304 0 154 550 117
0610008F07Rik 0 0 0 0 0 0 0
0610009B14Rik 0 0 0 0 0 0 0
0610009B22Rik 0 0 0 8 83 521 236
0610009D07Rik 241 0 66 60 356 173 385
```

to

```
%%MatrixMarket matrix coordinate real general
%
32738 2700 2286884
32709 1 4
32707 1 1
32706 1 10
32704 1 1
32703 1 5
32702 1 6
32700 1 10
32699 1 25
32698 1 3
32697 1 8
32527 1 1
```

Sorry, where you have used my all.counts file to produce matrix.mtx ????? In your your code there is not my matrix.mtx file

Sorry, I mean I have already a barcode and annotation file and read counts data

Replace

`gbm`

(=gene-barcode matrix) by`all.counts`

:Thanks a lot

You even can't imagine that how much you have been helpful in this post and saved me from a harsh permanent error

Sorry,

This is head of my matrix.mtx

In one tutorial, the head of sparse matrix is so

If you kindly consider, mine is

integerand is notreal, another point mine starts with 13406 and does not go like the tutorial descending, may you please help me in figuring out how to make my spars matrix correct?What do you mean correct? Isn't it correct though? Should you have any non-integer value in your matrix, it would be stored differently (real, complex) by the R library. Could be that the matrix writer from your tutorial is not the same. This line

`13406 1562 6512772`

tells the matrix reader that your matrix has 13406 rows, 1562 columns and 6512772 non-zeros values. The rows below are triplets of the row coordinate, column coordinate, and value.Thanks a lot

As tutorial and my matrix both come from read counts of single cell seq data, my first column of my matrix is 13406 then 6, 40 and ascending but in tutorial is 32738, 32709, 32707,,,, and descending. How I can make my matrix descending?

This is the tail of tutorial matrix

and this is the tail of my matrix