neurocombat

Harmonization of multi-site imaging data with ComBat (Python)

https://github.com/jfortin1/neurocombat

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: sciencedirect.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

combat harmonization mri-images multi-site-imaging neuroimaging normalization python

Keywords from Contributors

grna-sequence
Last synced: 6 months ago · JSON representation

Repository

Harmonization of multi-site imaging data with ComBat (Python)

Basic Info
  • Host: GitHub
  • Owner: Jfortin1
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 43 KB
Statistics
  • Stars: 133
  • Watchers: 3
  • Forks: 36
  • Open Issues: 16
  • Releases: 0
Topics
combat harmonization mri-images multi-site-imaging neuroimaging normalization python
Created almost 6 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

Multi-site harmonization in Python with neuroCombat

License: MIT Version PythonVersion

This is the maintained and official version of neuroCombat (previously hosted here) introduced in our our recent paper.

Installation

neuroCombat is hosted on PyPI, and the easiest way to install neuroCombat is to use the pip command:

pip install neuroCombat

Usage

The neuroCombat function performs harmonization

```python from neuroCombat import neuroCombat import pandas as pd import numpy as np

Getting example data

200 rows (features) and 10 columns (scans)

data = np.genfromtxt('testdata/testdata.csv', delimiter=",", skip_header=1)

Specifying the batch (scanner variable) as well as a biological covariate to preserve:

covars = {'batch':[1,1,1,1,1,2,2,2,2,2], 'gender':[1,2,1,2,1,2,1,2,1,2]} covars = pd.DataFrame(covars)

To specify names of the variables that are categorical:

categorical_cols = ['gender']

To specify the name of the variable that encodes for the scanner/batch covariate:

batch_col = 'batch'

Harmonization step:

datacombat = neuroCombat(dat=data, covars=covars, batchcol=batchcol, categoricalcols=categorical_cols)["data"] ```

Optional arguments

  • eb : True or False. Should Empirical Bayes be performed? If False, the harmonization model will be fit for each feature separately. This is equivalent to performing a location/shift (L/S) correction to each feature separately (no information pooling across features).

  • parametric : True or False. Should parametric adjustements be performed? True by default.

  • mean_only : True or False. Should only be means adjusted (no scaling)? False by default

  • ref_batch : batch name to be used as the reference batch for harmonization. None by default, in which case the average across scans/images/sites is taken as the reference batch.

Output

Since version 0.2.10, the neuroCombat function outputs a dictionary with 3 elements: - data: A numpy array of the harmonized data, with the same dimension (shape) as the input data. - estimates: A dictionary of the neuroCombat estimates; useful for visualization and understand scanner effects. - info: A dictionary of the inputs needed for ComBat harmonization (batch/scanner information, etc.)

To simply return the harmonized data, one can use the following:

data_combat = neuroCombat(dat=dat, ...)["data"]

where ... are the user-specified arguments needed for harmonization.

Owner

  • Name: Jean-Philippe Fortin
  • Login: Jfortin1
  • Kind: user
  • Location: San Francisco
  • Company: Genentech

Senior Principal Scientist @ Genentech

GitHub Events

Total
  • Issues event: 4
  • Watch event: 27
  • Issue comment event: 7
  • Pull request event: 1
  • Fork event: 1
Last Year
  • Issues event: 4
  • Watch event: 27
  • Issue comment event: 7
  • Pull request event: 1
  • Fork event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 32
  • Total Committers: 3
  • Avg Commits per committer: 10.667
  • Development Distribution Score (DDS): 0.344
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jean-Philippe Fortin f****e@g****m 21
Jean-Philippe Fortin f****6@g****m 10
Tim t****f@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 21
  • Total pull requests: 10
  • Average time to close issues: 4 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 18
  • Total pull request authors: 10
  • Average comments per issue: 1.1
  • Average comments per pull request: 0.9
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 3
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ggbioing (2)
  • MengxiaGAO (2)
  • Melissa1909 (2)
  • wiegertj (1)
  • shrimpj (1)
  • gourdchen (1)
  • diegoaper (1)
  • Lieke2306 (1)
  • xuesongwang (1)
  • Jfortin1 (1)
  • allucas (1)
  • fluese (1)
  • pedrob37 (1)
  • AmericaBG (1)
  • ilariagabusi (1)
Pull Request Authors
  • Terf (1)
  • kwagstyl (1)
  • hokifung (1)
  • Jfortin1 (1)
  • dependabot[bot] (1)
  • sahahn (1)
  • swwalsh (1)
  • felixdumais (1)
  • smkia (1)
  • tao558 (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 821 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 15
  • Total maintainers: 1
pypi.org: neurocombat

ComBat algorithm for harmonizing multi-site imaging data

  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 821 Last month
Rankings
Forks count: 7.1%
Stargazers count: 7.9%
Dependent packages count: 10.0%
Average: 11.9%
Downloads: 12.8%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • numpy ==1.16.5
  • pandas ==1.0.3