Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to classify malignant/non-malignant cells #11

Open
rgranit opened this issue May 3, 2021 · 2 comments
Open

Function to classify malignant/non-malignant cells #11

rgranit opened this issue May 3, 2021 · 2 comments

Comments

@rgranit
Copy link
Contributor

rgranit commented May 3, 2021

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

@grst
Copy link
Member

grst commented May 4, 2021

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.

@rgranit
Copy link
Contributor Author

rgranit commented May 4, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants