Entering edit mode
4.0 years ago
fifty_fifty
▴
70
I am trying to read cellranger count matrix using scanpy. The folder 100PDXT contains matrix.mtx.gz, barcodes.tsv.gz, and features.tsv.gz
100PDXT=sc.read_10x_mtx("~/100PDXT/")
when I call 100PDXT.obs, I see cell names, but the shape is 3153 rows × 0 columns.
AAACCCAAGACCATAA-1
AAACCCACAAGACAAT-1
AAACCCACAGGTCAGA-1
AAACGAAAGCCAGTAG-1
AAACGAAAGTCACAGG-1
...
TTTGGTTGTCGTCAGC-1
TTTGGTTTCTCGGTAA-1
TTTGTTGCACAGTCAT-1
TTTGTTGTCGAAATCC-1
3153 rows × 0 columns
There should be 1 column. From what I have seen in tutorials, the anndata.obs should look like this:
0 AAACCCAAGACCATAA-1
1 AAACCCAAGACCATAA-1
2 AAACCCAAGACCATAC-1
3 AAACCCAAGACGATAT-1
4 AAACCCAAGACCATAT-1
... ...
3149 TTTGGTTGTCGTCACC-1
3150 TTTGGTTGTCGTCAGG-1
3151 TTTGGTTGTCCTCAGC-1
3152 TTTGGTTGTCGTCAGC-1
3153 TTTGGTTGTCATCAGC-1
3153 rows × 1 columns
I need it to have an actual column to be able to add some metadata to 100PDXT.obs, but as it has 0 columns, I can't do anything with it.
How to read the count matrix properly, so the anndata.obs has an actual column of cell names?