Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mnarayan/cpac-utils
Utility functions to fetch and organize preprocessed fMRI timeseries
https://github.com/mnarayan/cpac-utils
Last synced: 7 days ago
JSON representation
Utility functions to fetch and organize preprocessed fMRI timeseries
- Host: GitHub
- URL: https://github.com/mnarayan/cpac-utils
- Owner: mnarayan
- Created: 2018-01-28T20:59:57.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2018-01-28T22:34:42.000Z (almost 7 years ago)
- Last Synced: 2024-12-13T12:09:43.585Z (9 days ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cpac-utils
Utility functions to fetch and organize time-series derivatives after data has been preprocessed using C-PAC## Requirements
Uses python 3 as well as the following python packages
- awscli
- numpy
- scipy
- pandas```
pip install -r requirements.txt
```## Usage
### Download Data
Preprocessed data is expected to be located at in `data/cpac````
|--data
|--cpac
|--derivatives
|--src
|--requirements.txt
|--README```
For example data preprocessed at OpenNeuro.org can be downloaded as follows```
./src/download_data.sh
```### Fetch and Organize ROI Time-Series
Given a textfile `path_roi_timeseries_mask_.txt` containing the list of paths to all outputs from C-PAC such as `roi_stats.csv`, the function `collect_timeseries.py` will load, clean and reorganize into `.mat` and `.pickle` data structures by participant and task.
```
python3 collect_timeseries.py path_roi_timeseries_mask_$ATLASNAME.txt```
The example script `src/organize_timeseries.sh` creates a textfile of pathnames and then calls the above command.
After downloading and organizing the timeseries, the outputs look as follows:
```
data/cpac/derivatives/pipeline_analysis/compcor_ncomponents_5_selector_pc10.linear1.wm0.global0.motion1.quadratic1.gm0.compcor1.csf1/sub-01_ses-post:
sub-01_ses-post_task-rest_run-01_CC200.mat sub-01_ses-post_task-rest_run-02_CC200.pickle
sub-01_ses-post_task-rest_run-01_CC200.pickle sub-01_ses-post_task-rest_run-03_CC200.mat
sub-01_ses-post_task-rest_run-02_CC200.mat sub-01_ses-post_task-rest_run-03_CC200.pickledata/cpac/derivatives/pipeline_analysis/compcor_ncomponents_5_selector_pc10.linear1.wm0.global0.motion1.quadratic1.gm0.compcor1.csf1/sub-01_ses-pre:
sub-01_ses-pre_task-rest_run-01_CC200.mat sub-01_ses-pre_task-rest_run-02_CC200.pickle
sub-01_ses-pre_task-rest_run-01_CC200.pickle sub-01_ses-pre_task-rest_run-03_CC200.mat
sub-01_ses-pre_task-rest_run-02_CC200.mat sub-01_ses-pre_task-rest_run-03_CC200.pickle```