Repository navigation
Add MAGIC API - #193
Add MAGIC API#193
Conversation
|
Looks good! Thanks! 😄 |
Just read this again. Right. This is not a good solution. Let met think about. |
|
One option is to not allow using to request a gene subset with MAGIC from Scanpy, but I don't particularly like that as the returned data is forcibly dense and could be extremely large. Alternatively, I could return a new AnnData object (force copy=True) with var_names corresponding to the genes that were returned. |
|
I'd say that the second option is very viable for the task of imputation, which is a bit different than all other tools - instead of "adding" annotation, one replaces the whole data matrix. So, I'd say, if you do not want to impute the whole data matrix as is, one should return a new AnnData for the wished gene selection. Now the only problem is that people might get confused because magic doesn't do an inplace operation in this case. So I'd leave Sounds like a good solution to me. |
MAGIC API modelled off the DCA API. A couple of comments:
threadston_jobsto matchsc.tlAPIsc.settings.verbosityrather thanFalseforverbosedefaultname_list.Re:
name_list: MAGIC accepts both gene names and column indices. I've set it up currently to return to adata.obsm['X_magic'] if genes are specified as the number of columns is reduced from the original data, and to adata.X if all genes are returned. However, adata.obsm['X_magic'] now has no information about the order of the genes, unless I return it from MAGIC as apandas.DataFrame, or as an AnnData object in its own right. What do you think?P.S. MAGIC handling
geneson AnnData input is currently on the dev branch, but will be merged to master once we settle on an API.