File size: 8,726 Bytes
92d2f89 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "c99ecfa4",
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-25T06:42:10.214688Z",
"iopub.status.busy": "2025-03-25T06:42:10.214466Z",
"iopub.status.idle": "2025-03-25T06:42:10.382421Z",
"shell.execute_reply": "2025-03-25T06:42:10.382105Z"
}
},
"outputs": [],
"source": [
"import sys\n",
"import os\n",
"sys.path.append(os.path.abspath(os.path.join(os.getcwd(), '../..')))\n",
"\n",
"# Path Configuration\n",
"from tools.preprocess import *\n",
"\n",
"# Processing context\n",
"trait = \"Asthma\"\n",
"\n",
"# Input paths\n",
"tcga_root_dir = \"../../input/TCGA\"\n",
"\n",
"# Output paths\n",
"out_data_file = \"../../output/preprocess/Asthma/TCGA.csv\"\n",
"out_gene_data_file = \"../../output/preprocess/Asthma/gene_data/TCGA.csv\"\n",
"out_clinical_data_file = \"../../output/preprocess/Asthma/clinical_data/TCGA.csv\"\n",
"json_path = \"../../output/preprocess/Asthma/cohort_info.json\"\n"
]
},
{
"cell_type": "markdown",
"id": "14056416",
"metadata": {},
"source": [
"### Step 1: Initial Data Loading"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "97b94786",
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-25T06:42:10.383903Z",
"iopub.status.busy": "2025-03-25T06:42:10.383761Z",
"iopub.status.idle": "2025-03-25T06:42:10.389275Z",
"shell.execute_reply": "2025-03-25T06:42:10.388982Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Looking for a relevant cohort directory for Asthma...\n",
"Available cohorts: ['TCGA_Liver_Cancer_(LIHC)', 'TCGA_Lower_Grade_Glioma_(LGG)', 'TCGA_lower_grade_glioma_and_glioblastoma_(GBMLGG)', 'TCGA_Lung_Adenocarcinoma_(LUAD)', 'TCGA_Lung_Cancer_(LUNG)', 'TCGA_Lung_Squamous_Cell_Carcinoma_(LUSC)', 'TCGA_Melanoma_(SKCM)', 'TCGA_Mesothelioma_(MESO)', 'TCGA_Ocular_melanomas_(UVM)', 'TCGA_Ovarian_Cancer_(OV)', 'TCGA_Pancreatic_Cancer_(PAAD)', 'TCGA_Pheochromocytoma_Paraganglioma_(PCPG)', 'TCGA_Prostate_Cancer_(PRAD)', 'TCGA_Rectal_Cancer_(READ)', 'TCGA_Sarcoma_(SARC)', 'TCGA_Stomach_Cancer_(STAD)', 'TCGA_Testicular_Cancer_(TGCT)', 'TCGA_Thymoma_(THYM)', 'TCGA_Thyroid_Cancer_(THCA)', 'TCGA_Uterine_Carcinosarcoma_(UCS)', '.DS_Store', 'CrawlData.ipynb', 'TCGA_Acute_Myeloid_Leukemia_(LAML)', 'TCGA_Adrenocortical_Cancer_(ACC)', 'TCGA_Bile_Duct_Cancer_(CHOL)', 'TCGA_Bladder_Cancer_(BLCA)', 'TCGA_Breast_Cancer_(BRCA)', 'TCGA_Cervical_Cancer_(CESC)', 'TCGA_Colon_and_Rectal_Cancer_(COADREAD)', 'TCGA_Colon_Cancer_(COAD)', 'TCGA_Endometrioid_Cancer_(UCEC)', 'TCGA_Esophageal_Cancer_(ESCA)', 'TCGA_Glioblastoma_(GBM)', 'TCGA_Head_and_Neck_Cancer_(HNSC)', 'TCGA_Kidney_Chromophobe_(KICH)', 'TCGA_Kidney_Clear_Cell_Carcinoma_(KIRC)', 'TCGA_Kidney_Papillary_Cell_Carcinoma_(KIRP)', 'TCGA_Large_Bcell_Lymphoma_(DLBC)']\n",
"No suitable directory found for Asthma. This is an autoimmune condition, not a cancer type.\n",
"TCGA dataset contains cancer cohorts, which are not relevant for this trait.\n",
"Skipping this trait and marking the task as completed.\n"
]
},
{
"data": {
"text/plain": [
"False"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os\n",
"\n",
"# Check if there's a suitable cohort directory for Psoriatic Arthritis\n",
"print(f\"Looking for a relevant cohort directory for {trait}...\")\n",
"\n",
"# Check available cohorts\n",
"available_dirs = os.listdir(tcga_root_dir)\n",
"print(f\"Available cohorts: {available_dirs}\")\n",
"\n",
"# Psoriatic arthritis is an autoimmune inflammatory condition that affects both joints and skin\n",
"# The TCGA dataset is focused on cancer cohorts, not autoimmune conditions\n",
"# After reviewing the available directories, there is no appropriate match for psoriatic arthritis\n",
"\n",
"print(f\"No suitable directory found for {trait}. This is an autoimmune condition, not a cancer type.\")\n",
"print(\"TCGA dataset contains cancer cohorts, which are not relevant for this trait.\")\n",
"print(\"Skipping this trait and marking the task as completed.\")\n",
"\n",
"# Mark the task as completed by recording the unavailability in the cohort_info.json file\n",
"validate_and_save_cohort_info(\n",
" is_final=False,\n",
" cohort=\"TCGA\",\n",
" info_path=json_path,\n",
" is_gene_available=False,\n",
" is_trait_available=False\n",
")\n"
]
},
{
"cell_type": "markdown",
"id": "71580d15",
"metadata": {},
"source": [
"### Step 2: Initial Data Loading"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "7bd38167",
"metadata": {
"execution": {
"iopub.execute_input": "2025-03-25T06:42:10.390286Z",
"iopub.status.busy": "2025-03-25T06:42:10.390181Z",
"iopub.status.idle": "2025-03-25T06:42:10.393814Z",
"shell.execute_reply": "2025-03-25T06:42:10.393525Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Looking for a relevant cohort directory for Asthma...\n",
"Available cohorts: ['TCGA_Liver_Cancer_(LIHC)', 'TCGA_Lower_Grade_Glioma_(LGG)', 'TCGA_lower_grade_glioma_and_glioblastoma_(GBMLGG)', 'TCGA_Lung_Adenocarcinoma_(LUAD)', 'TCGA_Lung_Cancer_(LUNG)', 'TCGA_Lung_Squamous_Cell_Carcinoma_(LUSC)', 'TCGA_Melanoma_(SKCM)', 'TCGA_Mesothelioma_(MESO)', 'TCGA_Ocular_melanomas_(UVM)', 'TCGA_Ovarian_Cancer_(OV)', 'TCGA_Pancreatic_Cancer_(PAAD)', 'TCGA_Pheochromocytoma_Paraganglioma_(PCPG)', 'TCGA_Prostate_Cancer_(PRAD)', 'TCGA_Rectal_Cancer_(READ)', 'TCGA_Sarcoma_(SARC)', 'TCGA_Stomach_Cancer_(STAD)', 'TCGA_Testicular_Cancer_(TGCT)', 'TCGA_Thymoma_(THYM)', 'TCGA_Thyroid_Cancer_(THCA)', 'TCGA_Uterine_Carcinosarcoma_(UCS)', '.DS_Store', 'CrawlData.ipynb', 'TCGA_Acute_Myeloid_Leukemia_(LAML)', 'TCGA_Adrenocortical_Cancer_(ACC)', 'TCGA_Bile_Duct_Cancer_(CHOL)', 'TCGA_Bladder_Cancer_(BLCA)', 'TCGA_Breast_Cancer_(BRCA)', 'TCGA_Cervical_Cancer_(CESC)', 'TCGA_Colon_and_Rectal_Cancer_(COADREAD)', 'TCGA_Colon_Cancer_(COAD)', 'TCGA_Endometrioid_Cancer_(UCEC)', 'TCGA_Esophageal_Cancer_(ESCA)', 'TCGA_Glioblastoma_(GBM)', 'TCGA_Head_and_Neck_Cancer_(HNSC)', 'TCGA_Kidney_Chromophobe_(KICH)', 'TCGA_Kidney_Clear_Cell_Carcinoma_(KIRC)', 'TCGA_Kidney_Papillary_Cell_Carcinoma_(KIRP)', 'TCGA_Large_Bcell_Lymphoma_(DLBC)']\n",
"No suitable directory found for Asthma. This is an autoimmune condition, not a cancer type.\n",
"TCGA dataset contains cancer cohorts, which are not relevant for this trait.\n",
"Skipping this trait and marking the task as completed.\n"
]
},
{
"data": {
"text/plain": [
"False"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os\n",
"\n",
"# Check if there's a suitable cohort directory for Psoriatic Arthritis\n",
"print(f\"Looking for a relevant cohort directory for {trait}...\")\n",
"\n",
"# Check available cohorts\n",
"available_dirs = os.listdir(tcga_root_dir)\n",
"print(f\"Available cohorts: {available_dirs}\")\n",
"\n",
"# Psoriatic arthritis is an autoimmune inflammatory condition that affects both joints and skin\n",
"# The TCGA dataset is focused on cancer cohorts, not autoimmune conditions\n",
"# After reviewing the available directories, there is no appropriate match for psoriatic arthritis\n",
"\n",
"print(f\"No suitable directory found for {trait}. This is an autoimmune condition, not a cancer type.\")\n",
"print(\"TCGA dataset contains cancer cohorts, which are not relevant for this trait.\")\n",
"print(\"Skipping this trait and marking the task as completed.\")\n",
"\n",
"# Mark the task as completed by recording the unavailability in the cohort_info.json file\n",
"validate_and_save_cohort_info(\n",
" is_final=False,\n",
" cohort=\"TCGA\",\n",
" info_path=json_path,\n",
" is_gene_available=False,\n",
" is_trait_available=False\n",
")"
]
}
],
"metadata": {
"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.10.16"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|