|
|
|
from tools.preprocess import * |
|
|
|
|
|
trait = "Vitamin_D_Levels" |
|
cohort = "GSE118723" |
|
|
|
|
|
in_trait_dir = "../DATA/GEO/Vitamin_D_Levels" |
|
in_cohort_dir = "../DATA/GEO/Vitamin_D_Levels/GSE118723" |
|
|
|
|
|
out_data_file = "./output/preprocess/3/Vitamin_D_Levels/GSE118723.csv" |
|
out_gene_data_file = "./output/preprocess/3/Vitamin_D_Levels/gene_data/GSE118723.csv" |
|
out_clinical_data_file = "./output/preprocess/3/Vitamin_D_Levels/clinical_data/GSE118723.csv" |
|
json_path = "./output/preprocess/3/Vitamin_D_Levels/cohort_info.json" |
|
|
|
|
|
|
|
|
|
print("Please provide the following essential information from previous step:") |
|
print("Sample characteristics dictionary showing clinical variables") |
|
print("Background information about the dataset") |
|
print() |
|
print("This information is needed to:") |
|
print("1. Determine if this dataset has gene expression (not miRNA/methylation)") |
|
print("2. Locate trait (Vitamin D levels), age, and gender data") |
|
print("3. Design appropriate data type conversions") |
|
|
|
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir) |
|
print(f"Matrix file path: {matrix_file_path}") |
|
|
|
|
|
with gzip.open(matrix_file_path, 'rt') as file: |
|
first_lines = [next(file) for _ in range(5)] |
|
print("\nFirst 5 lines of matrix file:") |
|
print('\n'.join(first_lines)) |
|
|
|
|
|
genetic_data = get_genetic_data(matrix_file_path) |
|
|
|
|
|
print("\nDataFrame shape:", genetic_data.shape) |
|
print("\nFirst 20 gene/probe IDs:") |
|
print(list(genetic_data.index[:20])) |
|
|
|
|
|
|