Open SaraVilla opened 5 years ago
library(loomR) lfile <- connect(filename = "l6_r4_spinal_cord_inhibitory_neurons.agg.loom", mode = "r+") lfile lfile[["col_attrs"]] lfile[["row_attrs"]]
numbers_df<-as.data.frame(lfile[["matrix"]][, ])
numbers_df_t<-t(numbers_df)
genes<-lfile[["row_attrs/Gene"]][] accession<-lfile[["row_atters/Accession"]][]
dataset<-cbind(genes, numbers_df_t) write.csv(dataset, file="SingleCellSCinhbTrans.csv")
How can I get the columns identified by cluster?
thanks!
Hi, I am trying to work with the aggregated loom files. I have managed to convert to a .csv file the loom file, but it's missing the identification of the different clusters. My code is the following:
library(loomR) lfile <- connect(filename = "l6_r4_spinal_cord_inhibitory_neurons.agg.loom", mode = "r+") lfile lfile[["col_attrs"]] lfile[["row_attrs"]]
make the matrix into a dataframe
numbers_df<-as.data.frame(lfile[["matrix"]][, ])
transpose so columns becomes cells and rows becomes genes
numbers_df_t<-t(numbers_df)
make gene names and accessions into a vector (THIS STEP DOESN'T WORK)
genes<-lfile[["row_attrs/Gene"]][] accession<-lfile[["row_atters/Accession"]][]
add them to the numbers_df_t
dataset<-cbind(genes, numbers_df_t) write.csv(dataset, file="SingleCellSCinhbTrans.csv")
How can I get the columns identified by cluster?
thanks!