ebi-gene-expression-group / scanpy-scripts

Scripts for using scanpy
Apache License 2.0
29 stars 13 forks source link

Allow annData output from plotting functions. #95

Closed pinin4fjords closed 3 years ago

pinin4fjords commented 3 years ago

(related to https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/pull/224)

This PR addresses an issue with PAGA initialisation of FDG layouts. This requires .uns['paga']['pos'] to be set, which happens in sc.pl.paga() rather than sc.tl.paga(). Since the CLI currently only outputs the plot file from the PAGA plotting, we can't generate an object with the correct slots populated to run FDG with PAGA initialisation.

My solution is just to allow an optional object output from the plotting functions. I've only enabled it for PAGA, but it could be used in future with other plotting functions that change the object content. I've also rearranged the tests to demonstrate the PAGA -> FDG.

The alternate solution would have been to change the PAGA wrapper to run sc.pl.paga and populate the 'pos' slot, but the above solution is neater I think.

Edit: also a couple of tweaks to the build env to keep Multicore t-sne happy.

pcm32 commented 3 years ago

Could you please provide a sample anndata to Wendi so that she can try it in the upstream Galaxy tool to check that it does what she needs? Thanks!

pinin4fjords commented 3 years ago

@nomadscientist here's an example object output from the paga plotting function. I've checked and .uns['paga']['pos'] is correctly set.

paga_k10_r0_7.h5ad.zip

pinin4fjords commented 3 years ago

Thanks @pcm32 for review, release coming shortly.