icbi-lab / infercnvpy

Infer copy number variation (CNV) from scRNA-seq data. Plays nicely with Scanpy.

Home Page:https://infercnvpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function to classify malignant/non-malignant cells

rgranit opened this issue · comments

Have you considered adding a function that would classify cells into malignant/non-malignant similar to inferCNA 'findMalignant' function?

This looks interesting, thanks for the link!

As far as I understood they essentially compute the correlation between CNV profiles for each cell and try to fit a bimodal distribution (where one mode represents malignant cells and the other mode normal cells)?

I'm wondering how well that works... I have seen quite strong cell-type biases as well in the datasets I ran infercnvpy on.

Yes, I believe your description of the function is correct. I've attempted to reproduce the plots that they generate using infercnvpy:

adata.obs["cnv_corr"] = 0
df=pd.DataFrame.sparse.from_spmatrix(adata.obsm['X_cnv'])
adata.obs["cnv_corr"] = df.corrwith(df.mean(),axis=1).values

This is how the plot looks like:

image

In red I've colored cells which I believe to be tumor. Next I've used GaussianMixture to try and find bimodal clusters and worked reasonably well for some datasets, but not all and in assumes n=2 which is not always the case.

Happy for any thoughts or inputs