Skip to content

autohrf

1.1.3

Automated Generation of Data-Informed GLM Models in Task-Based fMRI Data Analysis

0packages depend
3.7Kdownloads / year
89.5%test coverage
13/13checks pass

Overview

About
Maintained by Jure DemšarFirst published 2022-07-215 releasesCRAN page ↗GitHub ↗

Analysis of task-related functional magnetic resonance imaging (fMRI) activity at the level of individual participants is commonly based on general linear modelling (GLM) that allows us to estimate to what extent the blood oxygenation level dependent (BOLD) signal can be explained by task response predictors specified in the GLM model. The predictors are constructed by convolving the hypothesised timecourse of neural activity with an assumed hemodynamic response function (HRF). To get valid and precise estimates of task response, it is important to construct a model of neural activity that best matches actual neuronal activity. The construction of models is most often driven by predefined assumptions on the components of brain activity and their duration based on the task design and specific aims of the study. However, our assumptions about the onset and duration of component processes might be wrong and can also differ across brain regions. This can result in inappropriate or suboptimal models, bad fitting of the model to the actual data and invalid estimations of brain activity. Here we present an approach in which theoretically driven models of task response are used to define constraints based on which the final model is derived computationally using the actual data. Specifically, we developed 'autohrf' — a package for the 'R' programming language that allows for data-driven estimation of HRF models. The package uses genetic algorithms to efficiently search for models that fit the underlying data well. The package uses automated parameter search to find the onset and duration of task predictors which result in the highest fitness of the resulting GLM based on the fMRI signal under predefined restrictions. We evaluate the usefulness of the 'autohrf' package on publicly available datasets of task-related fMRI activity. Our results suggest that by using 'autohrf' users can find better task related brain activity models in a quick and efficient manner.

Install

Health

CRAN checks
13OK
Slowest check: 3.7 min · r-release-macos-x86_64
Code health
Yes
Tests · ratio 0.15
89.5%
Coverage · measured lines
100%
Documentation · exports
9
Dependencies · direct
Check history
  • OK2026-06-09
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • ERROR2026-06-08
    12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
  • OK2026-03-10
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 337 wordsVignettesYes · dynamicpkgdown siteNoNEWSYes · 67% structuredCode of conductNoContributing guideNo
Examples that run
100%
Documented parameters
100%
Return-value docs
100%
References docs
0%

Downloads

3.7K
CRAN downloads in the past year
Rank #12,576 · ~10/day · ~306/mo
Daily download trend is not available in this view yet.
25330 days
85090 days
3.7K1 year
Compare downloads with other packages →
Also on119 r2u58 autocran

Repository

Repository
2Stars
0Forks
0Open issues
0Open PRs
0Releases
116Commits
2Contributors
License GPL-3.0 · 116 commits · Last activity 2024-01-16

Stars over time

2025-01-18 · 22026-07-07 · 2

Repository practices

Upstream repositoryBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/demsarjure/autohrf on 2026-07-19.

CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
11 external dependencies (excludes base and recommended)
Depends (1)
R >= 3.5.0
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Code & Tests

Code Composition
R 1,659 (56%)Rd 819 (27%)Vignettes 502 (17%)
Code characteristics
Cyclomatic complexity
4.0 median / 15 max
Test cases
15 / 0.15 per code line

Test coverage

Line coverage

89%

Expression

89.2%

Tests / Examples

89.5% / 82% ex

Functions

18 18 exported

Complexity

4.5 avg / 15 max

Call network

18 nodes / 15 edges

Loading call graph…

Lowest coverage

18 functions
FunctionCycloCoverage
plot_fitness exp20%
plot_best_models exp675%
convolve_events exp482%
downsample exp483%
fit_to_constraints exp1585%
plot_model exp985%

Datasets

Bundled datasets · 2
NameClassRows × ColsAlso ships in
flankerdata.frame192 × 3
swmdata.frame11,520 × 3

People & History

People (3)
Maintainer (1)
Maintainer, Author
Authors (3)
Maintainer, Author
Author
Package Timeline

5 releases. Pick two to compare their code metrics. R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 1.1.3Latest
    2024-01-16 · current release · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 1.1.2
    2023-02-15 · diff ↗
  • 1.1.0
    2022-11-19 · diff ↗
  • 1.0.4
    2022-09-30 · diff ↗
  • 1.0.3
    2022-07-21
  • R
    R 4.2.0 released · 2022-04-22

Package metadata

First published
2022-07-21
Total releases
5 / 4 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 3.5.0
Bundled data
100 KB / 6 files
Download size
2.0 MB
Installed size
not tracked yet
With dependencies
not tracked yet
Appears in task views
Report a problem with this page →