iCellR icon indicating copy to clipboard operation
iCellR copied to clipboard

Transform my seurat object into iCellR

Open pabloatria18 opened this issue 3 years ago • 5 comments

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

pabloatria18 avatar Dec 06 '20 20:12 pabloatria18

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

rezakj avatar Dec 07 '20 00:12 rezakj

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?

pabloatria18 avatar Dec 07 '20 01:12 pabloatria18

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.

rezakj avatar Dec 07 '20 17:12 rezakj

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

pabloatria18 avatar Dec 08 '20 16:12 pabloatria18

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

rezakj avatar Dec 08 '20 21:12 rezakj