Entering edit mode
3.2 years ago
rb56
▴
30
Hi,
I'm trying to export the log normalized count data from Seurat in to a .csv file and get the following error:
library (Seurat)
fib.data <- subset(onlyharmonfib, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mito <5)
fib.data_norm<- NormalizeData(fib.data)
fib_count <- GetAssayData(object = fib.data_norm, assay = "RNA", slot = "data")
write.csv(as.matrix(fib_count), file = "file_path", quote = FALSE)
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
Is there an easier method to get the data in a .csv file?
Thank you for your help!
instead of the argument in write.csv
file = "file_path"
, you probably meantfile = file_path
without the quotes as an object with your path and filename stored, that's why write.csv doesn't know which file to write into; but rpolicastro is absolutely right, data.table will be so much faster for this purpose