{"id":15913085,"url":"https://github.com/mnarayan/cpac-utils","last_synced_at":"2025-04-03T03:16:35.064Z","repository":{"id":150071617,"uuid":"119297330","full_name":"mnarayan/cpac-utils","owner":"mnarayan","description":"Utility functions to fetch and organize preprocessed fMRI timeseries","archived":false,"fork":false,"pushed_at":"2018-01-28T22:34:42.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-27T04:12:52.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnarayan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-28T20:59:57.000Z","updated_at":"2018-01-28T21:00:34.000Z","dependencies_parsed_at":"2023-06-04T20:15:18.405Z","dependency_job_id":null,"html_url":"https://github.com/mnarayan/cpac-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnarayan%2Fcpac-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnarayan%2Fcpac-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnarayan%2Fcpac-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnarayan%2Fcpac-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnarayan","download_url":"https://codeload.github.com/mnarayan/cpac-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927844,"owners_count":20856198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T16:23:02.379Z","updated_at":"2025-04-03T03:16:34.739Z","avatar_url":"https://github.com/mnarayan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpac-utils\nUtility functions to fetch and organize time-series derivatives after data has been preprocessed using C-PAC\n\n\n## Requirements\n\nUses python 3 as well as the following python packages\n\n- awscli \n- numpy\n- scipy\n- pandas\n\n```\npip install -r requirements.txt\n```\n\n## Usage\n\n### Download Data\nPreprocessed data is expected to be located at in `data/cpac`\n\n```\n|--data\n  |--cpac\n    |--derivatives\n|--src\n|--requirements.txt\n|--README\n\n```\nFor example data preprocessed at OpenNeuro.org can be downloaded as follows\n\n```\n./src/download_data.sh\n```\n\n### Fetch and Organize ROI Time-Series\n\nGiven a textfile `path_roi_timeseries_mask_\u003cATLASNAME\u003e.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.\t\n\n```\npython3 collect_timeseries.py path_roi_timeseries_mask_$ATLASNAME.txt\n\n```\n\nThe example script `src/organize_timeseries.sh` creates a textfile of pathnames and then calls the above command. \n\n\nAfter downloading and organizing the timeseries, the outputs look as follows: \n\n```\ndata/cpac/derivatives/pipeline_analysis/compcor_ncomponents_5_selector_pc10.linear1.wm0.global0.motion1.quadratic1.gm0.compcor1.csf1/sub-01_ses-post:\nsub-01_ses-post_task-rest_run-01_CC200.mat     sub-01_ses-post_task-rest_run-02_CC200.pickle\nsub-01_ses-post_task-rest_run-01_CC200.pickle  sub-01_ses-post_task-rest_run-03_CC200.mat\nsub-01_ses-post_task-rest_run-02_CC200.mat     sub-01_ses-post_task-rest_run-03_CC200.pickle\n\ndata/cpac/derivatives/pipeline_analysis/compcor_ncomponents_5_selector_pc10.linear1.wm0.global0.motion1.quadratic1.gm0.compcor1.csf1/sub-01_ses-pre:\nsub-01_ses-pre_task-rest_run-01_CC200.mat     sub-01_ses-pre_task-rest_run-02_CC200.pickle\nsub-01_ses-pre_task-rest_run-01_CC200.pickle  sub-01_ses-pre_task-rest_run-03_CC200.mat\nsub-01_ses-pre_task-rest_run-02_CC200.mat     sub-01_ses-pre_task-rest_run-03_CC200.pickle\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnarayan%2Fcpac-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnarayan%2Fcpac-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnarayan%2Fcpac-utils/lists"}