rezakj / iCellR

Single (i) Cell R package (iCellR) is an interactive R package to work with high-throughput single cell sequencing technologies (i.e scRNA-seq, scVDJ-seq, scATAC-seq, CITE-Seq and Spatial Transcriptomics (ST)).
120 stars 19 forks source link

Transform my seurat object into iCellR #26

Open pabloatria18 opened 3 years ago

pabloatria18 commented 3 years ago

Hello, Is there a way of transforming my final Seurat object (after all the QC, Batch alignment and Clustering) into iCellR? There is some information I would like to obtain but I can't get it from the Seurat vignettes (like Cell cycle pie graph, Graph bar illustrating the change between conditions in one cluster, among others).

I appreciate the help

rezakj commented 3 years ago

Yes, read this issue: https://github.com/rezakj/iCellR/issues/19

pabloatria18 commented 3 years ago

Thanks Reza! I could do it, but I am not being able to transfer the condition and clusters into the iCellR object. Also, you advise running the analysis again using iCellR, you mean running the whole raw data again with iCellR instead of transferring from Seurat?

rezakj commented 3 years ago

You can, but the only thing is that iCellR identifies the conditions in the barcode/cell id (column names in the main.data slot and row names in the tSNE data). A few ways to do this but here are some of the easier options:
1: modify the barcode names for tSNE data and main data. 2: replace the cluster numbers with the condition names (so that the clusters are actually your conditions.) 3: this option might not be so convenient for you but to avoid options 1 and 2 you need to run everything from the start using iCellR.

pabloatria18 commented 3 years ago

Thanks! Is there any way of maintaining the colors when plotting? For example, When I do:

clust.stats.plot(my.obj, plot.type = "pie.cc", interactive = F, conds.to.plot = "Control") clust.stats.plot(my.obj, plot.type = "pie.cc", interactive = F, conds.to.plot = "Loaded")

I get different colors for the cell cycle phases

rezakj commented 3 years ago

Almost all the plots in iCellR are ggplot2. So just make the plot object like this:

My.plot <- clust.stats.plot(my.obj, plot.type = "pie.cc", interactive = F, conds.to.plot = "Control")

Then "My.plot" is your plot object you then just need to add "+" manual colors.

Here are some examples: http://www.sthda.com/english/wiki/ggplot2-colors-how-to-change-colors-automatically-and-manually