|
|
|
from tools.preprocess import * |
|
|
|
|
|
trait = "Melanoma" |
|
cohort = "GSE189631" |
|
|
|
|
|
in_trait_dir = "../DATA/GEO/Melanoma" |
|
in_cohort_dir = "../DATA/GEO/Melanoma/GSE189631" |
|
|
|
|
|
out_data_file = "./output/preprocess/3/Melanoma/GSE189631.csv" |
|
out_gene_data_file = "./output/preprocess/3/Melanoma/gene_data/GSE189631.csv" |
|
out_clinical_data_file = "./output/preprocess/3/Melanoma/clinical_data/GSE189631.csv" |
|
json_path = "./output/preprocess/3/Melanoma/cohort_info.json" |
|
|
|
|
|
print("Cohort directory path:", in_cohort_dir) |
|
print("Directory exists:", os.path.exists(in_cohort_dir)) |
|
if os.path.exists(in_cohort_dir): |
|
files = os.listdir(in_cohort_dir) |
|
print("\nFiles in directory:", files) |
|
|
|
|
|
matrix_files = [f for f in files if ('matrix' in f.lower() and f.endswith('.gz'))] |
|
soft_files = [f for f in files if ('soft' in f.lower() and f.endswith('.gz'))] |
|
|
|
if matrix_files and soft_files: |
|
matrix_file = os.path.join(in_cohort_dir, matrix_files[0]) |
|
soft_file = os.path.join(in_cohort_dir, soft_files[0]) |
|
print("\nFound files:") |
|
print("Matrix file:", matrix_file) |
|
print("SOFT file:", soft_file) |
|
|
|
|
|
background_info, clinical_data = get_background_and_clinical_data(matrix_file) |
|
|
|
|
|
unique_values_dict = get_unique_values_by_row(clinical_data) |
|
|
|
|
|
print("\nDataset Background Information:") |
|
print(background_info) |
|
print("\nSample Characteristics:") |
|
for feature, values in unique_values_dict.items(): |
|
print(f"\n{feature}:") |
|
print(values) |
|
else: |
|
print("\nRequired .gz files not found in directory") |
|
else: |
|
print("\nDirectory does not exist") |