Exporting Raw counts into .csv file from seurat object
1
0
Entering edit mode
17 months ago
David_emir ▴ 390

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 • 6.8k 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
3
Entering edit mode
16 months ago
ccruizm.mv ▴ 30

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

Login before adding your answer.

Traffic: 1202 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