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

Feature/exe 1884 make community detection deterministic #176

Closed

Conversation

ptajvar
Copy link
Contributor

@ptajvar ptajvar commented Jul 31, 2024

Setting a random seed for leiden algorithm so that component IDs remain constant through multiple runs of pipeline.

Fixes: #EXE-1884

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

PR checklist:

  • This comment contains a description of changes (with reason).
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.78%. Comparing base (0135fb5) to head (51b4d5b).

Files Patch % Lines
src/pixelator/annotate/__init__.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #176   +/-   ##
=======================================
  Coverage   81.78%   81.78%           
=======================================
  Files         121      121           
  Lines        6795     6795           
=======================================
  Hits         5557     5557           
  Misses       1238     1238           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ptajvar ptajvar force-pushed the feature/exe-1884-make-community-detection-deterministic branch from 51b4d5b to 0c964e5 Compare August 27, 2024 10:33
@ptajvar ptajvar marked this pull request as ready for review August 30, 2024 12:09
@ptajvar ptajvar requested a review from johandahlberg August 30, 2024 12:09
Copy link
Contributor

@johandahlberg johandahlberg left a comment

Choose a reason for hiding this comment

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

This looks good to me. Great work!

Copy link
Contributor

@ambarrio ambarrio left a comment

Choose a reason for hiding this comment

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

A couple of comments but nothing major. Please, read my comments on the ticket.

@@ -221,7 +221,7 @@ def annotate_components(
# components clustering
if adata.n_obs > MINIMUM_NBR_OF_CELLS_FOR_ANNOTATION:
# perform the unsupervised clustering
cluster_components(adata=adata, inplace=True)
cluster_components(adata=adata, inplace=True, random_seed=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

why the different random_seed here and in _networkx?

@@ -305,6 +305,7 @@ def community_leiden(
graph,
use_modularity=True,
randomness=beta,
random_seed=42,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the same see everywhere? i.e. 1477 :)

@ptajvar
Copy link
Contributor Author

ptajvar commented Sep 18, 2024

Superseded by PR 188.

@ptajvar ptajvar closed this Sep 18, 2024
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.

3 participants