Exporting Raw counts into .csv file from seurat object
1
0
Entering edit mode
4.6 years ago
David_emir ▴ 500

Hi All,

I need to save Raw counts into .csv file from my Seurat object, I have tried the following code but it is not working for me

expr_raw <- GetAssayData(object = alldata, assay.type = "RNA", slot = "counts")
expr <- as(Class = 'matrix', object = expr_raw)

It gives the following error

Error in asMethod(object) : 
  Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 105

Kindly help me to save the raw counts from my Seurat object into a CSV file.

thanks a lot and have a great day ahead,

Dave

seurat raw counts csv • 20k views
ADD COMMENT
0
Entering edit mode

Hey Dave, strange error message, but it seems to have been reported a lot. Can you check the other queries about it via your search engine of choice and then report back here to help us?

ADD REPLY
5
Entering edit mode
4.5 years ago
ccruizm.mv ▴ 50

Hi there,

This is how I do it. Hope it helps

write.table(as.matrix(GetAssayData(object = seurat.obj, slot = "counts")), 
            '/your/path/to/store/csv/counts.csv', 
            sep = ',', row.names = T, col.names = T, quote = F)
ADD COMMENT
0
Entering edit mode

Thank you for posting the soluation

ADD REPLY
0
Entering edit mode

thank you. it worked but it provides the counts per cell per ADT and I do not know how to have those counts per conditions or per sample. would highly appreciate any help .

ADD REPLY

Login before adding your answer.

Traffic: 2274 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6