-
Notifications
You must be signed in to change notification settings - Fork 594
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
Will scanpy implement ICA? #767
Comments
Could you tell us about how you've found it useful, or point us towards some literature on it being used? I think this would be easy enough to implement, but when I tried a naive implementation the results weren't that compelling. It's very possible I should've played around with the parameters more. @flying-sheep, do you have thoughts on this? Here's a simple implementation: def ica(adata, n_components, inplace=True, **kwargs):
from sklearn.decomposition import FastICA
ica_transformer = FastICA(n_components=n_components, **kwargs)
x_ica = ica_transformer.fit_transform(adata.X)
if inplace:
adata.obsm["X_ica"] = x_ica
adata.varm["ICs"] = ica_transformer.components_.T
else:
return ica_transformer |
Hi ! We made use of Seurat implementation.. and I tried fastICA from sklearn once but I couldn't obtain similar results... I have not looked thoroughly into seurat's code tough... Hope it helps ! |
Thank you both. In terms of literature, see this paper (PMID: 30096299), in particular Figure S2 |
I looked through the R |
@chris-rands Any update on this? Does the code from @ivirshup gives you any meaningful results? |
BTW there is a nice "Faster ICA" algorithm now, called Picard. It's implemented as a python package here: https://pierreablin.github.io/picard/generated/picard.picard.html#picard.picard It might be worthwhile to try this too. |
@gokceneraslan, got around to giving |
Thanks for the feedback and sorry for the delay. The code snippet using |
Hi, I tried the snippet, with fastICA and picard, and with a number of cells higher than 30,000, the whitening step cannot be completed. This seems be due to some Lapack limitations. |
Sorry for the late response, completley forgot to post my response here. @Fougere87, did that whitening issue occur with picard as well? I saw that with sklearn. I think we could get around that by whitening ourselves with ARPACK. Picard and sklearn look pretty similar to me in a quick comparison. Below are top 16/30 components (ranked by Geary's C, autocorrelation on the connectivity graph) cell loadings on the pbmc3k dataset. The umap and connectivity matrix here were computed on top of a PCA – which I should maybe do differently. However I think the results are similar enough that it's probably not of consequence. |
Are there plans to include independent component analysis (ICA) in Scanpy? This would be useful for me. I know that it is already implemented in Seurat. Thank you
The text was updated successfully, but these errors were encountered: