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

fixes dendrogram issue #1228 #1614

Merged
merged 9 commits into from Feb 10, 2021
Merged

fixes dendrogram issue #1228 #1614

merged 9 commits into from Feb 10, 2021

Conversation

fidelram
Copy link
Collaborator

The PR uses 1-correlation as distance matrix to compute the dendrogram as suggested in #1288 and mentioned in scverse/squidpy#236

I opted for the minimal changes to the code. Other solution would be to use scipy.spatial.distance.pdist that allows a larger number of distance metrics. I am open for a discussion on this topic (ping @michalk8)

@fidelram fidelram requested a review from giovp January 30, 2021 07:50
@giovp
Copy link
Member

giovp commented Jan 31, 2021

Hi @fidelram !
looks good yes, with distance.squareform you are essentially transforming the corr in a condensed distance matrix right? and that's what pdist also passes. So I think it looks good now!
Another option would have been to pass mean_df.T directly to linkage, but I understand wanting to keep correlation as distances.

@fidelram
Copy link
Collaborator Author

fidelram commented Feb 1, 2021

Hi @giovp, basically I mimic the what the linkage code would do internally when the first argument is not a distance. Because the correlation matrix is used for sc.tl.correlation_matrix it is kept.

@giovp
Copy link
Member

giovp commented Feb 1, 2021

Makes sense! Thanks it's clear now why the corr matrix

@ivirshup ivirshup self-requested a review February 2, 2021 02:21
Copy link
Member

@ivirshup ivirshup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this get:

  • Bugfix release note
  • Links to issues that should be closed by this

@ivirshup ivirshup added this to the 1.7.1 milestone Feb 3, 2021
@fidelram
Copy link
Collaborator Author

fidelram commented Feb 9, 2021

Issues that should be closed:

@ivirshup ivirshup self-requested a review February 10, 2021 06:43
@ivirshup ivirshup merged commit abfaef4 into master Feb 10, 2021
@ivirshup
Copy link
Member

@meeseeksdev backport to 1.7.x

@ivirshup
Copy link
Member

@fidelram, in future, if you add a line like:

Fixes #x, #y

To the initial comment in a PR, those issues will automatically be closed when the PR is merged. I think you can also link PRs to issues with the "Linked issues" element in the righthand sidebar. Using these makes it easier to tell which issues have been addressed already.

ivirshup pushed a commit that referenced this pull request Feb 10, 2021
Co-authored-by: Fidel Ramirez <fidel.ramirez@gmail.com>
@gokceneraslan gokceneraslan deleted the fix_dendrogram branch March 16, 2021 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants