|
|
|
from tools.preprocess import * |
|
|
|
|
|
trait = "Allergies" |
|
cohort = "GSE184382" |
|
|
|
|
|
in_trait_dir = "../DATA/GEO/Allergies" |
|
in_cohort_dir = "../DATA/GEO/Allergies/GSE184382" |
|
|
|
|
|
out_data_file = "./output/preprocess/3/Allergies/GSE184382.csv" |
|
out_gene_data_file = "./output/preprocess/3/Allergies/gene_data/GSE184382.csv" |
|
out_clinical_data_file = "./output/preprocess/3/Allergies/clinical_data/GSE184382.csv" |
|
json_path = "./output/preprocess/3/Allergies/cohort_info.json" |
|
|
|
|
|
print("All files in directory:") |
|
print(os.listdir(in_cohort_dir)) |
|
print() |
|
|
|
|
|
files = os.listdir(in_cohort_dir) |
|
soft_files = [f for f in files if ('soft' in f.lower() or 'family' in f.lower() or 'annot' in f.lower()) |
|
and (f.endswith('.gz') or f.endswith('.txt'))] |
|
matrix_files = [f for f in files if ('matrix' in f.lower() or 'series' in f.lower()) |
|
and (f.endswith('.gz') or f.endswith('.txt'))] |
|
|
|
print("Found files:") |
|
print(f"SOFT files: {soft_files}") |
|
print(f"Matrix files: {matrix_files}\n") |
|
|
|
|
|
soft_file = os.path.join(in_cohort_dir, soft_files[0]) |
|
matrix_file = os.path.join(in_cohort_dir, matrix_files[0]) |
|
|
|
|
|
background_info, clinical_data = get_background_and_clinical_data(matrix_file) |
|
|
|
|
|
sample_characteristics = get_unique_values_by_row(clinical_data) |
|
|
|
|
|
print("Dataset Background Information:") |
|
print(f"{background_info}\n") |
|
|
|
|
|
print("Sample Characteristics:") |
|
for feature, values in sample_characteristics.items(): |
|
print(f"Feature: {feature}") |
|
print(f"Values: {values}\n") |