Entering edit mode
2.9 years ago
ali_karimnezhad
▴
20
I have downloaded a count matrix of a single-cell dataset in csv format (let's call it a.csv) from synaps.org, with the following structure:
i j x
34 1 1
35 1 1
43 1 1
74 1 1
How can I generate the corresponding count matrix in R in mtx format? I have two meta data file associated with a.csv. Here I provide the first two lines of those files (with modifications)
b.csv:
cell_name specimenID broad_class subtype
1 cellname1 specimenID1 Exc Exc.Exc.L3
2 cellname2 specimenID2 Exc Exc.Exc.L3
c.csv:
X x
1 gene1
2 gene2
Please put effort into formatting your post better. See this post for tips: How to Use Biostars Part-3: Formatting Text and Using GitHub Gists
I've fixed your post this time.
Thank you Ram
Isn't that already mtx format? Try to read that first csv with `Matrix::readMM` into R and see what happens. The other two files are then the row- and coldata to annotate that matrix. You probably want to make a more suitable format to work downstream, e.g. SingleCellExperiment or Seurat. Does that make sense?Thanks for your reply ATpoint .
No, unfortunately, it is not in mtx format. readMM gives the following error:
file is not a MatrixMarket file