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

Add support for publication size weighting. General refactoring of IBMA estimators #887

Merged
merged 20 commits into from
May 29, 2024

Conversation

JulioAPeraza
Copy link
Collaborator

Closes None.

Changes proposed in this pull request:

  • Add for publication size weighting with a new parameter use_group_size.
  • In addition, we perform a general refactoring of IBMA estimators to remove duplicate code and reduce the memory in the estimator.

@JulioAPeraza JulioAPeraza added enhancement New feature or request refactoring Requesting changes to the code which do not impact behavior ibma Issues/PRs pertaining to image-based meta-analysis labels May 23, 2024
Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.19%. Comparing base (d95c18b) to head (8fc8030).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
+ Coverage   88.17%   88.19%   +0.02%     
==========================================
  Files          48       48              
  Lines        6374     6335      -39     
==========================================
- Hits         5620     5587      -33     
+ Misses        754      748       -6     

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

@JulioAPeraza JulioAPeraza marked this pull request as ready for review May 24, 2024 18:38
@JulioAPeraza JulioAPeraza requested a review from jdkent May 24, 2024 21:00
Copy link
Member

@jdkent jdkent left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple details

I'm trying to think if there would be a case when a contrast wouldn't be included in the actual meta-analysis (e.g., didn't have the correct images for that particular algorithm, or was otherwise filtered from the analysis), but the re-weighing would correct the values as though that contrast was included.

@@ -320,6 +320,9 @@ class Stouffers(IBMAEstimator):
Whether to use sample sizes for weights (i.e., "weighted Stouffer's") or not,
as described in :footcite:t:`zaykin2011optimally`.
Default is False.
use_group_size : :obj:`bool`, optional
Copy link
Member

Choose a reason for hiding this comment

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

I'm having second thoughts about use_group_size, group may be more ambiguous than what we are using the variable for. group could mean:

  1. patient/control group
  2. a group of papers about shizophrenia versus depression

whereas we are using group to mean specifically the number of analyses (contrasts) within a study.

use_group_size could be renamed to normalize_contrast_weights

and group_size to num_contrasts

and group to contrast_names

I think that is more aligned with what the variables are doing.

unless the labels serve more functions than identifying contrasts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I 100% agree! I will make the changes in a bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm trying to think if there would be a case when a contrast wouldn't be included in the actual meta-analysis (e.g., didn't have the correct images for that particular algorithm, or was otherwise filtered from the analysis), but the re-weighing would correct the values as though that contrast was included.

In the new _preprocess_input in Stouffers, the number of contrasts is estimated from self.inputs_["id"], so any excluded images will also be excluded from the count.

Copy link
Member

@jdkent jdkent left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @JulioAPeraza!

@jdkent jdkent merged commit 2f0fa61 into neurostuff:main May 29, 2024
20 checks passed
@JulioAPeraza JulioAPeraza deleted the ibma-weighting branch May 29, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ibma Issues/PRs pertaining to image-based meta-analysis refactoring Requesting changes to the code which do not impact behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants