# Path Configuration from tools.preprocess import * # Processing context trait = "Essential_Thrombocythemia" # Input paths tcga_root_dir = "../DATA/TCGA" # Output paths out_data_file = "./output/preprocess/1/Essential_Thrombocythemia/TCGA.csv" out_gene_data_file = "./output/preprocess/1/Essential_Thrombocythemia/gene_data/TCGA.csv" out_clinical_data_file = "./output/preprocess/1/Essential_Thrombocythemia/clinical_data/TCGA.csv" json_path = "./output/preprocess/1/Essential_Thrombocythemia/cohort_info.json" import os import pandas as pd # 1. Identify subdirectories under tcga_root_dir subdirectories = os.listdir(tcga_root_dir) # Attempt to find a directory name relevant to "Essential Thrombocythemia" or synonyms trait_subdir = None search_terms = ["thrombocythemia", "essential_thrombocythemia", "et", "myeloproliferative"] for d in subdirectories: d_lower = d.lower() if any(term in d_lower for term in search_terms): trait_subdir = d break # 2. If none found, skip this trait if not trait_subdir: print(f"No suitable subdirectory found for trait '{trait}'. Skipping...") is_gene_available = False is_trait_available = False validate_and_save_cohort_info( is_final=False, cohort="TCGA", info_path=json_path, is_gene_available=is_gene_available, is_trait_available=is_trait_available ) else: # This block is theoretically where we'd find and load files if the directory was found, # but for "Essential Thrombocythemia" there appears to be no matching directory. pass