# Path Configuration | |
from tools.preprocess import * | |
# Processing context | |
trait = "Post-Traumatic_Stress_Disorder" | |
cohort = "GSE52875" | |
# Input paths | |
in_trait_dir = "../DATA/GEO/Post-Traumatic_Stress_Disorder" | |
in_cohort_dir = "../DATA/GEO/Post-Traumatic_Stress_Disorder/GSE52875" | |
# Output paths | |
out_data_file = "./output/preprocess/3/Post-Traumatic_Stress_Disorder/GSE52875.csv" | |
out_gene_data_file = "./output/preprocess/3/Post-Traumatic_Stress_Disorder/gene_data/GSE52875.csv" | |
out_clinical_data_file = "./output/preprocess/3/Post-Traumatic_Stress_Disorder/clinical_data/GSE52875.csv" | |
json_path = "./output/preprocess/3/Post-Traumatic_Stress_Disorder/cohort_info.json" | |
# Get file paths | |
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir) | |
# Get background info and clinical data | |
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path) | |
print("Background Information:") | |
print(background_info) | |
print("\nSample Characteristics:") | |
# Get dictionary of unique values per row | |
unique_values_dict = get_unique_values_by_row(clinical_data) | |
for row, values in unique_values_dict.items(): | |
print(f"\n{row}:") | |
print(values) | |
# 1. Gene Expression Data Availability | |
is_gene_available = False # Not suitable - mice dataset | |
# 2. Variable Availability and Data Type Conversion | |
# All data rows containing only strain and tissue info, no trait/age/gender data | |
trait_row = None | |
age_row = None | |
gender_row = None | |
# These conversion functions won't be used since data not available | |
# but defining them to avoid NameErrors | |
def convert_trait(x): | |
return None | |
def convert_age(x): | |
return None | |
def convert_gender(x): | |
return None | |
# 3. Save Metadata | |
# Initial filtering - dataset not suitable since it's mice data | |
validate_and_save_cohort_info(is_final=False, | |
cohort=cohort, | |
info_path=json_path, | |
is_gene_available=is_gene_available, | |
is_trait_available=False) | |
# 4. Skip clinical feature extraction since trait_row is None |