{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "4cb533b4-32b9-4f6e-a7cd-8c5c850faf5b", "metadata": {}, "outputs": [], "source": [ "#adapted version of Tinashe's gather_qc.ipynb to conatenate xcp qc csvs across subjects/sessions\n", "\n", "import pandas as pd\n", "import glob" ] }, { "cell_type": "code", "execution_count": 10, "id": "7bef3b67-aa60-465c-a7ef-20d11892f1e5", "metadata": {}, "outputs": [], "source": [ "#write list of subj csvs\n", "qc_path = [\"/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP//sub-*/ses-*/func/*space-MNI152NLin6Asym*.csv\"]\n", "\n", "qc_files = []\n", "\n", "for x in qc_path:\n", " qc_files.extend(glob.glob(x))" ] }, { "cell_type": "code", "execution_count": 11, "id": "2de7b162-65b1-4696-aa35-1f78aa6a131f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-13373/ses-day2/func/sub-13373_ses-day2_task-rest_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-13373/ses-day2/func/sub-13373_ses-day2_task-card_run-2_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-13373/ses-day2/func/sub-13373_ses-day2_task-face_run-2_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-13373/ses-day2/func/sub-13373_ses-day2_task-card_run-1_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-10180/ses-day2/func/sub-10180_ses-day2_task-face_run-2_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-10180/ses-day2/func/sub-10180_ses-day2_task-face_run-1_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-10180/ses-day2/func/sub-10180_ses-day2_task-card_run-1_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-10180/ses-day2/func/sub-10180_ses-day2_task-rest_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-10180/ses-day2/func/sub-10180_ses-day2_task-card_run-2_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv',\n", " '/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/production/derivatives-unzipped/DERIVATIVES/XCP/sub-12738/ses-day2/func/sub-12738_ses-day2_task-face_run-2_space-MNI152NLin6Asym_desc-qc_res-2_bold.csv']" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "qc_files[:10]" ] }, { "cell_type": "code", "execution_count": 12, "id": "eb21527c-b4ca-4ef0-b832-844f447ef193", "metadata": {}, "outputs": [], "source": [ "dfs = [pd.read_csv(x) for x in qc_files]" ] }, { "cell_type": "code", "execution_count": 13, "id": "87e5c454-0d3d-4b76-80f1-cb635b38764d", "metadata": {}, "outputs": [], "source": [ "output = pd.concat(dfs)" ] }, { "cell_type": "code", "execution_count": 14, "id": "0af845e4-20b7-404a-866e-ff5286abca9b", "metadata": {}, "outputs": [], "source": [ "output.to_csv(\"/cbica/projects/wolf_satterthwaite_reward/Margaret/Day2/curation/code/sandbox/qc_d2.csv\", index=False)" ] }, { "cell_type": "code", "execution_count": null, "id": "b71dd772-9c2b-489d-ba1f-183ffe2ee6f6", "metadata": {}, "outputs": [], "source": [ "#listing scans with normCrossCor < 0.8 (per Ted's review of QC plots)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.11" } }, "nbformat": 4, "nbformat_minor": 5 }