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

groupby is converted to a list before adding as dendrogram key #1465

Merged
merged 7 commits into from Oct 24, 2020

Conversation

mukundvarma
Copy link
Contributor

Right now, if you specify groupby to sc.tl.dendrogram, but not dendrogram_key, storage (and subsequent retrieval) from adata.uns is messed up because groupby is converted from str --> list during computation.

To give a more concrete example, if my groupby variable was "cell_subtype", I would expect it to be stored in adata.uns as "dendrogram_cell_subtype". However, because of the list conversion it's stored as "dendrogram_['cell_subtype']" (shown below)

image

This PR attempts to address that. I'm not sure if this is the way you want to go about fixing it, but it's one option.

Thanks for the great package!

scanpy/tools/_dendrogram.py Outdated Show resolved Hide resolved
@gokceneraslan
Copy link
Collaborator

Thanks, looks good.

@gokceneraslan gokceneraslan merged commit 256f594 into scverse:master Oct 24, 2020
@mukundvarma mukundvarma deleted the patch-1 branch November 21, 2020 04:11
@ivirshup ivirshup added the Maint – Backport needed Needs back porting for bugfix release label Dec 7, 2020
@ivirshup ivirshup removed the Maint – Backport needed Needs back porting for bugfix release label Jan 24, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants