Liu-Hy commited on
Commit
ee5a411
·
verified ·
1 Parent(s): 5bd5338

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +34 -0
  2. p3/preprocess/COVID-19/gene_data/TCGA.csv +3 -0
  3. p3/preprocess/Eczema/gene_data/TCGA.csv +3 -0
  4. p3/preprocess/Esophageal_Cancer/GSE156915.csv +3 -0
  5. p3/preprocess/Esophageal_Cancer/gene_data/GSE156915.csv +3 -0
  6. p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/TCGA.csv +3 -0
  7. p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/GSE43580.csv +3 -0
  8. p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/TCGA.csv +3 -0
  9. p3/preprocess/Gaucher_Disease/GSE124283.csv +3 -0
  10. p3/preprocess/Gaucher_Disease/gene_data/GSE124283.csv +3 -0
  11. p3/preprocess/Generalized_Anxiety_Disorder/gene_data/GSE61672.csv +3 -0
  12. p3/preprocess/Glioblastoma/code/GSE134470.py +168 -0
  13. p3/preprocess/Glioblastoma/code/GSE159000.py +165 -0
  14. p3/preprocess/Glioblastoma/code/GSE175700.py +124 -0
  15. p3/preprocess/Glioblastoma/code/GSE178236.py +177 -0
  16. p3/preprocess/Glioblastoma/code/GSE226976.py +146 -0
  17. p3/preprocess/Glioblastoma/code/GSE249289.py +180 -0
  18. p3/preprocess/Glioblastoma/code/GSE279426.py +159 -0
  19. p3/preprocess/Glioblastoma/code/GSE39144.py +188 -0
  20. p3/preprocess/Glioblastoma/code/TCGA.py +97 -0
  21. p3/preprocess/Glioblastoma/gene_data/GSE134470.csv +3 -0
  22. p3/preprocess/Glioblastoma/gene_data/GSE148949.csv +3 -0
  23. p3/preprocess/Glioblastoma/gene_data/GSE159000.csv +0 -0
  24. p3/preprocess/Glioblastoma/gene_data/GSE175700.csv +3 -0
  25. p3/preprocess/Glioblastoma/gene_data/GSE178236.csv +3 -0
  26. p3/preprocess/Glioblastoma/gene_data/GSE226976.csv +0 -0
  27. p3/preprocess/Glioblastoma/gene_data/GSE249289.csv +0 -0
  28. p3/preprocess/Glioblastoma/gene_data/GSE279426.csv +0 -0
  29. p3/preprocess/Glioblastoma/gene_data/GSE39144.csv +3 -0
  30. p3/preprocess/Glucocorticoid_Sensitivity/GSE15820.csv +3 -0
  31. p3/preprocess/Glucocorticoid_Sensitivity/GSE32962.csv +3 -0
  32. p3/preprocess/Glucocorticoid_Sensitivity/GSE33649.csv +3 -0
  33. p3/preprocess/Glucocorticoid_Sensitivity/GSE42002.csv +3 -0
  34. p3/preprocess/Glucocorticoid_Sensitivity/GSE48801.csv +3 -0
  35. p3/preprocess/Glucocorticoid_Sensitivity/GSE50012.csv +3 -0
  36. p3/preprocess/Glucocorticoid_Sensitivity/GSE57795.csv +3 -0
  37. p3/preprocess/Glucocorticoid_Sensitivity/GSE58715.csv +0 -0
  38. p3/preprocess/Glucocorticoid_Sensitivity/GSE65645.csv +3 -0
  39. p3/preprocess/Glucocorticoid_Sensitivity/GSE66705.csv +3 -0
  40. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE15820.csv +2 -0
  41. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE32962.csv +2 -0
  42. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE33649.csv +4 -0
  43. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE42002.csv +2 -0
  44. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE48801.csv +2 -0
  45. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE50012.csv +4 -0
  46. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE57795.csv +2 -0
  47. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE58715.csv +2 -0
  48. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE65645.csv +2 -0
  49. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE66705.csv +2 -0
  50. p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/TCGA.csv +93 -0
.gitattributes CHANGED
@@ -1690,3 +1690,37 @@ p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/GSE77563.csv filter=lfs dif
1690
  p3/preprocess/Esophageal_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1691
  p3/preprocess/Essential_Thrombocythemia/gene_data/GSE159514.csv filter=lfs diff=lfs merge=lfs -text
1692
  p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/GSE77563.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1690
  p3/preprocess/Esophageal_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1691
  p3/preprocess/Essential_Thrombocythemia/gene_data/GSE159514.csv filter=lfs diff=lfs merge=lfs -text
1692
  p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/GSE77563.csv filter=lfs diff=lfs merge=lfs -text
1693
+ p3/preprocess/Gaucher_Disease/GSE124283.csv filter=lfs diff=lfs merge=lfs -text
1694
+ p3/preprocess/Esophageal_Cancer/GSE156915.csv filter=lfs diff=lfs merge=lfs -text
1695
+ p3/preprocess/Gaucher_Disease/gene_data/GSE124283.csv filter=lfs diff=lfs merge=lfs -text
1696
+ p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/GSE43580.csv filter=lfs diff=lfs merge=lfs -text
1697
+ p3/preprocess/COVID-19/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1698
+ p3/preprocess/Esophageal_Cancer/gene_data/GSE156915.csv filter=lfs diff=lfs merge=lfs -text
1699
+ p3/preprocess/Glioblastoma/gene_data/GSE175700.csv filter=lfs diff=lfs merge=lfs -text
1700
+ p3/preprocess/Generalized_Anxiety_Disorder/gene_data/GSE61672.csv filter=lfs diff=lfs merge=lfs -text
1701
+ p3/preprocess/Glioblastoma/gene_data/GSE178236.csv filter=lfs diff=lfs merge=lfs -text
1702
+ p3/preprocess/Eczema/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1703
+ p3/preprocess/Glioblastoma/gene_data/GSE134470.csv filter=lfs diff=lfs merge=lfs -text
1704
+ p3/preprocess/Glioblastoma/gene_data/GSE39144.csv filter=lfs diff=lfs merge=lfs -text
1705
+ p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1706
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE32962.csv filter=lfs diff=lfs merge=lfs -text
1707
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE33649.csv filter=lfs diff=lfs merge=lfs -text
1708
+ p3/preprocess/Glioblastoma/gene_data/GSE148949.csv filter=lfs diff=lfs merge=lfs -text
1709
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE15820.csv filter=lfs diff=lfs merge=lfs -text
1710
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE65645.csv filter=lfs diff=lfs merge=lfs -text
1711
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE57795.csv filter=lfs diff=lfs merge=lfs -text
1712
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE50012.csv filter=lfs diff=lfs merge=lfs -text
1713
+ p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1714
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE42002.csv filter=lfs diff=lfs merge=lfs -text
1715
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE32962.csv filter=lfs diff=lfs merge=lfs -text
1716
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE15820.csv filter=lfs diff=lfs merge=lfs -text
1717
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE33649.csv filter=lfs diff=lfs merge=lfs -text
1718
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE57795.csv filter=lfs diff=lfs merge=lfs -text
1719
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE66705.csv filter=lfs diff=lfs merge=lfs -text
1720
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE65645.csv filter=lfs diff=lfs merge=lfs -text
1721
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE50012.csv filter=lfs diff=lfs merge=lfs -text
1722
+ p3/preprocess/Head_and_Neck_Cancer/GSE148320.csv filter=lfs diff=lfs merge=lfs -text
1723
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/GSE42002.csv filter=lfs diff=lfs merge=lfs -text
1724
+ p3/preprocess/Head_and_Neck_Cancer/GSE151179.csv filter=lfs diff=lfs merge=lfs -text
1725
+ p3/preprocess/Glucocorticoid_Sensitivity/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1726
+ p3/preprocess/Glucocorticoid_Sensitivity/GSE48801.csv filter=lfs diff=lfs merge=lfs -text
p3/preprocess/COVID-19/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96c986e5a3d878aa4fe521d4d98915e250b7f0cdb97445343a36450f05661288
3
+ size 339317879
p3/preprocess/Eczema/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca538730424e09dc117dcbf2b9e361e18a559838fbd5166c65c39e001c215c63
3
+ size 203622702
p3/preprocess/Esophageal_Cancer/GSE156915.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3680b0c2e3bb6d39bd51615899136f6b359faf3767f8d5cd3cc0e55b9aac038
3
+ size 95348282
p3/preprocess/Esophageal_Cancer/gene_data/GSE156915.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2879a4bafeabb89373f8e8048fc81105fb8bf2230ea6cf71844e326693130272
3
+ size 95359844
p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72248483bc99d617c84a7b391fd1575bd9b624063cc67a810643f05706d1de5e
3
+ size 58742455
p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/GSE43580.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5af619a5350088586843a2ad5dd0ce92c077ec4cdd74fc0297b02f37b76f097
3
+ size 32761120
p3/preprocess/Gastroesophageal_reflux_disease_(GERD)/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be8b1dd125bb45c3b527f42bfa3ddd3ac8a86d1f3a92868da89995845df4ef72
3
+ size 58741039
p3/preprocess/Gaucher_Disease/GSE124283.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbf6cdbb730efd1adf7554a986616bb380f611a86075081385f38551a533ccaf
3
+ size 13242720
p3/preprocess/Gaucher_Disease/gene_data/GSE124283.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41a70b3aa68b2dd43e6127a1a309f3a499310049e83ceb4c78ff1c8dbdd3b562
3
+ size 26822063
p3/preprocess/Generalized_Anxiety_Disorder/gene_data/GSE61672.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc3ec7db3721c2df4aee7f88f4d34dde6e8caea3f63df7c671a696f04352165c
3
+ size 33639737
p3/preprocess/Glioblastoma/code/GSE134470.py ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE134470"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE134470"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE134470.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE134470.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE134470.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Based on background info, this is a gene expression microarray study with GeneChip® Human Gene 1.0ST array
38
+ is_gene_available = True
39
+
40
+ # 2. Variable Availability and Data Type Conversion
41
+ # Trait data is available in feature 0 - distinguishes normal brain vs GBM samples
42
+ trait_row = 0
43
+
44
+ # Age and gender not available in sample characteristics
45
+ age_row = None
46
+ gender_row = None
47
+
48
+ def convert_trait(value: str) -> Optional[float]:
49
+ """Convert tissue/sample type to binary: 0 for normal, 1 for GBM"""
50
+ if pd.isna(value):
51
+ return None
52
+ value = value.split(": ")[-1].lower()
53
+ if "normal brain" in value:
54
+ return 0.0
55
+ elif any(x in value for x in ["gbm", "tumor"]):
56
+ return 1.0
57
+ return None
58
+
59
+ def convert_age(value: str) -> Optional[float]:
60
+ return None
61
+
62
+ def convert_gender(value: str) -> Optional[float]:
63
+ return None
64
+
65
+ # 3. Save metadata - only initial filtering
66
+ validate_and_save_cohort_info(
67
+ is_final=False,
68
+ cohort=cohort,
69
+ info_path=json_path,
70
+ is_gene_available=is_gene_available,
71
+ is_trait_available=(trait_row is not None)
72
+ )
73
+
74
+ # 4. Clinical Feature Extraction
75
+ if trait_row is not None:
76
+ clinical_features = geo_select_clinical_features(
77
+ clinical_df=clinical_data,
78
+ trait=trait,
79
+ trait_row=trait_row,
80
+ convert_trait=convert_trait,
81
+ age_row=age_row,
82
+ convert_age=convert_age,
83
+ gender_row=gender_row,
84
+ convert_gender=convert_gender
85
+ )
86
+
87
+ # Preview the extracted features
88
+ preview_df(clinical_features)
89
+
90
+ # Save clinical data
91
+ clinical_features.to_csv(out_clinical_data_file)
92
+ # Extract gene expression data from matrix file
93
+ gene_data = get_genetic_data(matrix_file)
94
+
95
+ # Print first 20 row IDs and shape of data to help debug
96
+ print("Shape of gene expression data:", gene_data.shape)
97
+ print("\nFirst few rows of data:")
98
+ print(gene_data.head())
99
+ print("\nFirst 20 gene/probe identifiers:")
100
+ print(gene_data.index[:20])
101
+
102
+ # Inspect a snippet of raw file to verify identifier format
103
+ import gzip
104
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
105
+ lines = []
106
+ for i, line in enumerate(f):
107
+ if "!series_matrix_table_begin" in line:
108
+ # Get the next 5 lines after the marker
109
+ for _ in range(5):
110
+ lines.append(next(f).strip())
111
+ break
112
+ print("\nFirst few lines after matrix marker in raw file:")
113
+ for line in lines:
114
+ print(line)
115
+ # Looking at the identifiers (e.g. 7892501, 7892502) which are numeric and non-standard,
116
+ # and based on the raw file format starting with ID_REF, these appear to be probe IDs
117
+ # rather than gene symbols and will need to be mapped to gene symbols
118
+ requires_gene_mapping = True
119
+ # Get file paths using library function
120
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
121
+
122
+ # Extract gene annotation from SOFT file
123
+ gene_annotation = get_gene_annotation(soft_file)
124
+
125
+ # Preview gene annotation data
126
+ print("Gene annotation columns and example values:")
127
+ print(preview_df(gene_annotation))
128
+ # 1. From previews we can see 'ID' column matches the gene expression row IDs, and 'gene_assignment' has gene symbols
129
+
130
+ # 2. Get mapping between probe IDs and gene symbols
131
+ mapping_data = get_gene_mapping(gene_annotation, 'ID', 'gene_assignment')
132
+
133
+ # 3. Convert probe-level measurements to gene expression data using the mapping
134
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
135
+
136
+ # Save gene data to file
137
+ gene_data.to_csv(out_gene_data_file)
138
+ # 1. Normalize gene symbols and save normalized gene data
139
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
140
+ gene_data = normalize_gene_symbols_in_index(gene_data)
141
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
142
+ gene_data.to_csv(out_gene_data_file)
143
+
144
+ # 2. Link clinical and genetic data
145
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
146
+
147
+ # 3. Handle missing values
148
+ linked_data = handle_missing_values(linked_data, trait)
149
+
150
+ # 4. Check for biased features and remove them if needed
151
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
152
+
153
+ # 5. Validate and save cohort info
154
+ is_usable = validate_and_save_cohort_info(
155
+ is_final=True,
156
+ cohort=cohort,
157
+ info_path=json_path,
158
+ is_gene_available=True,
159
+ is_trait_available=True,
160
+ is_biased=is_biased,
161
+ df=linked_data,
162
+ note="Clinical trial studying EGFR amplification in glioblastoma and response to gefitinib"
163
+ )
164
+
165
+ # 6. Save linked data if usable
166
+ if is_usable:
167
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
168
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/code/GSE159000.py ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE159000"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE159000"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE159000.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE159000.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE159000.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # Gene expression data is available according to dataset title ("Gene expression profiles...")
37
+ is_gene_available = True
38
+
39
+ # Trait data not explicitly available but all samples are GBM according to background
40
+ trait_row = 0 # Use tissue type as trait indicator
41
+
42
+ # Age and gender data available
43
+ age_row = 2
44
+ gender_row = 1
45
+
46
+ def convert_trait(value):
47
+ if not isinstance(value, str):
48
+ return None
49
+ if "brain" in value.lower():
50
+ return 1 # All samples are GBM according to background
51
+ return None
52
+
53
+ def convert_age(value):
54
+ if not isinstance(value, str):
55
+ return None
56
+ try:
57
+ age = float(value.split(': ')[1])
58
+ return age
59
+ except:
60
+ return None
61
+
62
+ def convert_gender(value):
63
+ if not isinstance(value, str):
64
+ return None
65
+ sex = value.split(': ')[1].upper()
66
+ if sex == 'F':
67
+ return 0
68
+ elif sex == 'M':
69
+ return 1
70
+ return None
71
+
72
+ # Save initial filtering results
73
+ validate_and_save_cohort_info(is_final=False,
74
+ cohort=cohort,
75
+ info_path=json_path,
76
+ is_gene_available=is_gene_available,
77
+ is_trait_available=True)
78
+
79
+ # Extract clinical features
80
+ clinical_features = geo_select_clinical_features(clinical_df=clinical_data,
81
+ trait=trait,
82
+ trait_row=trait_row,
83
+ convert_trait=convert_trait,
84
+ age_row=age_row,
85
+ convert_age=convert_age,
86
+ gender_row=gender_row,
87
+ convert_gender=convert_gender)
88
+
89
+ # Preview and save clinical data
90
+ preview_df(clinical_features)
91
+ clinical_features.to_csv(out_clinical_data_file)
92
+ # Extract gene expression data from matrix file
93
+ gene_data = get_genetic_data(matrix_file)
94
+
95
+ # Print first 20 row IDs and shape of data to help debug
96
+ print("Shape of gene expression data:", gene_data.shape)
97
+ print("\nFirst few rows of data:")
98
+ print(gene_data.head())
99
+ print("\nFirst 20 gene/probe identifiers:")
100
+ print(gene_data.index[:20])
101
+
102
+ # Inspect a snippet of raw file to verify identifier format
103
+ import gzip
104
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
105
+ lines = []
106
+ for i, line in enumerate(f):
107
+ if "!series_matrix_table_begin" in line:
108
+ # Get the next 5 lines after the marker
109
+ for _ in range(5):
110
+ lines.append(next(f).strip())
111
+ break
112
+ print("\nFirst few lines after matrix marker in raw file:")
113
+ for line in lines:
114
+ print(line)
115
+ # The identifiers start with "ILMN_" which indicates they are Illumina probe IDs
116
+ # These are not standard human gene symbols and will need to be mapped
117
+ requires_gene_mapping = True
118
+ # Get file paths using library function
119
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
120
+
121
+ # Extract gene annotation from SOFT file
122
+ gene_annotation = get_gene_annotation(soft_file)
123
+
124
+ # Preview gene annotation data
125
+ print("Gene annotation columns and example values:")
126
+ print(preview_df(gene_annotation))
127
+ # Get gene mapping based on 'ID' (probe identifier) and 'Symbol' (gene symbol)
128
+ gene_mapping = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Symbol')
129
+
130
+ # Apply gene mapping to convert probe-level measurements to gene-level measurements
131
+ gene_data = apply_gene_mapping(gene_data, gene_mapping)
132
+
133
+ # Normalize gene symbols to handle synonyms
134
+ gene_data = normalize_gene_symbols_in_index(gene_data)
135
+ # 1. Normalize gene symbols and save normalized gene data
136
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
137
+ gene_data = normalize_gene_symbols_in_index(gene_data)
138
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
139
+ gene_data.to_csv(out_gene_data_file)
140
+
141
+ # 2. Link clinical and genetic data
142
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
143
+
144
+ # 3. Handle missing values
145
+ linked_data = handle_missing_values(linked_data, trait)
146
+
147
+ # 4. Check for biased features and remove them if needed
148
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
149
+
150
+ # 5. Validate and save cohort info
151
+ is_usable = validate_and_save_cohort_info(
152
+ is_final=True,
153
+ cohort=cohort,
154
+ info_path=json_path,
155
+ is_gene_available=True,
156
+ is_trait_available=True,
157
+ is_biased=is_biased,
158
+ df=linked_data,
159
+ note="Clinical trial studying EGFR amplification in glioblastoma and response to gefitinib"
160
+ )
161
+
162
+ # 6. Save linked data if usable
163
+ if is_usable:
164
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
165
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/code/GSE175700.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE175700"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE175700"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE175700.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE175700.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE175700.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # Gene data availability
37
+ # Yes - the dataset contains microarray data for gene expression analysis
38
+ is_gene_available = True
39
+
40
+ # Clinical feature keys and conversion functions
41
+ trait_row = None # All samples are U87 cell lines, no trait variation
42
+ age_row = None # Age not available for cell line data
43
+ gender_row = None # All samples are male cell line, no gender variation
44
+
45
+ # Since no clinical features are available with variation, we don't need conversion functions
46
+ def convert_trait(x):
47
+ return None
48
+
49
+ def convert_age(x):
50
+ return None
51
+
52
+ def convert_gender(x):
53
+ return None
54
+
55
+ # Save metadata
56
+ validate_and_save_cohort_info(is_final=False,
57
+ cohort=cohort,
58
+ info_path=json_path,
59
+ is_gene_available=is_gene_available,
60
+ is_trait_available=False) # trait_row is None so trait data unavailable
61
+
62
+ # Skip clinical feature extraction since no trait data available
63
+ # Extract gene expression data from matrix file
64
+ gene_data = get_genetic_data(matrix_file)
65
+
66
+ # Print first 20 row IDs and shape of data to help debug
67
+ print("Shape of gene expression data:", gene_data.shape)
68
+ print("\nFirst few rows of data:")
69
+ print(gene_data.head())
70
+ print("\nFirst 20 gene/probe identifiers:")
71
+ print(gene_data.index[:20])
72
+
73
+ # Inspect a snippet of raw file to verify identifier format
74
+ import gzip
75
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
76
+ lines = []
77
+ for i, line in enumerate(f):
78
+ if "!series_matrix_table_begin" in line:
79
+ # Get the next 5 lines after the marker
80
+ for _ in range(5):
81
+ lines.append(next(f).strip())
82
+ break
83
+ print("\nFirst few lines after matrix marker in raw file:")
84
+ for line in lines:
85
+ print(line)
86
+ # Looking at the identifiers starting with "AFFX-", these are Affymetrix probe IDs
87
+ # They need to be mapped to standard human gene symbols
88
+ requires_gene_mapping = True
89
+ # Get file paths using library function
90
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
91
+
92
+ # Extract gene annotation from SOFT file
93
+ gene_annotation = get_gene_annotation(soft_file)
94
+
95
+ # Preview gene annotation data
96
+ print("Gene annotation columns and example values:")
97
+ print(preview_df(gene_annotation))
98
+ # Get the mapping between probe IDs and gene symbols
99
+ mapping_df = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='gene_assignment')
100
+
101
+ # Apply the mapping to convert probe-level to gene-level expression
102
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
103
+
104
+ # Print dimensions to verify mapping result
105
+ print("\nShape of gene expression data after mapping:", gene_data.shape)
106
+ print("\nFirst few rows after mapping:")
107
+ print(gene_data.head())
108
+ # 1. Normalize gene symbols and save normalized gene data
109
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
110
+ gene_data = normalize_gene_symbols_in_index(gene_data)
111
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
112
+ gene_data.to_csv(out_gene_data_file)
113
+
114
+ # Update final validation info with gene_data as df and is_biased=True
115
+ is_usable = validate_and_save_cohort_info(
116
+ is_final=True,
117
+ cohort=cohort,
118
+ info_path=json_path,
119
+ is_gene_available=True,
120
+ is_trait_available=False,
121
+ is_biased=True, # No trait variation means completely biased
122
+ df=gene_data, # Pass gene_data as df
123
+ note="Cell line study with no trait variation - all samples are U87 cell line"
124
+ )
p3/preprocess/Glioblastoma/code/GSE178236.py ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE178236"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE178236"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE178236.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE178236.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE178236.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Based on background info mentioning "gene expression analysis" and "gene expression profile"
38
+ is_gene_available = True
39
+
40
+ # 2. Variable Availability and Data Type Conversion
41
+ # 2.1 Data Availability
42
+ trait_row = 5 # IDH status can indicate glioblastoma subtype
43
+ age_row = 2 # Age information available
44
+ gender_row = 1 # Gender information available
45
+
46
+ # 2.2 Data Type Conversion Functions
47
+ def convert_trait(x):
48
+ if not isinstance(x, str):
49
+ return None
50
+ value = x.split(': ')[-1].lower()
51
+ # Convert IDH status to binary: 1 for wild-type (wt), 0 for mutant (mut)
52
+ if 'wt' in value:
53
+ return 1
54
+ elif 'mut' in value:
55
+ return 0
56
+ return None
57
+
58
+ def convert_age(x):
59
+ if not isinstance(x, str):
60
+ return None
61
+ try:
62
+ # Extract numeric age value after colon
63
+ age = int(x.split(': ')[-1])
64
+ return age
65
+ except:
66
+ return None
67
+
68
+ def convert_gender(x):
69
+ if not isinstance(x, str):
70
+ return None
71
+ value = x.split(': ')[-1].lower()
72
+ if 'female' in value:
73
+ return 0
74
+ elif 'male' in value:
75
+ return 1
76
+ return None
77
+
78
+ # 3. Save Metadata
79
+ validate_and_save_cohort_info(is_final=False,
80
+ cohort=cohort,
81
+ info_path=json_path,
82
+ is_gene_available=is_gene_available,
83
+ is_trait_available=trait_row is not None)
84
+
85
+ # 4. Clinical Feature Extraction
86
+ # Since trait_row is not None, extract clinical features
87
+ clinical_features = geo_select_clinical_features(
88
+ clinical_df=clinical_data,
89
+ trait=trait,
90
+ trait_row=trait_row,
91
+ convert_trait=convert_trait,
92
+ age_row=age_row,
93
+ convert_age=convert_age,
94
+ gender_row=gender_row,
95
+ convert_gender=convert_gender
96
+ )
97
+
98
+ print("\nPreview of extracted clinical features:")
99
+ print(preview_df(clinical_features))
100
+
101
+ # Save clinical data
102
+ clinical_features.to_csv(out_clinical_data_file)
103
+ # Extract gene expression data from matrix file
104
+ gene_data = get_genetic_data(matrix_file)
105
+
106
+ # Print first 20 row IDs and shape of data to help debug
107
+ print("Shape of gene expression data:", gene_data.shape)
108
+ print("\nFirst few rows of data:")
109
+ print(gene_data.head())
110
+ print("\nFirst 20 gene/probe identifiers:")
111
+ print(gene_data.index[:20])
112
+
113
+ # Inspect a snippet of raw file to verify identifier format
114
+ import gzip
115
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
116
+ lines = []
117
+ for i, line in enumerate(f):
118
+ if "!series_matrix_table_begin" in line:
119
+ # Get the next 5 lines after the marker
120
+ for _ in range(5):
121
+ lines.append(next(f).strip())
122
+ break
123
+ print("\nFirst few lines after matrix marker in raw file:")
124
+ for line in lines:
125
+ print(line)
126
+ # Observe the identifiers start with "ILMN_" - these are Illumina probe IDs, not gene symbols
127
+ requires_gene_mapping = True
128
+ # Get file paths using library function
129
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
130
+
131
+ # Extract gene annotation from SOFT file
132
+ gene_annotation = get_gene_annotation(soft_file)
133
+
134
+ # Preview gene annotation data
135
+ print("Gene annotation columns and example values:")
136
+ print(preview_df(gene_annotation))
137
+ # Get mapping between probe IDs and gene symbols
138
+ mapping_df = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Symbol')
139
+
140
+ # Apply gene mapping to convert probe-level measurements to gene expression data
141
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
142
+
143
+ # Preview results
144
+ print("\nShape of gene expression data after mapping:", gene_data.shape)
145
+ print("\nFirst few rows of mapped gene expression data:")
146
+ print(gene_data.head())
147
+ # 1. Normalize gene symbols and save normalized gene data
148
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
149
+ gene_data = normalize_gene_symbols_in_index(gene_data)
150
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
151
+ gene_data.to_csv(out_gene_data_file)
152
+
153
+ # 2. Link clinical and genetic data
154
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
155
+
156
+ # 3. Handle missing values
157
+ linked_data = handle_missing_values(linked_data, trait)
158
+
159
+ # 4. Check for biased features and remove them if needed
160
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
161
+
162
+ # 5. Validate and save cohort info
163
+ is_usable = validate_and_save_cohort_info(
164
+ is_final=True,
165
+ cohort=cohort,
166
+ info_path=json_path,
167
+ is_gene_available=True,
168
+ is_trait_available=True,
169
+ is_biased=is_biased,
170
+ df=linked_data,
171
+ note="Clinical trial studying EGFR amplification in glioblastoma and response to gefitinib"
172
+ )
173
+
174
+ # 6. Save linked data if usable
175
+ if is_usable:
176
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
177
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/code/GSE226976.py ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE226976"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE226976"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE226976.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE226976.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE226976.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # From series title and summary, this is gene expression data for glioblastoma samples
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability
41
+ # Trait data (recurrent glioma) is available in row 0
42
+ trait_row = 0
43
+
44
+ # Age and gender not available in sample characteristics
45
+ age_row = None
46
+ gender_row = None
47
+
48
+ # 2.2 Data Type Conversion Functions
49
+ def convert_trait(x):
50
+ if pd.isna(x):
51
+ return None
52
+ # Extract value after colon
53
+ value = x.split(':')[1].strip().lower()
54
+ # Convert to binary - sample is recurrent glioma
55
+ if 'recurrent glioma' in value:
56
+ return 1
57
+ else:
58
+ return None
59
+
60
+ convert_age = None
61
+ convert_gender = None
62
+
63
+ # 3. Save metadata
64
+ validate_and_save_cohort_info(
65
+ is_final=False,
66
+ cohort=cohort,
67
+ info_path=json_path,
68
+ is_gene_available=is_gene_available,
69
+ is_trait_available=(trait_row is not None)
70
+ )
71
+
72
+ # 4. Extract clinical features since trait_row is not None
73
+ clinical_features = geo_select_clinical_features(
74
+ clinical_df=clinical_data,
75
+ trait=trait,
76
+ trait_row=trait_row,
77
+ convert_trait=convert_trait,
78
+ age_row=age_row,
79
+ convert_age=convert_age,
80
+ gender_row=gender_row,
81
+ convert_gender=convert_gender
82
+ )
83
+
84
+ # Preview and save clinical features
85
+ print("Clinical features preview:")
86
+ print(preview_df(clinical_features))
87
+
88
+ clinical_features.to_csv(out_clinical_data_file)
89
+ # Extract gene expression data from matrix file
90
+ gene_data = get_genetic_data(matrix_file)
91
+
92
+ # Print first 20 row IDs and shape of data to help debug
93
+ print("Shape of gene expression data:", gene_data.shape)
94
+ print("\nFirst few rows of data:")
95
+ print(gene_data.head())
96
+ print("\nFirst 20 gene/probe identifiers:")
97
+ print(gene_data.index[:20])
98
+
99
+ # Inspect a snippet of raw file to verify identifier format
100
+ import gzip
101
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
102
+ lines = []
103
+ for i, line in enumerate(f):
104
+ if "!series_matrix_table_begin" in line:
105
+ # Get the next 5 lines after the marker
106
+ for _ in range(5):
107
+ lines.append(next(f).strip())
108
+ break
109
+ print("\nFirst few lines after matrix marker in raw file:")
110
+ for line in lines:
111
+ print(line)
112
+ # Looking at the first 20 gene identifiers, they appear to be valid HGNC gene symbols
113
+ # Examples like A2M, ABCF1, ACVR1C, ADAM12, ADGRE1 etc. are all recognized human gene symbols
114
+ # No mapping needed since the data already uses standard gene symbols
115
+ requires_gene_mapping = False
116
+ # 1. Normalize gene symbols and save normalized gene data
117
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
118
+ gene_data = normalize_gene_symbols_in_index(gene_data)
119
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
120
+ gene_data.to_csv(out_gene_data_file)
121
+
122
+ # 2. Link clinical and genetic data
123
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
124
+
125
+ # 3. Handle missing values
126
+ linked_data = handle_missing_values(linked_data, trait)
127
+
128
+ # 4. Check for biased features and remove them if needed
129
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
130
+
131
+ # 5. Validate and save cohort info
132
+ is_usable = validate_and_save_cohort_info(
133
+ is_final=True,
134
+ cohort=cohort,
135
+ info_path=json_path,
136
+ is_gene_available=True,
137
+ is_trait_available=True,
138
+ is_biased=is_biased,
139
+ df=linked_data,
140
+ note="Clinical trial studying EGFR amplification in glioblastoma and response to gefitinib"
141
+ )
142
+
143
+ # 6. Save linked data if usable
144
+ if is_usable:
145
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
146
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/code/GSE249289.py ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE249289"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE249289"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE249289.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE249289.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE249289.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene expression data availability check
37
+ is_gene_available = True # Based on series title and design, this is gene expression data
38
+
39
+ # 2. Data availability and conversion functions
40
+ trait_row = None # No direct disease status as all samples are glioblastoma
41
+ age_row = 2 # Age information is in row 2
42
+ gender_row = 1 # Gender information is in row 1
43
+
44
+ def convert_age(x):
45
+ try:
46
+ # Extract numeric value after colon
47
+ age = int(x.split(': ')[1])
48
+ return age
49
+ except:
50
+ return None
51
+
52
+ def convert_gender(x):
53
+ try:
54
+ # Extract value after colon and convert to binary
55
+ gender = x.split(': ')[1].lower()
56
+ if gender == 'female':
57
+ return 0
58
+ elif gender == 'male':
59
+ return 1
60
+ return None
61
+ except:
62
+ return None
63
+
64
+ def convert_trait(x):
65
+ # Not used as trait data not available
66
+ return None
67
+
68
+ # 3. Save metadata
69
+ is_trait_available = trait_row is not None
70
+ validate_and_save_cohort_info(is_final=False,
71
+ cohort=cohort,
72
+ info_path=json_path,
73
+ is_gene_available=is_gene_available,
74
+ is_trait_available=is_trait_available)
75
+
76
+ # 4. Extract clinical features if available
77
+ # Skip this step since trait_row is None
78
+ # Extract gene expression data from matrix file
79
+ gene_data = get_genetic_data(matrix_file)
80
+
81
+ # Print first 20 row IDs and shape of data to help debug
82
+ print("Shape of gene expression data:", gene_data.shape)
83
+ print("\nFirst few rows of data:")
84
+ print(gene_data.head())
85
+ print("\nFirst 20 gene/probe identifiers:")
86
+ print(gene_data.index[:20])
87
+
88
+ # Inspect a snippet of raw file to verify identifier format
89
+ import gzip
90
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
91
+ lines = []
92
+ for i, line in enumerate(f):
93
+ if "!series_matrix_table_begin" in line:
94
+ # Get the next 5 lines after the marker
95
+ for _ in range(5):
96
+ lines.append(next(f).strip())
97
+ break
98
+ print("\nFirst few lines after matrix marker in raw file:")
99
+ for line in lines:
100
+ print(line)
101
+ # The identifiers start with "ILMN_" which indicates they are Illumina probe IDs
102
+ # These need to be mapped to official human gene symbols for analysis
103
+ requires_gene_mapping = True
104
+ # Get file paths using library function
105
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
106
+
107
+ # Extract gene annotation from SOFT file
108
+ gene_annotation = get_gene_annotation(soft_file)
109
+
110
+ # Preview gene annotation data
111
+ print("Gene annotation columns and example values:")
112
+ print(preview_df(gene_annotation))
113
+ # Get mapping dataframe with ID and Symbol columns from gene annotation
114
+ gene_mapping = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Symbol')
115
+
116
+ # Apply mapping to convert probe-level measurements to gene expression data
117
+ gene_data = apply_gene_mapping(gene_data, gene_mapping)
118
+
119
+ # Print shape and preview to verify the mapping result
120
+ print("Shape of gene expression data after mapping:", gene_data.shape)
121
+ print("\nFirst few rows of mapped data:")
122
+ print(gene_data.head())
123
+ # 1. Normalize gene symbols and save normalized gene data
124
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
125
+ gene_data = normalize_gene_symbols_in_index(gene_data)
126
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
127
+ gene_data.to_csv(out_gene_data_file)
128
+
129
+ # 2. Extract clinical features and link with genetic data
130
+ clinical_features = geo_select_clinical_features(
131
+ clinical_data,
132
+ trait=trait,
133
+ trait_row=None,
134
+ age_row=2,
135
+ convert_age=convert_age,
136
+ gender_row=1,
137
+ convert_gender=convert_gender
138
+ )
139
+
140
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
141
+
142
+ # 3. Handle missing values
143
+ linked_data = handle_missing_values(linked_data, "Age") # Use Age as primary feature since trait is not available
144
+
145
+ # 4. Check for biased features and remove them if needed
146
+ is_biased = False # Only demographic features, no trait to be biased
147
+ linked_data = judge_and_remove_biased_features(linked_data, "Age")[1] # Use Age since trait is not available
148
+
149
+ # 5. Validate and save cohort info
150
+ validate_and_save_cohort_info(
151
+ is_final=True,
152
+ cohort=cohort,
153
+ info_path=json_path,
154
+ is_gene_available=True,
155
+ is_trait_available=False,
156
+ is_biased=is_biased,
157
+ df=linked_data,
158
+ note="Contains gene expression data with age and gender information, but no trait data for analysis"
159
+ )
160
+
161
+ # 6. Save linked data with demographic features
162
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
163
+ linked_data.to_csv(out_data_file)
164
+ # 1. Normalize gene symbols and save normalized gene data
165
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
166
+ gene_data = normalize_gene_symbols_in_index(gene_data)
167
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
168
+ gene_data.to_csv(out_gene_data_file)
169
+
170
+ # 2. Record metadata about dataset's unavailability for trait analysis
171
+ validate_and_save_cohort_info(
172
+ is_final=True,
173
+ cohort=cohort,
174
+ info_path=json_path,
175
+ is_gene_available=True,
176
+ is_trait_available=False,
177
+ is_biased=None,
178
+ df=None,
179
+ note="Contains gene expression data from glioblastoma tumorspheres but no control samples for trait analysis"
180
+ )
p3/preprocess/Glioblastoma/code/GSE279426.py ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE279426"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE279426"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE279426.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE279426.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE279426.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes, this is gene expression data based on the background info
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability
41
+
42
+ # For trait (Glioblastoma): EGFR amplification status is available and relevant
43
+ trait_row = 4 # egfr_amplification: A0/A1
44
+
45
+ # Age and gender are not available in the data
46
+ age_row = None
47
+ gender_row = None
48
+
49
+ # 2.2 Data Type Conversion Functions
50
+ def convert_trait(value: str) -> int:
51
+ """Convert EGFR amplification status to binary"""
52
+ if pd.isna(value) or value is None:
53
+ return None
54
+ value = value.split(': ')[-1].strip()
55
+ if value == 'A0': # Not amplified
56
+ return 0
57
+ elif value == 'A1': # Amplified
58
+ return 1
59
+ return None
60
+
61
+ def convert_age(value: str) -> float:
62
+ """Placeholder function since age data not available"""
63
+ return None
64
+
65
+ def convert_gender(value: str) -> int:
66
+ """Placeholder function since gender data not available"""
67
+ return None
68
+
69
+ # 3. Save metadata and do initial filtering
70
+ is_trait_available = trait_row is not None
71
+ validate_and_save_cohort_info(is_final=False, cohort=cohort, info_path=json_path,
72
+ is_gene_available=is_gene_available,
73
+ is_trait_available=is_trait_available)
74
+
75
+ # 4. Clinical Feature Extraction
76
+ if trait_row is not None:
77
+ clinical_features = geo_select_clinical_features(clinical_data, trait, trait_row, convert_trait,
78
+ age_row, convert_age,
79
+ gender_row, convert_gender)
80
+ print("Preview of extracted clinical features:")
81
+ print(preview_df(clinical_features))
82
+ clinical_features.to_csv(out_clinical_data_file)
83
+ # Extract gene expression data from matrix file
84
+ gene_data = get_genetic_data(matrix_file)
85
+
86
+ # Print first 20 row IDs and shape of data to help debug
87
+ print("Shape of gene expression data:", gene_data.shape)
88
+ print("\nFirst few rows of data:")
89
+ print(gene_data.head())
90
+ print("\nFirst 20 gene/probe identifiers:")
91
+ print(gene_data.index[:20])
92
+
93
+ # Inspect a snippet of raw file to verify identifier format
94
+ import gzip
95
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
96
+ lines = []
97
+ for i, line in enumerate(f):
98
+ if "!series_matrix_table_begin" in line:
99
+ # Get the next 5 lines after the marker
100
+ for _ in range(5):
101
+ lines.append(next(f).strip())
102
+ break
103
+ print("\nFirst few lines after matrix marker in raw file:")
104
+ for line in lines:
105
+ print(line)
106
+ # Analyzing the gene identifiers
107
+ # The identifiers (e.g. "1007_s_at", "1053_at") appear to be Affymetrix probe IDs
108
+ # These need to be mapped to standard human gene symbols for analysis
109
+ requires_gene_mapping = True
110
+ # Get file paths using library function
111
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
112
+
113
+ # Extract gene annotation from SOFT file
114
+ gene_annotation = get_gene_annotation(soft_file)
115
+
116
+ # Preview gene annotation data
117
+ print("Gene annotation columns and example values:")
118
+ print(preview_df(gene_annotation))
119
+ # Extract gene mapping from annotation data
120
+ mapping_df = get_gene_mapping(gene_annotation, 'ID', 'Gene Symbol')
121
+
122
+ # Apply gene mapping to convert probe-level data to gene expression data
123
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
124
+
125
+ # Preview result to verify
126
+ print("Shape of gene expression data after mapping:", gene_data.shape)
127
+ print("\nFirst few rows of mapped data:")
128
+ print(gene_data.head())
129
+ # 1. Normalize gene symbols and save normalized gene data
130
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
131
+ gene_data = normalize_gene_symbols_in_index(gene_data)
132
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
133
+ gene_data.to_csv(out_gene_data_file)
134
+
135
+ # 2. Link clinical and genetic data
136
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
137
+
138
+ # 3. Handle missing values
139
+ linked_data = handle_missing_values(linked_data, trait)
140
+
141
+ # 4. Check for biased features and remove them if needed
142
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
143
+
144
+ # 5. Validate and save cohort info
145
+ is_usable = validate_and_save_cohort_info(
146
+ is_final=True,
147
+ cohort=cohort,
148
+ info_path=json_path,
149
+ is_gene_available=True,
150
+ is_trait_available=True,
151
+ is_biased=is_biased,
152
+ df=linked_data,
153
+ note="Clinical trial studying EGFR amplification in glioblastoma and response to gefitinib"
154
+ )
155
+
156
+ # 6. Save linked data if usable
157
+ if is_usable:
158
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
159
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/code/GSE39144.py ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+ cohort = "GSE39144"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Glioblastoma"
10
+ in_cohort_dir = "../DATA/GEO/Glioblastoma/GSE39144"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Glioblastoma/GSE39144.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/GSE39144.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/GSE39144.csv"
16
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # GeneChip Human Genome U133 Plus 2.0 Array was used, indicating gene expression data
38
+ is_gene_available = True
39
+
40
+ # 2. Variable Availability and Data Type Conversion
41
+ # 2.1 Data Availability
42
+
43
+ # For trait: Feature 0 contains "cell type: glioma-initiating cells" which indicates glioblastoma samples
44
+ trait_row = 0
45
+
46
+ # Age: No age information available in sample characteristics
47
+ age_row = None
48
+
49
+ # Gender: Feature 2 contains gender information
50
+ gender_row = 2
51
+
52
+ # 2.2 Data Type Conversion Functions
53
+ def convert_trait(value: str) -> int:
54
+ # Convert glioma vs non-glioma
55
+ if "glioma-initiating cells" in value.lower():
56
+ return 1
57
+ return 0
58
+
59
+ def convert_age(value: str) -> float:
60
+ # Not used but defined for completeness
61
+ return None
62
+
63
+ def convert_gender(value: str) -> int:
64
+ # Extract value after colon and convert to binary
65
+ if ":" in value:
66
+ gender = value.split(":")[1].strip().lower()
67
+ if gender == "female":
68
+ return 0
69
+ elif gender == "male":
70
+ return 1
71
+ elif "pooled female" in gender:
72
+ return 0
73
+ elif "pooled male" in gender:
74
+ return 1
75
+ return None
76
+
77
+ # 3. Save Metadata
78
+ validate_and_save_cohort_info(
79
+ is_final=False,
80
+ cohort=cohort,
81
+ info_path=json_path,
82
+ is_gene_available=is_gene_available,
83
+ is_trait_available=(trait_row is not None)
84
+ )
85
+
86
+ # 4. Clinical Feature Extraction
87
+ # Extract clinical features since trait_row is not None
88
+ clinical_df = geo_select_clinical_features(
89
+ clinical_df=clinical_data,
90
+ trait=trait,
91
+ trait_row=trait_row,
92
+ convert_trait=convert_trait,
93
+ age_row=age_row,
94
+ convert_age=convert_age,
95
+ gender_row=gender_row,
96
+ convert_gender=convert_gender
97
+ )
98
+
99
+ # Preview the extracted features
100
+ preview_result = preview_df(clinical_df)
101
+ print("Preview of clinical features:")
102
+ print(preview_result)
103
+
104
+ # Save clinical data
105
+ clinical_df.to_csv(out_clinical_data_file)
106
+ # Extract gene expression data from matrix file
107
+ gene_data = get_genetic_data(matrix_file)
108
+
109
+ # Print first 20 row IDs and shape of data to help debug
110
+ print("Shape of gene expression data:", gene_data.shape)
111
+ print("\nFirst few rows of data:")
112
+ print(gene_data.head())
113
+ print("\nFirst 20 gene/probe identifiers:")
114
+ print(gene_data.index[:20])
115
+
116
+ # Inspect a snippet of raw file to verify identifier format
117
+ import gzip
118
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
119
+ lines = []
120
+ for i, line in enumerate(f):
121
+ if "!series_matrix_table_begin" in line:
122
+ # Get the next 5 lines after the marker
123
+ for _ in range(5):
124
+ lines.append(next(f).strip())
125
+ break
126
+ print("\nFirst few lines after matrix marker in raw file:")
127
+ for line in lines:
128
+ print(line)
129
+ # Examine the gene identifiers - these are Affymetrix probe IDs that require mapping to gene symbols
130
+ # Format: XXXXX_at, XXXXX_s_at, XXXXX_x_at etc.
131
+ # These are probe set IDs from Affymetrix arrays, not gene symbols
132
+ requires_gene_mapping = True
133
+ # Get file paths using library function
134
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
135
+
136
+ # Extract gene annotation from SOFT file
137
+ gene_annotation = get_gene_annotation(soft_file)
138
+
139
+ # Preview gene annotation data
140
+ print("Gene annotation columns and example values:")
141
+ print(preview_df(gene_annotation))
142
+ # 1. Identify relevant columns from gene annotation
143
+ # 'ID' column matches probe IDs in gene expression data
144
+ # 'Gene Symbol' column contains the gene symbols
145
+ prob_col = 'ID'
146
+ gene_col = 'Gene Symbol'
147
+
148
+ # 2. Get mapping between probe IDs and gene symbols
149
+ mapping_df = get_gene_mapping(gene_annotation, prob_col, gene_col)
150
+
151
+ # 3. Apply mapping to convert probe-level data to gene-level data
152
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
153
+
154
+ # Preview result
155
+ print("Shape of mapped gene expression data:", gene_data.shape)
156
+ print("\nFirst few rows of mapped data:")
157
+ print(gene_data.head())
158
+ # 1. Normalize gene symbols and save normalized gene data
159
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
160
+ gene_data = normalize_gene_symbols_in_index(gene_data)
161
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
162
+ gene_data.to_csv(out_gene_data_file)
163
+
164
+ # 2. Link clinical and genetic data
165
+ linked_data = geo_link_clinical_genetic_data(clinical_df, gene_data)
166
+
167
+ # 3. Handle missing values
168
+ linked_data = handle_missing_values(linked_data, trait)
169
+
170
+ # 4. Check for biased features and remove them if needed
171
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
172
+
173
+ # 5. Validate and save cohort info
174
+ is_usable = validate_and_save_cohort_info(
175
+ is_final=True,
176
+ cohort=cohort,
177
+ info_path=json_path,
178
+ is_gene_available=True,
179
+ is_trait_available=True,
180
+ is_biased=is_biased,
181
+ df=linked_data,
182
+ note="Gene expression data from hiPSCs, hESCs and differentiated cells, including glioblastoma cells"
183
+ )
184
+
185
+ # 6. Save linked data if usable
186
+ if is_usable:
187
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
188
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/code/TCGA.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Glioblastoma"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/3/Glioblastoma/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/3/Glioblastoma/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/3/Glioblastoma/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/3/Glioblastoma/cohort_info.json"
15
+
16
+ # 1. Select the relevant subdirectory for glioblastoma
17
+ subdirectory = 'TCGA_Glioblastoma_(GBM)'
18
+ cohort_dir = os.path.join(tcga_root_dir, subdirectory)
19
+
20
+ # 2. Get the file paths
21
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
22
+
23
+ # 3. Load the data files
24
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
25
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
26
+
27
+ # 4. Print clinical data columns
28
+ print("Clinical data columns:")
29
+ print(clinical_df.columns.tolist())
30
+ # Define candidate columns for age and gender
31
+ candidate_age_cols = ['CDE_DxAge', 'age_at_initial_pathologic_diagnosis', 'days_to_birth']
32
+ candidate_gender_cols = ['gender']
33
+
34
+ # Preview age and gender columns from clinical data
35
+ age_cols_dict = clinical_df[candidate_age_cols].head(5).to_dict('list')
36
+ print(f"Age columns preview: {age_cols_dict}")
37
+
38
+ gender_cols_dict = clinical_df[candidate_gender_cols].head(5).to_dict('list')
39
+ print(f"Gender columns preview: {gender_cols_dict}")
40
+ # Analyze age columns
41
+ age_col = 'age_at_initial_pathologic_diagnosis' # Choose this as it provides direct age values in years
42
+
43
+ # Analyze gender columns
44
+ gender_col = 'gender' # Only one gender column available
45
+
46
+ # Print chosen columns
47
+ print(f"Chosen age column: {age_col}")
48
+ print(f"Chosen gender column: {gender_col}")
49
+ # 1. Extract and standardize clinical features
50
+ # Create trait labels from sample IDs (01-09: tumor=1, 10-19: normal=0)
51
+ clinical_features = tcga_select_clinical_features(
52
+ clinical_df,
53
+ trait=trait,
54
+ age_col='age_at_initial_pathologic_diagnosis',
55
+ gender_col='gender'
56
+ )
57
+ # Save clinical data
58
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
59
+ clinical_features.to_csv(out_clinical_data_file)
60
+
61
+ # 2. Normalize gene symbols and save
62
+ normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
63
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
64
+ normalized_gene_df.to_csv(out_gene_data_file)
65
+
66
+ # 3. Link clinical and genetic data on sample IDs
67
+ linked_data = pd.merge(
68
+ clinical_features,
69
+ normalized_gene_df.T,
70
+ left_index=True,
71
+ right_index=True,
72
+ how='inner'
73
+ )
74
+
75
+ # 4. Handle missing values systematically
76
+ linked_data = handle_missing_values(linked_data, trait)
77
+
78
+ # 5. Check for bias in trait and demographic features
79
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
80
+
81
+ # 6. Validate data quality and save cohort info
82
+ note = "Contains molecular data from tumor and normal samples with patient demographics."
83
+ is_usable = validate_and_save_cohort_info(
84
+ is_final=True,
85
+ cohort="TCGA",
86
+ info_path=json_path,
87
+ is_gene_available=True,
88
+ is_trait_available=True,
89
+ is_biased=trait_biased,
90
+ df=linked_data,
91
+ note=note
92
+ )
93
+
94
+ # 7. Save linked data if usable
95
+ if is_usable:
96
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
97
+ linked_data.to_csv(out_data_file)
p3/preprocess/Glioblastoma/gene_data/GSE134470.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba24674f901fdcc483785dd18b8239b22bc3a75e85a2fec50cc5b0e1b6fbd16d
3
+ size 21960028
p3/preprocess/Glioblastoma/gene_data/GSE148949.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b3b053d323f55d881c67cded230cd46ecbed8115f2109c1f264fd33992ccfe8
3
+ size 12311824
p3/preprocess/Glioblastoma/gene_data/GSE159000.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Glioblastoma/gene_data/GSE175700.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f2dfe914271f10264fd743ea3f6f4c4e442f6a119d03c7a1f15a4b24456c84d
3
+ size 14207713
p3/preprocess/Glioblastoma/gene_data/GSE178236.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9cb9c85cce7814f435afbf3c3183ab56c3b9c9558796a01af7a341b9b4d74b60
3
+ size 16314430
p3/preprocess/Glioblastoma/gene_data/GSE226976.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Glioblastoma/gene_data/GSE249289.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Glioblastoma/gene_data/GSE279426.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Glioblastoma/gene_data/GSE39144.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca8e547fab39366c1235367f25cf9a1dcc790d5f45a33b7ddf2e206991dc7b75
3
+ size 11323495
p3/preprocess/Glucocorticoid_Sensitivity/GSE15820.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1fe367772062a079b48c1f43fb9a3111bbda4737e4ad36c32196eb93904f698
3
+ size 12945495
p3/preprocess/Glucocorticoid_Sensitivity/GSE32962.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c39f2e7b86d5d4bcbff093218c2cd89b39592eb354acbcf2a8dd7e55ae38e53
3
+ size 11282644
p3/preprocess/Glucocorticoid_Sensitivity/GSE33649.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ec24c22f36b155d3d763de2a907f48f4cc579f67d061faf09e9dd620245a932
3
+ size 12458722
p3/preprocess/Glucocorticoid_Sensitivity/GSE42002.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f3b847078ed22bfb662706b6bb465a2d781f5d7df13c530db72738d93d929b7
3
+ size 30057351
p3/preprocess/Glucocorticoid_Sensitivity/GSE48801.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:107dd3ce82a7e500dcbc9fa16416ba9e54c6cb3ae859e6c638e267124fcfab0c
3
+ size 62735272
p3/preprocess/Glucocorticoid_Sensitivity/GSE50012.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13e5be0799926ff09044729020f0f30d5d5045301e69cf039128128a8c629024
3
+ size 20850626
p3/preprocess/Glucocorticoid_Sensitivity/GSE57795.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d131f713cb4ba47ea1d90397a46ad5d0ee96fdfa8bb1c641f3735690c1c6426e
3
+ size 12922651
p3/preprocess/Glucocorticoid_Sensitivity/GSE58715.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Glucocorticoid_Sensitivity/GSE65645.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36ab6af2d92bb4cfbd1171a957deb908747938ec14a16da21f7ef5e1e9aaad1e
3
+ size 10919885
p3/preprocess/Glucocorticoid_Sensitivity/GSE66705.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f244baedf43be9c9c286cc600df1f4ce5df3f0727083c3e8c2c671dabb870e5
3
+ size 27520522
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE15820.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM397450,GSM397451,GSM397452,GSM397453,GSM397454,GSM397455,GSM397456,GSM397457,GSM397458,GSM397459,GSM397460,GSM397461,GSM397462,GSM397463,GSM397464,GSM397465,GSM397466,GSM397467,GSM397468,GSM397469,GSM397470,GSM397471,GSM397472,GSM397473,GSM397474,GSM397475,GSM397476,GSM397477,GSM397478,GSM397479,GSM397480,GSM397481,GSM397482,GSM397483,GSM397484,GSM397485,GSM397486,GSM397487,GSM397488,GSM397489
2
+ Glucocorticoid_Sensitivity,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE32962.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM816393,GSM816394,GSM816395,GSM816396,GSM816397,GSM816398,GSM816399,GSM816400,GSM816401,GSM816402,GSM816403,GSM816404,GSM816405,GSM816406,GSM816407,GSM816408,GSM816409,GSM816410,GSM816411,GSM816412,GSM816413,GSM816414,GSM816415,GSM816416,GSM816417,GSM816418,GSM816419,GSM816420,GSM816421,GSM816422,GSM816423,GSM816424,GSM816425,GSM816426,GSM816427,GSM816428,GSM816429,GSM816430,GSM816431,GSM816432,GSM816433,GSM816434,GSM816435
2
+ Glucocorticoid_Sensitivity,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE33649.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM832137,GSM832138,GSM832139,GSM832140,GSM832141,GSM832142,GSM832143,GSM832144,GSM832145,GSM832146,GSM832147,GSM832148,GSM832149,GSM832150,GSM832151,GSM832152,GSM832153,GSM832154,GSM832155,GSM832156,GSM832157,GSM832158,GSM832159,GSM832160,GSM832161,GSM832162,GSM832163,GSM832164,GSM832165,GSM832166,GSM832167,GSM832168,GSM832169,GSM832170,GSM832171,GSM832172,GSM832173,GSM832174,GSM832175,GSM832176,GSM832177,GSM832178,GSM832179,GSM832180,GSM832181,GSM832182,GSM832183,GSM832184
2
+ Glucocorticoid_Sensitivity,89.43486,89.43486,89.43486,89.43486,95.88507,95.88507,95.88507,95.88507,95.22036,95.22036,95.22036,95.22036,92.86704,92.86704,92.86704,92.86704,93.71633,93.71633,93.71633,93.71633,96.76962,96.76962,96.76962,96.76962,88.55031,88.55031,88.55031,88.55031,90.09957,90.09957,90.09957,90.09957,94.17097,94.17097,94.17097,94.17097,86.97089,86.97089,86.97089,86.97089,98.34904,98.34904,98.34904,98.34904,91.14896,91.14896,91.14896,91.14896
3
+ Age,44.15342,44.15342,44.15342,44.15342,24.72329,24.72329,24.72329,24.72329,32.37808,32.37808,32.37808,32.37808,20.38082,20.38082,20.38082,20.38082,21.2411,21.2411,21.2411,21.2411,22.54247,22.54247,22.54247,22.54247,26.13973,26.13973,26.13973,26.13973,21.5616,21.5616,21.5616,21.5616,21.9863,21.9863,21.9863,21.9863,26.76712,26.76712,26.76712,26.76712,23.59452,23.59452,23.59452,23.59452,23.47945,23.47945,23.47945,23.47945
4
+ Gender,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE42002.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1030400,GSM1030401,GSM1030402,GSM1030403,GSM1030404,GSM1030405,GSM1030406,GSM1030407,GSM1030408,GSM1030409,GSM1030410,GSM1030411,GSM1030412,GSM1030413,GSM1030414,GSM1030415,GSM1030416,GSM1030417,GSM1030418,GSM1030419,GSM1030420,GSM1030421,GSM1030422,GSM1030423,GSM1030424,GSM1030425,GSM1030426,GSM1030427,GSM1030428,GSM1030429,GSM1030430,GSM1030431,GSM1030432,GSM1030433,GSM1030434,GSM1030435,GSM1030436,GSM1030437,GSM1030438,GSM1030439,GSM1030440,GSM1030441,GSM1030442,GSM1030443,GSM1030444,GSM1030445,GSM1030446,GSM1030447,GSM1030448,GSM1030449,GSM1030450,GSM1030451,GSM1030452,GSM1030453,GSM1030454,GSM1030455,GSM1030456,GSM1030457,GSM1030458,GSM1030459,GSM1030460,GSM1030461,GSM1030462,GSM1030463,GSM1030464,GSM1030465,GSM1030466,GSM1030467,GSM1030468,GSM1030469,GSM1030470,GSM1030471,GSM1030472,GSM1030473,GSM1030474,GSM1030475,GSM1030476,GSM1030477,GSM1030478,GSM1030479,GSM1030480,GSM1030481,GSM1030482,GSM1030483,GSM1030484,GSM1030485,GSM1030486,GSM1030487,GSM1030488,GSM1030489,GSM1030490,GSM1030491,GSM1030492,GSM1030493,GSM1030494,GSM1030495,GSM1030496,GSM1030497,GSM1030498,GSM1030499,GSM1030500,GSM1030501,GSM1030502,GSM1030503,GSM1030504,GSM1030505,GSM1030506,GSM1030507,GSM1030508,GSM1030509,GSM1030510,GSM1030511,GSM1030512,GSM1030513,GSM1030514,GSM1030515,GSM1030516,GSM1030517,GSM1030518,GSM1030519,GSM1030520,GSM1030521,GSM1030522,GSM1030523,GSM1030524,GSM1030525,GSM1030526,GSM1030527,GSM1030528
2
+ Glucocorticoid_Sensitivity,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE48801.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1184717,GSM1184718,GSM1184719,GSM1184720,GSM1184721,GSM1184722,GSM1184723,GSM1184724,GSM1184725,GSM1184726,GSM1184727,GSM1184728,GSM1184729,GSM1184730,GSM1184731,GSM1184732,GSM1184733,GSM1184734,GSM1184735,GSM1184736,GSM1184737,GSM1184738,GSM1184739,GSM1184740,GSM1184741,GSM1184742,GSM1184743,GSM1184744,GSM1184745,GSM1184746,GSM1184747,GSM1184748,GSM1184749,GSM1184750,GSM1184751,GSM1184752,GSM1184753,GSM1184754,GSM1184755,GSM1184756,GSM1184757,GSM1184758,GSM1184759,GSM1184760,GSM1184761,GSM1184762,GSM1184763,GSM1184764,GSM1184765,GSM1184766,GSM1184767,GSM1184768,GSM1184769,GSM1184770,GSM1184771,GSM1184772,GSM1184773,GSM1184774,GSM1184775,GSM1184776,GSM1184777,GSM1184778,GSM1184779,GSM1184780,GSM1184781,GSM1184782,GSM1184783,GSM1184784,GSM1184785,GSM1184786,GSM1184787,GSM1184788,GSM1184789,GSM1184790,GSM1184791,GSM1184792,GSM1184793,GSM1184794,GSM1184795,GSM1184796,GSM1184797,GSM1184798,GSM1184799,GSM1184800,GSM1184801,GSM1184802,GSM1184803,GSM1184804,GSM1184805,GSM1184806,GSM1184807,GSM1184808,GSM1184809,GSM1184810,GSM1184811,GSM1184812,GSM1184813,GSM1184814,GSM1184815,GSM1184816,GSM1184817,GSM1184818,GSM1184819,GSM1184820,GSM1184821,GSM1184822,GSM1184823,GSM1184824,GSM1184825,GSM1184826,GSM1184827,GSM1184828,GSM1184829,GSM1184830,GSM1184831,GSM1184832,GSM1184833,GSM1184834,GSM1184835,GSM1184836,GSM1184837,GSM1184838,GSM1184839,GSM1184840,GSM1184841,GSM1184842,GSM1184843,GSM1184844,GSM1184845,GSM1184846,GSM1184847,GSM1184848,GSM1184849,GSM1184850,GSM1184851,GSM1184852,GSM1184853,GSM1184854,GSM1184855,GSM1184856,GSM1184857,GSM1184858,GSM1184859,GSM1184860,GSM1184861,GSM1184862,GSM1184863,GSM1184864,GSM1184865,GSM1184866,GSM1184867,GSM1184868,GSM1184869,GSM1184870,GSM1184871,GSM1184872,GSM1184873,GSM1184874,GSM1184875,GSM1184876,GSM1184877,GSM1184878,GSM1184879,GSM1184880,GSM1184881,GSM1184882,GSM1184883,GSM1184884,GSM1184885,GSM1184886,GSM1184887,GSM1184888,GSM1184889,GSM1184890,GSM1184891,GSM1184892,GSM1184893,GSM1184894,GSM1184895
2
+ Glucocorticoid_Sensitivity,90.2096916857165,90.2096916857165,92.0660852718675,92.0660852718675,85.8770390662799,85.8770390662799,87.4945143923344,87.4945143923344,85.1993812425936,85.1993812425936,84.9616236229156,84.9616236229156,83.9341340611542,83.9341340611542,88.7663927292959,88.7663927292959,88.4126127755346,88.4126127755346,90.1302355511097,90.1302355511097,86.3038207243861,86.3038207243861,97.9389927348314,97.9389927348314,85.6565800452145,85.6565800452145,72.080026977723,72.080026977723,95.7902581814721,95.7902581814721,84.7169700775247,84.7169700775247,97.2440363125325,97.2440363125325,98.6965291984436,98.6965291984436,96.3897437049292,96.3897437049292,93.7864779279733,93.7864779279733,88.9409584548941,88.9409584548941,95.2180128029044,95.2180128029044,80.3262384967705,80.3262384967705,98.9664822965928,98.9664822965928,86.7141270837215,86.7141270837215,94.1342236284511,94.1342236284511,76.5646360533747,76.5646360533747,94.4880035822124,94.4880035822124,84.2040871593034,84.2040871593034,81.2524330708547,81.2524330708547,75.0377332194718,75.0377332194718,103.111196853422,103.111196853422,93.7264007046898,93.7264007046898,98.4358920138007,98.4358920138007,91.1219245341963,91.1219245341963,89.7952307882158,89.7952307882158,100.164196369324,100.164196369324,92.2726878044167,92.2726878044167,83.653786832453,83.653786832453,85.4308536742686,85.4308536742686,95.9867474842918,95.9867474842918,97.4697626834784,97.4697626834784,87.1103581762748,87.1103581762748,106.335980304372,106.335980304372,95.0323274416373,95.0323274416373,93.2741255092367,93.2741255092367,88.0517452462257,88.0517452462257,92.7703808066373,92.7703808066373,90.2966860598886,90.2966860598886,90.2966860598886,87.6826035548426,87.6826035548426,87.6826035548426,110.820589380024,110.820589380024,110.820589380024,91.2861567746556,91.2861567746556,90.9575303422268,90.9575303422268,99.844023580098,99.844023580098,92.4380615886291,92.4380615886291,90.6279285533303,90.6279285533303,90.6279285533303,95.4061019654126,95.4061019654126,95.4061019654126,102.574377860977,102.574377860977,102.574377860977,83.3617762565561,83.3617762565561,92.9375020882722,92.9375020882722,83.056592777649,83.056592777649,101.239617979237,101.239617979237,86.5108726528178,86.5108726528178,87.8682889161097,87.8682889161097,89.9631142694748,89.9631142694748,95.5967828443558,95.5967828443558,94.3102962675651,94.3102962675651,97.0235772914671,97.0235772914671,94.6674807225407,94.6674807225407,86.0926581231368,86.0926581231368,107.862883138275,107.862883138275,82.7364199884225,82.7364199884225,88.2331356352063,88.2331356352063,93.614568433444,93.614568433444,103.717527073529,103.717527073529,103.717527073529,91.4503081788735,91.4503081788735,91.4503081788735,89.4567969526773,89.4567969526773,89.4567969526773,91.9430860155202,91.9430860155202,92.1077238348243,92.1077238348243,100.50157318001,100.50157318001,77.6379974012028,77.6379974012028,99.246829525294,99.246829525294,93.4438194050697,93.4438194050697,80.8101665274758,80.8101665274758,93.1053855695312,93.1053855695312
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE50012.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM832137,GSM832138,GSM832139,GSM832140,GSM832141,GSM832142,GSM832143,GSM832144,GSM832145,GSM832146,GSM832147,GSM832148,GSM832149,GSM832150,GSM832151,GSM832152,GSM832153,GSM832154,GSM832155,GSM832156,GSM832157,GSM832158,GSM832159,GSM832160,GSM832161,GSM832162,GSM832163,GSM832164,GSM832165,GSM832166,GSM832167,GSM832168,GSM832169,GSM832170,GSM832171,GSM832172,GSM832173,GSM832174,GSM832175,GSM832176,GSM832177,GSM832178,GSM832179,GSM832180,GSM832181,GSM832182,GSM832183,GSM832184,GSM1212354,GSM1212355,GSM1212356,GSM1212357,GSM1212358,GSM1212359,GSM1212360,GSM1212361,GSM1212362,GSM1212363,GSM1212364,GSM1212365,GSM1212366,GSM1212367,GSM1212368,GSM1212369,GSM1212370,GSM1212371,GSM1212372,GSM1212373,GSM1212374,GSM1212375,GSM1212376,GSM1212377
2
+ Glucocorticoid_Sensitivity,89.43486,89.43486,89.43486,89.43486,95.88507,95.88507,95.88507,95.88507,95.22036,95.22036,95.22036,95.22036,92.86704,92.86704,92.86704,92.86704,93.71633,93.71633,93.71633,93.71633,96.76962,96.76962,96.76962,96.76962,88.55031,88.55031,88.55031,88.55031,90.09957,90.09957,90.09957,90.09957,94.17097,94.17097,94.17097,94.17097,86.97089,86.97089,86.97089,86.97089,98.34904,98.34904,98.34904,98.34904,91.14896,91.14896,91.14896,91.14896,8.0,24.0,8.0,24.0,8.0,24.0,8.0,24.0,8.0,24.0,8.0,24.0,24.0,8.0,24.0,8.0,24.0,8.0,24.0,8.0,24.0,8.0,24.0,8.0
3
+ Age,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,44.15,44.15,24.72,24.72,32.38,32.38,20.38,20.38,21.24,21.24,22.54,22.54,26.14,26.14,21.56,21.56,21.99,21.99,26.77,26.77,23.59,23.59,23.48,23.48
4
+ Gender,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE57795.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1388640,GSM1388641,GSM1388642,GSM1388643,GSM1388644,GSM1388645,GSM1388646,GSM1388647,GSM1388648,GSM1388649,GSM1388650,GSM1388651,GSM1388652,GSM1388653,GSM1388654,GSM1388655,GSM1388656,GSM1388657,GSM1388658,GSM1388659,GSM1388660,GSM1388661,GSM1388662,GSM1388663,GSM1388664,GSM1388665,GSM1388666,GSM1388667,GSM1388668,GSM1388669,GSM1388670,GSM1388671,GSM1388672,GSM1388673,GSM1388674,GSM1388675,GSM1388676,GSM1388677,GSM1388678,GSM1388679,GSM1388680,GSM1388681,GSM1388682,GSM1388683,GSM1388684,GSM1388685,GSM1388686,GSM1388687,GSM1388688,GSM1388689,GSM1388690,GSM1388691,GSM1388692,GSM1388693,GSM1388694,GSM1388695,GSM1388696,GSM1388697
2
+ Glucocorticoid_Sensitivity,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE58715.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1417252,GSM1417253,GSM1417254,GSM1417255,GSM1417256,GSM1417257,GSM1417258,GSM1417259,GSM1417260,GSM1417261,GSM1417262,GSM1417263,GSM1417264,GSM1417265,GSM1417266,GSM1417267,GSM1417268,GSM1417269,GSM1417270,GSM1417271,GSM1417272,GSM1417273,GSM1417274,GSM1417275,GSM1417276,GSM1417277,GSM1417278,GSM1417279,GSM1417280,GSM1417281,GSM1417282,GSM1417283,GSM1417284,GSM1417285,GSM1417286,GSM1417287,GSM1417288,GSM1417289,GSM1417290,GSM1417291
2
+ Glucocorticoid_Sensitivity,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE65645.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1602365,GSM1602366,GSM1602367,GSM1602368,GSM1602369,GSM1602370,GSM1602371,GSM1602372,GSM1602373,GSM1602374,GSM1602375,GSM1602376,GSM1602377,GSM1602378,GSM1602379,GSM1602380,GSM1602381,GSM1602382,GSM1602383,GSM1602384,GSM1602385,GSM1602386,GSM1602387,GSM1602388,GSM1602389,GSM1602390,GSM1602391,GSM1602392,GSM1602393,GSM1602394,GSM1602395,GSM1602396,GSM1602397,GSM1602398,GSM1602399,GSM1602400,GSM1602401,GSM1602402,GSM1602403,GSM1602404,GSM1602405,GSM1602406,GSM1602407,GSM1602408
2
+ Glucocorticoid_Sensitivity,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/GSE66705.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1629982,GSM1629983,GSM1629984,GSM1629985,GSM1629986,GSM1629987,GSM1629988,GSM1629989,GSM1629990,GSM1629991,GSM1629992,GSM1629993,GSM1629994,GSM1629995,GSM1629996,GSM1629997,GSM1629998,GSM1629999,GSM1630000,GSM1630001,GSM1630002,GSM1630003,GSM1630004,GSM1630005,GSM1630006,GSM1630007,GSM1630008,GSM1630009,GSM1630010,GSM1630011,GSM1630012,GSM1630013,GSM1630014,GSM1630015,GSM1630016,GSM1630017,GSM1630018,GSM1630019,GSM1630020,GSM1630021,GSM1630022,GSM1630023,GSM1630024,GSM1630025,GSM1630026,GSM1630027,GSM1630028,GSM1630029,GSM1630030,GSM1630031,GSM1630032,GSM1630033,GSM1630034,GSM1630035,GSM1630036,GSM1630037,GSM1630038,GSM1630039,GSM1630040,GSM1630041,GSM1630042,GSM1630043,GSM1630044,GSM1630045,GSM1630046,GSM1630047,GSM1630048,GSM1630049,GSM1630050,GSM1630051,GSM1630052,GSM1630053,GSM1630054,GSM1630055,GSM1630056,GSM1630057,GSM1630058,GSM1630059,GSM1630060,GSM1630061,GSM1630062,GSM1630063,GSM1630064,GSM1630065,GSM1630066,GSM1630067,GSM1630068,GSM1630069,GSM1630070,GSM1630071,GSM1630072,GSM1630073,GSM1630074,GSM1630075,GSM1630076,GSM1630077,GSM1630078,GSM1630079,GSM1630080,GSM1630081,GSM1630082,GSM1630083,GSM1630084,GSM1630085,GSM1630086,GSM1630087,GSM1630088,GSM1630089,GSM1630090,GSM1630091,GSM1630092,GSM1630093,GSM1630094,GSM1630095,GSM1630096,GSM1630097,GSM1630098,GSM1630099,GSM1630100,GSM1630101,GSM1630102,GSM1630103,GSM1630104,GSM1630105,GSM1630106,GSM1630107,GSM1630108,GSM1630109,GSM1630110,GSM1630111,GSM1630112,GSM1630113,GSM1630114,GSM1630115,GSM1630116,GSM1630117,GSM1630118,GSM1630119,GSM1630120,GSM1630121,GSM1630122,GSM1630123,GSM1630124,GSM1630125,GSM1630126,GSM1630127,GSM1630128,GSM1630129,GSM1630130,GSM1630131,GSM1630132,GSM1630133,GSM1630135,GSM1630137,GSM1630139,GSM1630142,GSM1630144,GSM1630146,GSM1630149,GSM1630151,GSM1630154,GSM1630156,GSM1630158,GSM1630160,GSM1630162,GSM1630163,GSM1630164,GSM1630165,GSM1630166,GSM1630167,GSM1630168
2
+ Glucocorticoid_Sensitivity,,,,,0.0,,0.0,0.0,,,,,,1.0,,0.0,,,0.0,1.0,0.0,,,,,,,,1.0,1.0,,,0.0,,1.0,,,0.0,,1.0,,,0.0,1.0,0.0,1.0,,1.0,1.0,,,0.0,,,,,1.0,0.0,,,,,,0.0,,1.0,0.0,1.0,,,,0.0,0.0,0.0,,,1.0,,0.0,,1.0,1.0,0.0,,0.0,,1.0,1.0,1.0,0.0,,1.0,0.0,,,1.0,,,,0.0,,1.0,,0.0,0.0,,,,,1.0,,,1.0,1.0,0.0,0.0,0.0,0.0,,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,,1.0,1.0,0.0,0.0,1.0,1.0,1.0,,1.0,1.0,0.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0
p3/preprocess/Glucocorticoid_Sensitivity/clinical_data/TCGA.csv ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sampleID,Glucocorticoid_Sensitivity,Age,Gender
2
+ TCGA-OR-A5J1-01,1,58,1
3
+ TCGA-OR-A5J2-01,1,44,0
4
+ TCGA-OR-A5J3-01,1,23,0
5
+ TCGA-OR-A5J4-01,1,23,0
6
+ TCGA-OR-A5J5-01,1,30,1
7
+ TCGA-OR-A5J6-01,1,29,0
8
+ TCGA-OR-A5J7-01,1,30,0
9
+ TCGA-OR-A5J8-01,1,66,1
10
+ TCGA-OR-A5J9-01,1,22,0
11
+ TCGA-OR-A5JA-01,1,53,0
12
+ TCGA-OR-A5JB-01,1,52,1
13
+ TCGA-OR-A5JC-01,1,37,1
14
+ TCGA-OR-A5JD-01,1,57,0
15
+ TCGA-OR-A5JE-01,1,17,0
16
+ TCGA-OR-A5JF-01,1,69,0
17
+ TCGA-OR-A5JG-01,1,61,1
18
+ TCGA-OR-A5JH-01,1,32,0
19
+ TCGA-OR-A5JI-01,1,22,1
20
+ TCGA-OR-A5JJ-01,1,65,1
21
+ TCGA-OR-A5JK-01,1,49,1
22
+ TCGA-OR-A5JL-01,1,36,0
23
+ TCGA-OR-A5JM-01,1,25,0
24
+ TCGA-OR-A5JO-01,1,26,0
25
+ TCGA-OR-A5JP-01,1,40,1
26
+ TCGA-OR-A5JQ-01,1,26,0
27
+ TCGA-OR-A5JR-01,1,45,1
28
+ TCGA-OR-A5JS-01,1,65,0
29
+ TCGA-OR-A5JT-01,1,65,0
30
+ TCGA-OR-A5JU-01,1,58,0
31
+ TCGA-OR-A5JV-01,1,55,1
32
+ TCGA-OR-A5JW-01,1,47,1
33
+ TCGA-OR-A5JX-01,1,50,1
34
+ TCGA-OR-A5JY-01,1,68,0
35
+ TCGA-OR-A5JZ-01,1,60,1
36
+ TCGA-OR-A5K0-01,1,69,0
37
+ TCGA-OR-A5K1-01,1,48,1
38
+ TCGA-OR-A5K2-01,1,32,0
39
+ TCGA-OR-A5K3-01,1,53,1
40
+ TCGA-OR-A5K4-01,1,64,0
41
+ TCGA-OR-A5K5-01,1,59,0
42
+ TCGA-OR-A5K6-01,1,56,0
43
+ TCGA-OR-A5K8-01,1,39,1
44
+ TCGA-OR-A5K9-01,1,61,0
45
+ TCGA-OR-A5KB-01,1,61,0
46
+ TCGA-OR-A5KO-01,1,39,0
47
+ TCGA-OR-A5KP-01,1,45,0
48
+ TCGA-OR-A5KQ-01,1,20,0
49
+ TCGA-OR-A5KS-01,1,72,1
50
+ TCGA-OR-A5KT-01,1,44,0
51
+ TCGA-OR-A5KU-01,1,37,0
52
+ TCGA-OR-A5KV-01,1,17,0
53
+ TCGA-OR-A5KW-01,1,55,0
54
+ TCGA-OR-A5KX-01,1,25,0
55
+ TCGA-OR-A5KY-01,1,23,0
56
+ TCGA-OR-A5KZ-01,1,42,1
57
+ TCGA-OR-A5L1-01,1,37,0
58
+ TCGA-OR-A5L2-01,1,83,0
59
+ TCGA-OR-A5L3-01,1,67,0
60
+ TCGA-OR-A5L4-01,1,48,0
61
+ TCGA-OR-A5L5-01,1,77,0
62
+ TCGA-OR-A5L6-01,1,60,1
63
+ TCGA-OR-A5L8-01,1,36,0
64
+ TCGA-OR-A5L9-01,1,53,0
65
+ TCGA-OR-A5LA-01,1,52,0
66
+ TCGA-OR-A5LB-01,1,59,1
67
+ TCGA-OR-A5LC-01,1,71,0
68
+ TCGA-OR-A5LD-01,1,52,1
69
+ TCGA-OR-A5LE-01,1,14,1
70
+ TCGA-OR-A5LF-01,1,74,0
71
+ TCGA-OR-A5LG-01,1,46,1
72
+ TCGA-OR-A5LH-01,1,36,0
73
+ TCGA-OR-A5LI-01,1,42,0
74
+ TCGA-OR-A5LJ-01,1,54,0
75
+ TCGA-OR-A5LK-01,1,62,1
76
+ TCGA-OR-A5LL-01,1,75,0
77
+ TCGA-OR-A5LM-01,1,23,1
78
+ TCGA-OR-A5LN-01,1,31,0
79
+ TCGA-OR-A5LO-01,1,61,0
80
+ TCGA-OR-A5LP-01,1,37,0
81
+ TCGA-OR-A5LR-01,1,30,0
82
+ TCGA-OR-A5LS-01,1,34,0
83
+ TCGA-OR-A5LT-01,1,57,1
84
+ TCGA-OU-A5PI-01,1,53,0
85
+ TCGA-P6-A5OF-01,1,55,0
86
+ TCGA-P6-A5OG-01,1,45,0
87
+ TCGA-P6-A5OH-01,1,59,0
88
+ TCGA-PA-A5YG-01,1,51,1
89
+ TCGA-PK-A5H8-01,1,42,1
90
+ TCGA-PK-A5H9-01,1,27,0
91
+ TCGA-PK-A5HA-01,1,63,1
92
+ TCGA-PK-A5HB-01,1,63,1
93
+ TCGA-PK-A5HC-01,1,44,0