GithubHelp home page GithubHelp logo

meta's Introduction

maps-2-models

This repo holds the analysis scripts for From Maps to Models: A Survey on the Reliability of Small Studies of Task-Based fMRI.

Reproducing Analyses

Data

The report uses data from the HCP YA S500 release. These should be stored in data-raw/hcp/disk*. Given that this only relies on a few elements from the HCP dataset (e.g., a few copes), the script tools/collecthcp may be helpful. The tabular information should be deposted into data-raw/hcp/[un]restricted.csv. A copy of the unrestricted table is included in this repo. The reference table to contrasts must also be available, as provided by contrasts.

Part of the main analysis script relies on a parquet version of the S500 release that was compiled with tools/hcptoparquet.py. The location of that script's output should be stored in the path referenced by the environment variable HCPPARQUET, defined at the top of _targets.R.

It is expected that fslr::fsldir() resolves to a valid directory.

The rest of the analysis scripts assume that the following folders are also in data-raw:

Analysis results (including outputs from _targets) are available on zenodo: https://doi.org/10.5281/zenodo.12686151.

R Environment

The R environment was tracked with renv. The environment can be installed with

renv::restore()

Python Environment

The python scripts relied on an environment that is described in env.yml.

Data Preprocessing and Predictive Modeling

The model predictions are mainly done in python. One script, difumo-connectivity prepares parquet files for analysis (as a SLURM array job with 3418 elements). This script will generate an arrow dataset (cpm-difumo2) which can be aggregated into a single parquet file with gather-difumo.py, which generates cpm-difumo.parquet. That file contains the model predictors. The predicted values come from the unrestricted and restricted portions of the HCP YA dataset, and they are grouped by bundle-hcp.py into a parquet file called hcp.parquet. Finally, the modeling is done by act_preds, which uses the features from cpm-difumo.parquet to predict the outputs in hcp.parquet (as a SLURM array job with 63 elements). The outputs of these scripts should be placed in the data-raw folder:

  • data-raw/out-perm-cpm-preds-sametest
  • data-raw/out-perm-cpm-sametest
  • data-raw/out-perm-gold-cpm-preds-sametest
  • data-raw/out-perm-gold-cpm-sametest

Main Analyses

Analyses are structured with the targets package. To reproduce the analyses, run

Sys.setenv(TAR_PROJECT = "hcp_ptfce")
targets::tar_make()

Note that these analyses are embarrassingly parallel, so if multiple cores are available then it may be beneficial to use crew. The _targets.R script has examples of doing so (commented out).

Figures

Figures (tex files) are generated by the targets workflow and deposited into analyses/figures.

meta's People

Contributors

psadil avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.