maximilianh / cellBrowser

main repo: https://github.com/ucscGenomeBrowser/cellBrowser/ - Python pipeline and Javascript scatter plot library for single-cell datasets, http://cellbrowser.rtfd.org
https://github.com/ucscGenomeBrowser/cellBrowser/
GNU General Public License v3.0
105 stars 42 forks source link

Cellbrowser does not respect scanpy's naming flexibility if rank_genes_groups in scanpyToCellbrowser function #94

Closed flatberg closed 5 years ago

flatberg commented 5 years ago

The scanpyToCellbrowser function assumes marker list is given by key 'rank_genes_groups' in data.uns. However scanpy's function 'rank_genes_groups' may add any chosen key by argument 'key_added' (as is used in e.g. scanpy's best practices, https://github.com/theislab/single-cell-tutorial). This leads to the error of 'Couldnt find cluster markers list'. scanpy: 1.4 cellbrowser: v0.4.38

maximilianh commented 5 years ago

I see. So we would need an additional optional argument where you can specify the name of the marker genes key, correct?

On Mon, Apr 8, 2019 at 2:45 PM Arnar Flatberg notifications@github.com wrote:

The scanpyToCellbrowser function assumes marker list is given by key 'rank_genes_groups' in data.uns. However scanpy's function 'rank_genes_groups' may add any chosen key by argument 'key_added' (as is used in e.g. scanpy's best practices, https://github.com/theislab/single-cell-tutorial). This leads to the error of 'Couldnt find cluster markers list'. scanpy: 1.4 cellbrowser: v0.4.38

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/maximilianh/cellBrowser/issues/94, or mute the thread https://github.com/notifications/unsubscribe-auth/AAS-TTDHSz2f0eThNnL6A_i2Pe0_UsCHks5veznSgaJpZM4ciFvx .

flatberg commented 5 years ago

As far as I can see adding an optional arg would be good. Anything to generalize the line (L2970, cellbrowser.py): if 'rank_genes_groups' not in adata.uns:

maximilianh commented 5 years ago

I've made a change to allow this now. scanpyToCellbrowser now has an additional parameter "markerField" which defaults to rank_genes_groups if not specified. cbImportScanpy has an additional argument --markerField with the same default. It's now on Pip as release 0.5.5. Can you do a pip install cellbrowser --upgrade and test if this solves your problem? I'll close the ticket for now, as I was able to at least get an error message when I changed this argument and it doesn't seem to require a lot of testing.

Can I ask why in your application you need to change the name of the marker genes field? Did you create the files with a different software? Or do you need multiple marker gene sets?

Either way, many thanks for your feedback. Feel free to open more tickets if you find something else that could be better.

On Mon, Apr 8, 2019 at 4:21 PM Arnar Flatberg notifications@github.com wrote:

As far as I can see adding an optional arg would be good. Anything to generalize the line (L2970, cellbrowser.py): if 'rank_genes_groups' not in adata.uns:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maximilianh/cellBrowser/issues/94#issuecomment-480852335, or mute the thread https://github.com/notifications/unsubscribe-auth/AAS-TQfTTwmz7T6CXwtfFAzDzjkqyKGoks5ve1B5gaJpZM4ciFvx .