carmonalab / ProjecTILs

Interpretation of cell states using reference single-cell maps
GNU General Public License v3.0
234 stars 27 forks source link

Cycling score #24

Closed JLTrincado closed 2 years ago

JLTrincado commented 2 years ago

Dear authors,

congrats on this awesome utility. I'm wondering if you have implemented the calculation of the cycling score on ProjectTILs as with TILPRED. I have not seen ProjectTILs return this value.

Thanks for your time.

Best,

Juan L.

mass-a commented 2 years ago

Hi Juan, yes a cycling score is available in the "cycling.score" metadata column of the object returned by ProjecTILs, and it is currently calculated with the same cycling signature used by TILPRED.

We will release soon version 2.0 of ProjecTILs (you can already try it in the 'dev' branch), where cycling scores are calculated using UCell and the signatures from Tirosh et al. (2016) for the G1/S and G2/M phases.

Best -m

JLTrincado commented 2 years ago

Hi Massimo,

thanks for the quick response.

That is great. I was testing it and I still do not see this cycling.score in the metadata. I'm working with human data. Maybe this is only returned with mouse data?

Thanks again.

Best,

Juan L.

mass-a commented 2 years ago

Ah I see, the cycling scores are only calculated if you use the automatic filter. If you disable the filter with filter.cells=FALSE then the cycling scores won't be available.

More generally you can always calculate cycling scores externally, for example using the UCell package. Here is an example for adding cycling scores for human cells in a Seurat object:

#download file with signatures (Tirosh et al.)
cycling.sign.csv <- "tirosh_cellCycle_sign.csv"
dataUrl <- "https://drive.switch.ch/index.php/s/ZlsjR6S5Z0cPISp/download"
download.file(dataUrl, cycling.sign.csv)

#read signatures into memory
cycling.signatures <- as.list(read.csv(cycling.sign.csv))

#remove empty elements
cycling.signatures <- lapply(cycling.signatures, function(x){x[x!=""]})

#Add signature scores to Seurat object (UCell scores)
remotes::install_github("carmonalab/UCell")
library(UCell)
seurat.object <- AddModuleScore_UCell(seurat.object, features=cycling.signatures)

#Cycling scores will be in columns G1.S_UCell and G2.M_UCell
head(seurat.object$G1.S_UCell)

I hope this helps. -m

JLTrincado commented 2 years ago

Hi again,

Yes, seems easier with UCell. I'll go with it.

Thanks a lot for your time and congrats again.

Best,

Juan L.