[ENH]: Support "xi" correlation metric for functional connectivity #333

Merged
synchon merged 17 commits from feat/xi-correlation-fc into main 2025-04-01 12:02:43 +00:00
synchon commented 2025-03-18 16:22:40 +00:00 (Migrated from github.com)

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

Which feature do you want to include?

Adapt https://github.com/czbiohub-sf/xicor to be used as a correlation metric for functional connectivity markers.

How do you imagine this integrated in junifer?

As an option for nilearn's ConnectivityMeasure.

Do you have a sample code that implements this outside of junifer?

https://github.com/czbiohub-sf/xicor

Anything else to say?

No response

### Are you requiring a new dataset or marker? - [X] I understand this is not a marker or dataset request ### Which feature do you want to include? Adapt https://github.com/czbiohub-sf/xicor to be used as a correlation metric for functional connectivity markers. ### How do you imagine this integrated in junifer? As an option for nilearn's ConnectivityMeasure. ### Do you have a sample code that implements this outside of junifer? ```shell https://github.com/czbiohub-sf/xicor ``` ### Anything else to say? _No response_
synchon commented 2025-03-18 16:40:00 +00:00 (Migrated from github.com)

Went with https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chatterjeexi.html#chatterjeexi as it doesn't require adding a new dependency to the project and eases the burden of maintenance.

Went with https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chatterjeexi.html#chatterjeexi as it doesn't require adding a new dependency to the project and eases the burden of maintenance.
fraimondo commented 2025-03-18 16:40:57 +00:00 (Migrated from github.com)

If the implementation is the same, then off we go!

I think we needed to allow for custom metrics for this to happen.

If the implementation is the same, then off we go! I think we needed to allow for custom metrics for this to happen.
synchon commented 2025-03-18 16:43:25 +00:00 (Migrated from github.com)

If the implementation is the same, then off we go!

Implementation is exact and tuned for scipy which is a win.

I think we needed to allow for custom metrics for this to happen.

The custom object is JuniferConnectivityMeasure which is in main for quite some time now. It also enabled us to add Spearman's correlation.

> If the implementation is the same, then off we go! Implementation is exact and tuned for scipy which is a win. > I think we needed to allow for custom metrics for this to happen. The custom object is `JuniferConnectivityMeasure` which is in main for quite some time now. It also enabled us to add Spearman's correlation.
codecov[bot] commented 2025-03-18 17:02:09 +00:00 (Migrated from github.com)

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.77%. Comparing base (621e056) to head (ad32c59).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
+ Coverage   85.74%   85.77%   +0.03%     
==========================================
  Files         133      133              
  Lines        5663     5675      +12     
  Branches      959      962       +3     
==========================================
+ Hits         4856     4868      +12     
  Misses        618      618              
  Partials      189      189              
Flag Coverage Δ
junifer 85.77% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...r/external/nilearn/junifer_connectivity_measure.py 93.49% <100.00%> (+0.63%) ⬆️
...ional_connectivity/functional_connectivity_base.py 96.66% <100.00%> (+0.11%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
## [Codecov](https://app.codecov.io/gh/juaml/junifer/pull/333?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report All modified and coverable lines are covered by tests :white_check_mark: > Project coverage is 85.77%. Comparing base [(`621e056`)](https://app.codecov.io/gh/juaml/junifer/commit/621e05625286f6b6f446894c481108834c33546b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) to head [(`ad32c59`)](https://app.codecov.io/gh/juaml/junifer/commit/ad32c5929a4f4700af744aa7012de62ec4200009?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml). <details><summary>Additional details and impacted files</summary> [![Impacted file tree graph](https://app.codecov.io/gh/juaml/junifer/pull/333/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://app.codecov.io/gh/juaml/junifer/pull/333?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #333 +/- ## ========================================== + Coverage 85.74% 85.77% +0.03% ========================================== Files 133 133 Lines 5663 5675 +12 Branches 959 962 +3 ========================================== + Hits 4856 4868 +12 Misses 618 618 Partials 189 189 ``` | [Flag](https://app.codecov.io/gh/juaml/junifer/pull/333/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [junifer](https://app.codecov.io/gh/juaml/junifer/pull/333/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `85.77% <100.00%> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/juaml/junifer/pull/333?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [...r/external/nilearn/junifer\_connectivity\_measure.py](https://app.codecov.io/gh/juaml/junifer/pull/333?src=pr&el=tree&filepath=junifer%2Fexternal%2Fnilearn%2Fjunifer_connectivity_measure.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9leHRlcm5hbC9uaWxlYXJuL2p1bmlmZXJfY29ubmVjdGl2aXR5X21lYXN1cmUucHk=) | `93.49% <100.00%> (+0.63%)` | :arrow_up: | | [...ional\_connectivity/functional\_connectivity\_base.py](https://app.codecov.io/gh/juaml/junifer/pull/333?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Ffunctional_connectivity_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X2Jhc2UucHk=) | `96.66% <100.00%> (+0.11%)` | :arrow_up: | </details> <details><summary> :rocket: New features to boost your workflow: </summary> - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems. </details>
github-actions[bot] commented 2025-03-18 17:05:03 +00:00 (Migrated from github.com)
PR Preview Action v1.6.0

🚀 View preview at
https://juaml.github.io/junifer/pr-preview/pr-333/

Built to branch gh-pages at 2025-04-01 10:43 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.6.0 :---: | <p></p> :rocket: View preview at <br> https://juaml.github.io/junifer/pr-preview/pr-333/ <br><br> | <h6>Built to branch [`gh-pages`](https://github.com/juaml/junifer/tree/gh-pages) at 2025-04-01 10:43 UTC. <br> Preview will be ready when the [GitHub Pages deployment](https://github.com/juaml/junifer/deployments) is complete. <br><br> </h6> <!-- Sticky Pull Request Commentpr-preview -->
fraimondo (Migrated from github.com) approved these changes 2025-03-28 08:35:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!333
No description provided.