|
|
|
from tools.preprocess import * |
|
|
|
|
|
trait = "Chronic_Fatigue_Syndrome" |
|
|
|
|
|
tcga_root_dir = "../DATA/TCGA" |
|
|
|
|
|
out_data_file = "./output/preprocess/1/Chronic_Fatigue_Syndrome/TCGA.csv" |
|
out_gene_data_file = "./output/preprocess/1/Chronic_Fatigue_Syndrome/gene_data/TCGA.csv" |
|
out_clinical_data_file = "./output/preprocess/1/Chronic_Fatigue_Syndrome/clinical_data/TCGA.csv" |
|
json_path = "./output/preprocess/1/Chronic_Fatigue_Syndrome/cohort_info.json" |
|
|
|
import os |
|
import pandas as pd |
|
|
|
|
|
search_terms = [ |
|
"chronic_fatigue_syndrome", |
|
"chronic fatigue syndrome", |
|
"myalgic encephalomyelitis", |
|
"cfs" |
|
] |
|
|
|
dir_list = os.listdir(tcga_root_dir) |
|
matching_dir = None |
|
|
|
for d in dir_list: |
|
d_lower = d.lower() |
|
if any(term in d_lower for term in search_terms): |
|
matching_dir = d |
|
break |
|
|
|
if matching_dir is None: |
|
|
|
validate_and_save_cohort_info( |
|
is_final=False, |
|
cohort="TCGA_Chronic_Fatigue_Syndrome", |
|
info_path=json_path, |
|
is_gene_available=False, |
|
is_trait_available=False |
|
) |
|
else: |
|
|
|
cohort_dir = os.path.join(tcga_root_dir, matching_dir) |
|
clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir) |
|
|
|
|
|
clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t') |
|
genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t') |
|
|
|
|
|
print("Clinical Data Columns:") |
|
print(clinical_df.columns.tolist()) |