broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
566 stars 166 forks source link

inferCNV score #609

Open pmarzano97 opened 1 year ago

pmarzano97 commented 1 year ago

Hello world! I'm trying to generate a CNV score, as reported in several studies. In this GitHub page is reported a similar topic: https://github.com/broadinstitute/infercnv/issues/393

In the paper they mentioned, they have written "For each sample, gene expression of cells was re-standardized and value were limited as -1 to 1. The CNV score of each cell was calculated as quadratic sum of CNV region". I've found that the CNV gene expression of the object generated is located the infercnv_obj@expr.data slot, where on the column there are the cells and on the row the gene names. But how is it possible to scale the gene expression values between -1 and 1? I've also tried to extract these gene counts and to generate a SeuratObject and run the ScaleData function: I was able to scale the data but not between -1 and 1.

And after the scaling of values, the score in then calculated for each cell on the quadratic sum of the scaled value of the genes in the matrix, or in another way?

Thanks for the help!!!!

andynkili commented 1 year ago

HI @pmarzano97 ,

I'm not part of the dev team, but hopefully this answer can help you. In the final "infercnv.png", you can see that the values are centered at 1. You can first center the values at 0 (so positive values are gains and negative ones are losses), and then calculate the score as quadratic sums of CNV region:

ge <- infercnv_obj@expr.data
ge <- ge - 1
ge <- ge^2

Best, Andy