Liu-Hy commited on
Commit
8c96bfd
·
verified ·
1 Parent(s): 63a1f72

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 +25 -0
  2. p1/preprocess/Melanoma/gene_data/TCGA.csv +3 -0
  3. p1/preprocess/Osteoarthritis/gene_data/GSE236924.csv +3 -0
  4. p1/preprocess/Osteoporosis/gene_data/GSE20881.csv +3 -0
  5. p1/preprocess/Osteoporosis/gene_data/GSE56814.csv +3 -0
  6. p1/preprocess/Ovarian_Cancer/gene_data/GSE103737.csv +3 -0
  7. p1/preprocess/Ovarian_Cancer/gene_data/GSE126308.csv +3 -0
  8. p1/preprocess/Ovarian_Cancer/gene_data/GSE130402.csv +0 -0
  9. p1/preprocess/Ovarian_Cancer/gene_data/GSE132342.csv +3 -0
  10. p1/preprocess/Ovarian_Cancer/gene_data/GSE135820.csv +3 -0
  11. p1/preprocess/Ovarian_Cancer/gene_data/GSE146553.csv +3 -0
  12. p1/preprocess/Ovarian_Cancer/gene_data/GSE146964.csv +3 -0
  13. p1/preprocess/Pancreatic_Cancer/GSE131027.csv +3 -0
  14. p1/preprocess/Pancreatic_Cancer/code/GSE157494.py +139 -0
  15. p1/preprocess/Pancreatic_Cancer/code/GSE183795.py +166 -0
  16. p1/preprocess/Pancreatic_Cancer/code/GSE222788.py +145 -0
  17. p1/preprocess/Pancreatic_Cancer/code/GSE223409.py +199 -0
  18. p1/preprocess/Pancreatic_Cancer/code/TCGA.py +118 -0
  19. p1/preprocess/Pancreatic_Cancer/gene_data/GSE120127.csv +660 -0
  20. p1/preprocess/Pancreatic_Cancer/gene_data/GSE125158.csv +0 -0
  21. p1/preprocess/Pancreatic_Cancer/gene_data/GSE130563.csv +1 -0
  22. p1/preprocess/Pancreatic_Cancer/gene_data/GSE131027.csv +3 -0
  23. p1/preprocess/Pancreatic_Cancer/gene_data/GSE157494.csv +0 -0
  24. p1/preprocess/Pancreatic_Cancer/gene_data/GSE222788.csv +1 -0
  25. p1/preprocess/Pancreatic_Cancer/gene_data/GSE223409.csv +33 -0
  26. p1/preprocess/Pancreatic_Cancer/gene_data/GSE236951.csv +0 -0
  27. p1/preprocess/Parkinsons_Disease/GSE103099.csv +3 -0
  28. p1/preprocess/Parkinsons_Disease/GSE202665.csv +3 -0
  29. p1/preprocess/Parkinsons_Disease/GSE202667.csv +3 -0
  30. p1/preprocess/Parkinsons_Disease/GSE49126.csv +0 -0
  31. p1/preprocess/Parkinsons_Disease/GSE57475.csv +3 -0
  32. p1/preprocess/Parkinsons_Disease/GSE72267.csv +0 -0
  33. p1/preprocess/Parkinsons_Disease/clinical_data/GSE101534.csv +2 -0
  34. p1/preprocess/Parkinsons_Disease/clinical_data/GSE103099.csv +2 -0
  35. p1/preprocess/Parkinsons_Disease/clinical_data/GSE202665.csv +3 -0
  36. p1/preprocess/Parkinsons_Disease/clinical_data/GSE202667.csv +3 -0
  37. p1/preprocess/Parkinsons_Disease/clinical_data/GSE49126.csv +2 -0
  38. p1/preprocess/Parkinsons_Disease/clinical_data/GSE57475.csv +4 -0
  39. p1/preprocess/Parkinsons_Disease/clinical_data/GSE72267.csv +2 -0
  40. p1/preprocess/Parkinsons_Disease/code/GSE101534.py +264 -0
  41. p1/preprocess/Parkinsons_Disease/code/GSE103099.py +234 -0
  42. p1/preprocess/Parkinsons_Disease/code/GSE202665.py +253 -0
  43. p1/preprocess/Parkinsons_Disease/code/GSE202667.py +227 -0
  44. p1/preprocess/Parkinsons_Disease/code/GSE30335.py +71 -0
  45. p1/preprocess/Parkinsons_Disease/code/GSE49126.py +220 -0
  46. p1/preprocess/Parkinsons_Disease/code/GSE57475.py +244 -0
  47. p1/preprocess/Parkinsons_Disease/code/GSE71220.py +237 -0
  48. p1/preprocess/Parkinsons_Disease/code/GSE72267.py +239 -0
  49. p1/preprocess/Parkinsons_Disease/code/GSE80599.py +208 -0
  50. p1/preprocess/Parkinsons_Disease/code/TCGA.py +73 -0
.gitattributes CHANGED
@@ -1313,3 +1313,28 @@ p1/preprocess/Lower_Grade_Glioma/gene_data/TCGA.csv filter=lfs diff=lfs merge=lf
1313
  p1/preprocess/Osteoarthritis/GSE236924.csv filter=lfs diff=lfs merge=lfs -text
1314
  p1/preprocess/Osteoporosis/GSE20881.csv filter=lfs diff=lfs merge=lfs -text
1315
  p1/preprocess/Ovarian_Cancer/GSE146553.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1313
  p1/preprocess/Osteoarthritis/GSE236924.csv filter=lfs diff=lfs merge=lfs -text
1314
  p1/preprocess/Osteoporosis/GSE20881.csv filter=lfs diff=lfs merge=lfs -text
1315
  p1/preprocess/Ovarian_Cancer/GSE146553.csv filter=lfs diff=lfs merge=lfs -text
1316
+ p1/preprocess/Osteoporosis/gene_data/GSE56814.csv filter=lfs diff=lfs merge=lfs -text
1317
+ p1/preprocess/Osteoporosis/gene_data/GSE20881.csv filter=lfs diff=lfs merge=lfs -text
1318
+ p1/preprocess/Osteoarthritis/gene_data/GSE236924.csv filter=lfs diff=lfs merge=lfs -text
1319
+ p1/preprocess/Ovarian_Cancer/gene_data/GSE103737.csv filter=lfs diff=lfs merge=lfs -text
1320
+ p1/preprocess/Ovarian_Cancer/gene_data/GSE126308.csv filter=lfs diff=lfs merge=lfs -text
1321
+ p1/preprocess/Melanoma/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1322
+ p1/preprocess/Ovarian_Cancer/gene_data/GSE146964.csv filter=lfs diff=lfs merge=lfs -text
1323
+ p1/preprocess/Ovarian_Cancer/gene_data/GSE146553.csv filter=lfs diff=lfs merge=lfs -text
1324
+ p1/preprocess/Ovarian_Cancer/gene_data/GSE132342.csv filter=lfs diff=lfs merge=lfs -text
1325
+ p1/preprocess/Pancreatic_Cancer/GSE131027.csv filter=lfs diff=lfs merge=lfs -text
1326
+ p1/preprocess/Parkinsons_Disease/GSE103099.csv filter=lfs diff=lfs merge=lfs -text
1327
+ p1/preprocess/Ovarian_Cancer/gene_data/GSE135820.csv filter=lfs diff=lfs merge=lfs -text
1328
+ p1/preprocess/Parkinsons_Disease/GSE202665.csv filter=lfs diff=lfs merge=lfs -text
1329
+ p1/preprocess/Pancreatic_Cancer/gene_data/GSE131027.csv filter=lfs diff=lfs merge=lfs -text
1330
+ p1/preprocess/Parkinsons_Disease/GSE202667.csv filter=lfs diff=lfs merge=lfs -text
1331
+ p1/preprocess/Parkinsons_Disease/GSE57475.csv filter=lfs diff=lfs merge=lfs -text
1332
+ p1/preprocess/Parkinsons_Disease/gene_data/GSE103099.csv filter=lfs diff=lfs merge=lfs -text
1333
+ p3/preprocess/Stomach_Cancer/GSE98708.csv filter=lfs diff=lfs merge=lfs -text
1334
+ p1/preprocess/Parkinsons_Disease/gene_data/GSE202667.csv filter=lfs diff=lfs merge=lfs -text
1335
+ p3/preprocess/Stomach_Cancer/GSE161533.csv filter=lfs diff=lfs merge=lfs -text
1336
+ p1/preprocess/Parkinsons_Disease/gene_data/GSE202665.csv filter=lfs diff=lfs merge=lfs -text
1337
+ p1/preprocess/Parkinsons_Disease/gene_data/GSE57475.csv filter=lfs diff=lfs merge=lfs -text
1338
+ p3/preprocess/Stomach_Cancer/GSE183136.csv filter=lfs diff=lfs merge=lfs -text
1339
+ p3/preprocess/Stomach_Cancer/gene_data/GSE147163.csv filter=lfs diff=lfs merge=lfs -text
1340
+ p3/preprocess/Stomach_Cancer/gene_data/GSE128459.csv filter=lfs diff=lfs merge=lfs -text
p1/preprocess/Melanoma/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22620244dbfd59244c237c2dfb9c119762e3e449f2bed3331e712d3667d1c829
3
+ size 142299049
p1/preprocess/Osteoarthritis/gene_data/GSE236924.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0889c2bc648b2b6bc1acfce5a519a7c835ddb2679c77ba3da20898108bfd49e
3
+ size 35074636
p1/preprocess/Osteoporosis/gene_data/GSE20881.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f67547930b83b768f3e08c11d0c0140e8d904ee5e01ba141c0749fb5d1a8ff08
3
+ size 25998146
p1/preprocess/Osteoporosis/gene_data/GSE56814.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43687c980c6db81762f1cf03f5268d4989596a03919647bde0e49b4aaee05951
3
+ size 19578664
p1/preprocess/Ovarian_Cancer/gene_data/GSE103737.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e6e538048f5fd1d03e8ad03e39ed51c4ca55b79a3eeb73c3bf86b1617f9a8c2
3
+ size 17809179
p1/preprocess/Ovarian_Cancer/gene_data/GSE126308.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cf6cfef225dac77ee4d3d43dc15938ff56ec7e5522768f8e21984cc855d7a4f
3
+ size 14296333
p1/preprocess/Ovarian_Cancer/gene_data/GSE130402.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Ovarian_Cancer/gene_data/GSE132342.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9881ac8cd6c2102f744a668716127ba6ca01021f0018b9b3e842997ad15e568
3
+ size 24699591
p1/preprocess/Ovarian_Cancer/gene_data/GSE135820.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5591a4769d8635984111410b811452ce976f2130b559c8462d9ec80d91c65704
3
+ size 26717571
p1/preprocess/Ovarian_Cancer/gene_data/GSE146553.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30b7cbbb8d3a31017943800fa0f6d17577cdbd210a45f7aa6e7bca131d04fde5
3
+ size 16011855
p1/preprocess/Ovarian_Cancer/gene_data/GSE146964.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eea9a89b3ff8cf5671211324e388b7580ee1e1895191b5b5d6564a0548d72e7f
3
+ size 15053927
p1/preprocess/Pancreatic_Cancer/GSE131027.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d5ab692ea51f69d8385adb7393e47bb330a8196ba31924f2cfa336a641a16f1
3
+ size 24380321
p1/preprocess/Pancreatic_Cancer/code/GSE157494.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Pancreatic_Cancer"
6
+ cohort = "GSE157494"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Pancreatic_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Pancreatic_Cancer/GSE157494"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Pancreatic_Cancer/GSE157494.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Pancreatic_Cancer/gene_data/GSE157494.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Pancreatic_Cancer/clinical_data/GSE157494.csv"
16
+ json_path = "./output/preprocess/1/Pancreatic_Cancer/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Identify the paths to the SOFT file and the matrix file
22
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
23
+
24
+ # 2. Read the matrix file to obtain background information and sample characteristics data
25
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
26
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
27
+ background_info, clinical_data = get_background_and_clinical_data(
28
+ matrix_file,
29
+ background_prefixes,
30
+ clinical_prefixes
31
+ )
32
+
33
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
34
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
35
+
36
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
37
+ print("Background Information:")
38
+ print(background_info)
39
+ print("Sample Characteristics Dictionary:")
40
+ print(sample_characteristics_dict)
41
+ # 1) Check gene expression data availability
42
+ # Based on the series summary, it appears gene expression profiling was performed on this dataset.
43
+ is_gene_available = True
44
+
45
+ # 2) Variable Availability and Data Type Conversion
46
+
47
+ # After reviewing the sample characteristics dictionary:
48
+ # {0: ['sample type: xenografted tumor', 'sample type: Cell line']}
49
+ # we see no key indicating the "Pancreatic_Cancer" trait variation, age, or gender.
50
+ # Hence, all are considered not available because the entire dataset is already from pancreatic cancer
51
+ # (no variation), and no age/gender info is provided.
52
+
53
+ trait_row = None
54
+ age_row = None
55
+ gender_row = None
56
+
57
+ # Define conversion functions as placeholders
58
+ def convert_trait(value: str):
59
+ return None
60
+
61
+ def convert_age(value: str):
62
+ return None
63
+
64
+ def convert_gender(value: str):
65
+ return None
66
+
67
+ # 3) Perform initial filtering and save metadata
68
+ is_trait_available = (trait_row is not None)
69
+ is_usable = validate_and_save_cohort_info(
70
+ 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
+
77
+ # 4) Since trait_row is None, clinical data extraction step is skipped.
78
+ # STEP3
79
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
80
+ gene_data = get_genetic_data(matrix_file)
81
+
82
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
83
+ print(gene_data.index[:20])
84
+ print("requires_gene_mapping = True")
85
+ # STEP5
86
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
87
+ gene_annotation = get_gene_annotation(soft_file)
88
+
89
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
90
+ print("Gene annotation preview:")
91
+ print(preview_df(gene_annotation))
92
+ # STEP: Gene Identifier Mapping
93
+
94
+ # 1. From the annotation preview, the 'ID' column matches the probe IDs in the expression data,
95
+ # and the 'Gene Symbol' column contains the corresponding gene symbols.
96
+ probe_col = 'ID'
97
+ symbol_col = 'Gene Symbol'
98
+
99
+ # 2. Get a gene mapping dataframe by extracting the two columns from the annotation dataframe
100
+ mapping_df = get_gene_mapping(gene_annotation, prob_col=probe_col, gene_col=symbol_col)
101
+
102
+ # 3. Convert probe-level measurements to gene-level expression data
103
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
104
+
105
+ # (Optional) Print some basic info about the resulting gene_data
106
+ print("New gene_data shape:", gene_data.shape)
107
+ print("First 20 mapped gene symbols:", gene_data.index[:20].tolist())
108
+ # STEP 7
109
+ # In this dataset, the trait information is not available (trait_row is None). Therefore, we skip clinical linking
110
+ # and final data assembly. We only normalize and save the gene expression data, then mark the dataset as not usable
111
+ # for trait-based analyses.
112
+
113
+ # 1) Normalize gene symbols in the gene expression data
114
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
115
+ normalized_gene_data.to_csv(out_gene_data_file)
116
+
117
+ # 2) Since trait data is not available, we do not link clinical data or do missing-value handling on trait/covariates.
118
+ # Proceed to final validation to record dataset metadata.
119
+
120
+ # Use an empty dataframe for final validation to meet the function's parameter requirements.
121
+ empty_df = pd.DataFrame()
122
+
123
+ # 3) Conduct final validation and save cohort info
124
+ # This dataset has gene data, but no trait data => it is not usable for trait-based analysis.
125
+ is_usable = validate_and_save_cohort_info(
126
+ is_final=True,
127
+ cohort=cohort,
128
+ info_path=json_path,
129
+ is_gene_available=True,
130
+ is_trait_available=False,
131
+ is_biased=False, # not actually tested since trait is absent
132
+ df=empty_df,
133
+ note="Trait data not available. Only gene data is provided. This dataset is not usable for trait-based analysis."
134
+ )
135
+
136
+ # 4) If the dataset were usable, we would save the final linked data. Here it will not be usable because the trait is missing.
137
+ if is_usable:
138
+ # No final data to save, since no trait is available
139
+ pass
p1/preprocess/Pancreatic_Cancer/code/GSE183795.py ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Pancreatic_Cancer"
6
+ cohort = "GSE183795"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Pancreatic_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Pancreatic_Cancer/GSE183795"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Pancreatic_Cancer/GSE183795.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Pancreatic_Cancer/gene_data/GSE183795.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Pancreatic_Cancer/clinical_data/GSE183795.csv"
16
+ json_path = "./output/preprocess/1/Pancreatic_Cancer/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Identify the paths to the SOFT file and the matrix file
22
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
23
+
24
+ # 2. Read the matrix file to obtain background information and sample characteristics data
25
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
26
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
27
+ background_info, clinical_data = get_background_and_clinical_data(
28
+ matrix_file,
29
+ background_prefixes,
30
+ clinical_prefixes
31
+ )
32
+
33
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
34
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
35
+
36
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
37
+ print("Background Information:")
38
+ print(background_info)
39
+ print("Sample Characteristics Dictionary:")
40
+ print(sample_characteristics_dict)
41
+ # 1) Gene Expression Data Availability
42
+ is_gene_available = True # From the background info, it is a microarray gene-expression dataset.
43
+
44
+ # 2) Variable Availability and Data Type Conversion
45
+ # Based on the sample characteristics, row 0 indicates whether a sample is tumor or not.
46
+ trait_row = 0
47
+ age_row = None # No age information found
48
+ gender_row = None # No gender information found
49
+
50
+ # Data type for trait is binary: tumor (1) vs. normal/adjacent tissue (0).
51
+ def convert_trait(value: str):
52
+ # Typically "tissue: tumor", "tissue: adjacent non-tumor", "tissue: Normal pancreas"
53
+ # We take the substring after the colon, then map.
54
+ parts = value.split(':')
55
+ if len(parts) < 2:
56
+ return None
57
+ val = parts[1].strip().lower()
58
+ if 'tumor' in val and 'non' not in val: # covers "tumor" but not "non-tumor"
59
+ return 1
60
+ elif 'tumor' in val or 'normal' in val:
61
+ return 0
62
+ return None
63
+
64
+ # Age and gender are not available, but we must define the functions for completeness
65
+ def convert_age(value: str):
66
+ return None
67
+
68
+ def convert_gender(value: str):
69
+ return None
70
+
71
+ # 3) Save Metadata (Initial filtering)
72
+ is_trait_available = (trait_row is not None)
73
+ is_usable = validate_and_save_cohort_info(
74
+ is_final=False,
75
+ cohort=cohort,
76
+ info_path=json_path,
77
+ is_gene_available=is_gene_available,
78
+ is_trait_available=is_trait_available
79
+ )
80
+
81
+ # 4) Clinical Feature Extraction (only if trait data is available)
82
+ if trait_row is not None:
83
+ clinical_features_df = geo_select_clinical_features(
84
+ clinical_data,
85
+ trait=trait,
86
+ trait_row=trait_row,
87
+ convert_trait=convert_trait,
88
+ age_row=age_row,
89
+ convert_age=convert_age,
90
+ gender_row=gender_row,
91
+ convert_gender=convert_gender
92
+ )
93
+
94
+ # Preview the extracted clinical features
95
+ preview = preview_df(clinical_features_df)
96
+ print("Preview of selected clinical features:", preview)
97
+
98
+ # Save the clinical features to CSV
99
+ clinical_features_df.to_csv(out_clinical_data_file, index=False)
100
+ # STEP3
101
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
102
+ gene_data = get_genetic_data(matrix_file)
103
+
104
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
105
+ print(gene_data.index[:20])
106
+ # The given identifiers (numeric strings like '7896748') are not standard human gene symbols.
107
+ # Therefore, they require mapping to known human gene symbols.
108
+ print("requires_gene_mapping = True")
109
+ # STEP5
110
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
111
+ gene_annotation = get_gene_annotation(soft_file)
112
+
113
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
114
+ print("Gene annotation preview:")
115
+ print(preview_df(gene_annotation))
116
+ # STEP: Gene Identifier Mapping
117
+
118
+ # 1) Identify the columns that store the probe ID and the gene symbol
119
+ # - The probe ID is in 'ID' and the gene symbol information is in 'gene_assignment'.
120
+ probe_col = 'ID'
121
+ symbol_col = 'gene_assignment'
122
+
123
+ # 2) Build the mapping dataframe
124
+ mapping_df = get_gene_mapping(gene_annotation, prob_col=probe_col, gene_col=symbol_col)
125
+
126
+ # 3) Convert probe-level data to gene-level data
127
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
128
+
129
+ # For quick inspection, let's print out the shape and a small preview of the mapped gene data
130
+ print("Mapped gene expression data shape:", gene_data.shape)
131
+ print(gene_data.head())
132
+ # STEP 7
133
+ import pandas as pd
134
+
135
+ # 1) Load the clinical dataframe from the CSV saved in Step 2, ensuring the single row "Pancreatic_Cancer" becomes our index
136
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
137
+ selected_clinical_df.index = [trait] # Make "Pancreatic_Cancer" the row index
138
+
139
+ # 2) Normalize gene symbols and save
140
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
141
+ normalized_gene_data.to_csv(out_gene_data_file)
142
+
143
+ # 3) Link the clinical and genetic data on sample IDs
144
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
145
+
146
+ # 4) Handle missing values in the linked data
147
+ linked_data = handle_missing_values(linked_data, trait)
148
+
149
+ # 5) Determine whether the trait and demographic features are biased
150
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
151
+
152
+ # 6) Conduct final validation and save cohort info
153
+ is_usable = validate_and_save_cohort_info(
154
+ is_final=True,
155
+ cohort=cohort,
156
+ info_path=json_path,
157
+ is_gene_available=True,
158
+ is_trait_available=True,
159
+ is_biased=trait_biased,
160
+ df=linked_data,
161
+ note="Trait is available. Completed linking and QC steps."
162
+ )
163
+
164
+ # 7) If the dataset is usable, save the final linked data
165
+ if is_usable:
166
+ linked_data.to_csv(out_data_file)
p1/preprocess/Pancreatic_Cancer/code/GSE222788.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Pancreatic_Cancer"
6
+ cohort = "GSE222788"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Pancreatic_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Pancreatic_Cancer/GSE222788"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Pancreatic_Cancer/GSE222788.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Pancreatic_Cancer/gene_data/GSE222788.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Pancreatic_Cancer/clinical_data/GSE222788.csv"
16
+ json_path = "./output/preprocess/1/Pancreatic_Cancer/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Identify the paths to the SOFT file and the matrix file
22
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
23
+
24
+ # 2. Read the matrix file to obtain background information and sample characteristics data
25
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
26
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
27
+ background_info, clinical_data = get_background_and_clinical_data(
28
+ matrix_file,
29
+ background_prefixes,
30
+ clinical_prefixes
31
+ )
32
+
33
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
34
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
35
+
36
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
37
+ print("Background Information:")
38
+ print(background_info)
39
+ print("Sample Characteristics Dictionary:")
40
+ print(sample_characteristics_dict)
41
+ # 1. Decide whether this dataset contains gene expression data
42
+ is_gene_available = True # From the background, it uses a gene expression profiling panel
43
+
44
+ # 2. Determine variable availability
45
+ trait_row = None # No row indicating variation of "Pancreatic_Cancer"; the entire cohort has this trait
46
+ age_row = None # No age information found
47
+ gender_row = None # No gender information found
48
+
49
+ # 2.2 Define data type conversion functions
50
+ def convert_trait(value: str) -> int:
51
+ # No actual data is available; return None for all
52
+ return None
53
+
54
+ def convert_age(value: str) -> float:
55
+ # No age data is available; return None for all
56
+ return None
57
+
58
+ def convert_gender(value: str) -> int:
59
+ # No gender data is available; return None for all
60
+ return None
61
+
62
+ # 3. Save Metadata (initial filtering)
63
+ is_trait_available = (trait_row is not None)
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=is_trait_available
70
+ )
71
+
72
+ # 4. Clinical Feature Extraction (skip if trait data is not available)
73
+ if trait_row is not None:
74
+ selected_clinical_df = geo_select_clinical_features(
75
+ clinical_data,
76
+ trait=trait,
77
+ trait_row=trait_row,
78
+ convert_trait=convert_trait,
79
+ age_row=age_row,
80
+ convert_age=convert_age,
81
+ gender_row=gender_row,
82
+ convert_gender=convert_gender
83
+ )
84
+ print(preview_df(selected_clinical_df))
85
+ selected_clinical_df.to_csv(out_clinical_data_file)
86
+ # STEP3
87
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
88
+ gene_data = get_genetic_data(matrix_file)
89
+
90
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
91
+ print(gene_data.index[:20])
92
+ # Based on the identifiers (e.g., "A2M-mRNA", "ABCB1-mRNA"), they are recognized human gene symbols
93
+ # with an appended "-mRNA" suffix. No additional mapping is required beyond removing the suffix.
94
+ print("They are recognized human gene symbols with an added '-mRNA' suffix.\nrequires_gene_mapping = False")
95
+ import pandas as pd
96
+ import os
97
+
98
+ # STEP 5
99
+ # This code finalizes preprocessing by normalizing gene symbols, linking clinical data (if any),
100
+ # performing quality control, and saving the results if the dataset is usable for trait analysis.
101
+
102
+ # 1. Normalize gene symbols in the gene expression data and save
103
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
104
+ normalized_gene_data.to_csv(out_gene_data_file)
105
+
106
+ # 2. Check trait data availability by verifying whether the clinical CSV file exists
107
+ if not os.path.exists(out_clinical_data_file):
108
+ # No trait data => finalize with is_final=True but supply a dummy dataframe and a biased flag
109
+ # so that validate_and_save_cohort_info won't raise an error
110
+ validate_and_save_cohort_info(
111
+ is_final=True,
112
+ cohort=cohort,
113
+ info_path=json_path,
114
+ is_gene_available=True,
115
+ is_trait_available=False,
116
+ is_biased=True, # Marking it as biased to ensure is_usable=False
117
+ df=pd.DataFrame(), # Empty DataFrame
118
+ note="No trait data => dataset not suitable for trait association."
119
+ )
120
+ else:
121
+ # 3. If trait data is available, read it and link with the genetic data
122
+ selected_clinical_df = pd.read_csv(out_clinical_data_file, index_col=0)
123
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
124
+
125
+ # 4. Handle missing values
126
+ linked_data = handle_missing_values(linked_data, trait)
127
+
128
+ # 5. Check for any bias in trait or demographics
129
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
130
+
131
+ # 6. Final quality validation
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=trait_biased,
139
+ df=linked_data,
140
+ note="Trait is available. Completed linking and QC steps."
141
+ )
142
+
143
+ # 7. Save the final linked data if usable
144
+ if is_usable:
145
+ linked_data.to_csv(out_data_file)
p1/preprocess/Pancreatic_Cancer/code/GSE223409.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Pancreatic_Cancer"
6
+ cohort = "GSE223409"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Pancreatic_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Pancreatic_Cancer/GSE223409"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Pancreatic_Cancer/GSE223409.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Pancreatic_Cancer/gene_data/GSE223409.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Pancreatic_Cancer/clinical_data/GSE223409.csv"
16
+ json_path = "./output/preprocess/1/Pancreatic_Cancer/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Identify the paths to the SOFT file and the matrix file
22
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
23
+
24
+ # 2. Read the matrix file to obtain background information and sample characteristics data
25
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
26
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
27
+ background_info, clinical_data = get_background_and_clinical_data(
28
+ matrix_file,
29
+ background_prefixes,
30
+ clinical_prefixes
31
+ )
32
+
33
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
34
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
35
+
36
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
37
+ print("Background Information:")
38
+ print(background_info)
39
+ print("Sample Characteristics Dictionary:")
40
+ print(sample_characteristics_dict)
41
+ # 1) Decide if the dataset is likely to contain gene expression data
42
+ is_gene_available = True # Based on the references to oncogenic genes in the series
43
+
44
+ # 2) Determine availability for trait, age, and gender from the sample characteristics
45
+ # After inspecting the dictionary, none of these variables are explicitly provided or vary.
46
+
47
+ trait_row = None # No row indicates "Pancreatic_Cancer" (it's presumably the same for all)
48
+ age_row = None # No mention or variability for age
49
+ gender_row = None # No mention or variability for gender
50
+
51
+ # 2.2) Define data type conversion functions
52
+ def convert_trait(value: str) -> Optional[float]:
53
+ """
54
+ Convert trait data to a binary (0,1). Unknown values go to None.
55
+ Since trait_row is None, this function won't be used, but we define it for completeness.
56
+ """
57
+ if not value or pd.isna(value):
58
+ return None
59
+ # Typically, parse after ":", if any
60
+ parts = value.split(':', 1)
61
+ val_str = parts[-1].strip() if len(parts) > 1 else value.strip()
62
+ # If we had actual detection logic, we'd do it here. Returning None by default.
63
+ return None
64
+
65
+ def convert_age(value: str) -> Optional[float]:
66
+ """
67
+ Convert age to continuous. Unknown values go to None.
68
+ Since age_row is None, this function won't be used, but defined for completeness.
69
+ """
70
+ if not value or pd.isna(value):
71
+ return None
72
+ parts = value.split(':', 1)
73
+ val_str = parts[-1].strip() if len(parts) > 1 else value.strip()
74
+ # Try to parse to float
75
+ try:
76
+ return float(val_str)
77
+ except ValueError:
78
+ return None
79
+
80
+ def convert_gender(value: str) -> Optional[int]:
81
+ """
82
+ Convert gender to binary: female -> 0, male -> 1, unknown -> None.
83
+ Since gender_row is None, this function won't be used, but defined for completeness.
84
+ """
85
+ if not value or pd.isna(value):
86
+ return None
87
+ parts = value.split(':', 1)
88
+ val_str = parts[-1].strip().lower() if len(parts) > 1 else value.strip().lower()
89
+ if val_str.startswith('f'):
90
+ return 0
91
+ elif val_str.startswith('m'):
92
+ return 1
93
+ return None
94
+
95
+ # 3) Conduct initial filtering on dataset usability and save metadata
96
+ # Trait data availability is based on whether trait_row is None.
97
+ is_trait_available = (trait_row is not None)
98
+
99
+ passed_filtering = validate_and_save_cohort_info(
100
+ is_final=False,
101
+ cohort=cohort,
102
+ info_path=json_path,
103
+ is_gene_available=is_gene_available,
104
+ is_trait_available=is_trait_available
105
+ )
106
+
107
+ # 4) Only if trait_row is not None would we extract clinical features.
108
+ if trait_row is not None:
109
+ selected_clinical_df = geo_select_clinical_features(
110
+ clinical_df=clinical_data,
111
+ trait="Pancreatic_Cancer", # or simply trait
112
+ trait_row=trait_row,
113
+ convert_trait=convert_trait,
114
+ age_row=age_row,
115
+ convert_age=convert_age,
116
+ gender_row=gender_row,
117
+ convert_gender=convert_gender
118
+ )
119
+ # Preview and save
120
+ print("Selected clinical features preview:", preview_df(selected_clinical_df))
121
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
122
+ # STEP3
123
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
124
+ gene_data = get_genetic_data(matrix_file)
125
+
126
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
127
+ print(gene_data.index[:20])
128
+ print(
129
+ "The gene identifiers in the dataset are numeric and do not appear to be standard human gene symbols.\n"
130
+ "requires_gene_mapping = True"
131
+ )
132
+ # STEP5
133
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
134
+ gene_annotation = get_gene_annotation(soft_file)
135
+
136
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
137
+ print("Gene annotation preview:")
138
+ print(preview_df(gene_annotation))
139
+ # STEP: Gene Identifier Mapping
140
+
141
+ # 1) From inspection, 'ID' in gene_annotation aligns with the numeric row identifiers in gene_data,
142
+ # and 'GENE_SYMBOL' stores the gene symbols.
143
+ prob_col = 'ID'
144
+ gene_col = 'GENE_SYMBOL'
145
+
146
+ # 2) Get the gene mapping dataframe
147
+ gene_mapping_df = get_gene_mapping(gene_annotation, prob_col=prob_col, gene_col=gene_col)
148
+
149
+ # 3) Convert probe-level measurements to gene-level expression
150
+ gene_data = apply_gene_mapping(gene_data, gene_mapping_df)
151
+ import os
152
+ import pandas as pd
153
+
154
+ # STEP 7
155
+
156
+ # 1) Normalize gene symbols using the loaded gene_data from previous steps, then save the result.
157
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
158
+ normalized_gene_data.to_csv(out_gene_data_file)
159
+
160
+ # 2) Check if clinical data file exists. If missing, finalize by marking that trait data is not available
161
+ # but do NOT do a final validation because we don't have df/is_biased.
162
+ if not os.path.exists(out_clinical_data_file):
163
+ print("No clinical data file found. This dataset cannot be used for trait-based analysis.")
164
+ # Record metadata but with is_final=False, indicating it fails trait requirement
165
+ validate_and_save_cohort_info(
166
+ is_final=False,
167
+ cohort=cohort,
168
+ info_path=json_path,
169
+ is_gene_available=True,
170
+ is_trait_available=False
171
+ )
172
+ else:
173
+ # If clinical data is available, proceed with linking and QC steps
174
+ selected_clinical_df = pd.read_csv(out_clinical_data_file, index_col=0)
175
+
176
+ # 2) Link the clinical and genetic data on sample IDs
177
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
178
+
179
+ # 3) Handle missing values
180
+ linked_data = handle_missing_values(linked_data, trait)
181
+
182
+ # 4) Determine if the trait/demographics are biased
183
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
184
+
185
+ # 5) Conduct final validation and save cohort info
186
+ is_usable = validate_and_save_cohort_info(
187
+ is_final=True,
188
+ cohort=cohort,
189
+ info_path=json_path,
190
+ is_gene_available=True,
191
+ is_trait_available=True,
192
+ is_biased=trait_biased,
193
+ df=linked_data,
194
+ note="Trait is available. Completed linking and QC steps."
195
+ )
196
+
197
+ # 6) If the dataset is usable, save the final linked data
198
+ if is_usable:
199
+ linked_data.to_csv(out_data_file)
p1/preprocess/Pancreatic_Cancer/code/TCGA.py ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Pancreatic_Cancer"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/1/Pancreatic_Cancer/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/1/Pancreatic_Cancer/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/1/Pancreatic_Cancer/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/1/Pancreatic_Cancer/cohort_info.json"
15
+
16
+ import os
17
+ import pandas as pd
18
+
19
+ # 1. Identify the relevant subdirectory for "Pancreatic_Cancer" or "PAAD"
20
+ subdirectories = [
21
+ 'CrawlData.ipynb', '.DS_Store', 'TCGA_lower_grade_glioma_and_glioblastoma_(GBMLGG)',
22
+ 'TCGA_Uterine_Carcinosarcoma_(UCS)', 'TCGA_Thyroid_Cancer_(THCA)', 'TCGA_Thymoma_(THYM)',
23
+ 'TCGA_Testicular_Cancer_(TGCT)', 'TCGA_Stomach_Cancer_(STAD)', 'TCGA_Sarcoma_(SARC)',
24
+ 'TCGA_Rectal_Cancer_(READ)', 'TCGA_Prostate_Cancer_(PRAD)', 'TCGA_Pheochromocytoma_Paraganglioma_(PCPG)',
25
+ 'TCGA_Pancreatic_Cancer_(PAAD)', 'TCGA_Ovarian_Cancer_(OV)', 'TCGA_Ocular_melanomas_(UVM)',
26
+ 'TCGA_Mesothelioma_(MESO)', 'TCGA_Melanoma_(SKCM)', 'TCGA_Lung_Squamous_Cell_Carcinoma_(LUSC)',
27
+ 'TCGA_Lung_Cancer_(LUNG)', 'TCGA_Lung_Adenocarcinoma_(LUAD)', 'TCGA_Lower_Grade_Glioma_(LGG)',
28
+ 'TCGA_Liver_Cancer_(LIHC)', 'TCGA_Large_Bcell_Lymphoma_(DLBC)', 'TCGA_Kidney_Papillary_Cell_Carcinoma_(KIRP)',
29
+ 'TCGA_Kidney_Clear_Cell_Carcinoma_(KIRC)', 'TCGA_Kidney_Chromophobe_(KICH)', 'TCGA_Head_and_Neck_Cancer_(HNSC)',
30
+ 'TCGA_Glioblastoma_(GBM)', 'TCGA_Esophageal_Cancer_(ESCA)', 'TCGA_Endometrioid_Cancer_(UCEC)',
31
+ 'TCGA_Colon_and_Rectal_Cancer_(COADREAD)', 'TCGA_Colon_Cancer_(COAD)', 'TCGA_Cervical_Cancer_(CESC)',
32
+ 'TCGA_Breast_Cancer_(BRCA)', 'TCGA_Bladder_Cancer_(BLCA)', 'TCGA_Bile_Duct_Cancer_(CHOL)',
33
+ 'TCGA_Adrenocortical_Cancer_(ACC)', 'TCGA_Acute_Myeloid_Leukemia_(LAML)'
34
+ ]
35
+
36
+ trait_keyword = "Pancreatic_Cancer"
37
+ trait_abbreviation = "PAAD"
38
+
39
+ target_subdir = None
40
+ for sd in subdirectories:
41
+ if trait_keyword in sd or trait_abbreviation in sd:
42
+ target_subdir = sd
43
+ break
44
+
45
+ if target_subdir is None:
46
+ # No suitable data found for this trait; mark as completed
47
+ print("No TCGA subdirectory found for the trait. Skipping.")
48
+ else:
49
+ cohort_dir = os.path.join(tcga_root_dir, target_subdir)
50
+ # 2. Locate clinical and genetic data files
51
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
52
+
53
+ # 3. Load the data
54
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
55
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
56
+
57
+ # 4. Print column names of clinical data
58
+ print(clinical_df.columns)
59
+ candidate_age_cols = ["age_at_initial_pathologic_diagnosis"]
60
+ candidate_gender_cols = []
61
+
62
+ print("candidate_age_cols =", candidate_age_cols)
63
+ print("candidate_gender_cols =", candidate_gender_cols)
64
+
65
+ extracted_cols = candidate_age_cols + candidate_gender_cols
66
+
67
+ if extracted_cols:
68
+ extracted_df = clinical_df[extracted_cols]
69
+ print("Extracted Columns:", extracted_df.columns.tolist())
70
+ print("Preview (first 5 rows):", preview_df(extracted_df))
71
+ else:
72
+ print("No candidate columns found.")
73
+ age_col = "age_at_initial_pathologic_diagnosis"
74
+ gender_col = None
75
+
76
+ print("Chosen age_col:", age_col)
77
+ print("Chosen gender_col:", gender_col)
78
+ # 1. Extract and standardize the clinical features
79
+ selected_clinical_df = tcga_select_clinical_features(
80
+ clinical_df=clinical_df,
81
+ trait=trait,
82
+ age_col=age_col,
83
+ gender_col=gender_col
84
+ )
85
+
86
+ # (Optional) Save the selected clinical data
87
+ selected_clinical_df.to_csv(out_clinical_data_file)
88
+
89
+ # 2. Normalize gene symbols in the genetic data
90
+ normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
91
+ normalized_gene_df.to_csv(out_gene_data_file)
92
+
93
+ # 3. Link the clinical and genetic data on sample IDs
94
+ linked_data = selected_clinical_df.join(normalized_gene_df.T, how="inner")
95
+
96
+ # 4. Handle missing values
97
+ cleaned_df = handle_missing_values(linked_data, trait)
98
+
99
+ # 5. Determine if the trait or demographic features are biased
100
+ is_biased, final_df = judge_and_remove_biased_features(cleaned_df, trait)
101
+
102
+ # 6. Final quality validation
103
+ is_gene_available = not normalized_gene_df.empty
104
+ is_trait_available = trait in final_df.columns
105
+ is_usable = validate_and_save_cohort_info(
106
+ is_final=True,
107
+ cohort="TCGA",
108
+ info_path=json_path,
109
+ is_gene_available=is_gene_available,
110
+ is_trait_available=is_trait_available,
111
+ is_biased=is_biased,
112
+ df=final_df,
113
+ note=""
114
+ )
115
+
116
+ # 7. If the dataset is usable, save the final dataframe
117
+ if is_usable:
118
+ final_df.to_csv(out_data_file)
p1/preprocess/Pancreatic_Cancer/gene_data/GSE120127.csv ADDED
@@ -0,0 +1,660 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Gene,GSM3392954,GSM3392955,GSM3392956,GSM3392957,GSM3392958,GSM3392959
2
+ A4GALT,1.858015,1.829465,1.866155,1.841555,1.97635,1.94954
3
+ AAA1,32.96087573559773,32.93049541050616,32.78390685403485,33.017610704073704,32.220965923798424,31.856791225968475
4
+ AAR2,2.1873766666666667,1.9369133333333333,2.02495,2.151266666666667,2.08594,2.0652133333333333
5
+ ABCB6,93.21420499999999,91.77114183333333,93.14125083333333,87.10652583333334,86.07933033333333,84.1504535
6
+ ABCC11,75.94112482539683,75.37269024603175,76.03080293650794,75.50593324603174,73.66062432539682,74.93303888888889
7
+ ABCE1,3.3151675,3.336621,3.3466375,3.4654475,3.4416145,3.4044485
8
+ ADAR,3.0311719999999998,2.9770013333333334,2.748972,2.6553406666666666,2.6307313333333333,2.715101333333333
9
+ ADI1,1.197772,1.257368,1.26149,1.338692,1.504716,1.471714
10
+ AFF1,8.25282,7.932556666666667,7.89387,7.941686666666667,7.68355,7.9150833333333335
11
+ AICDA,16.849775,16.831625000000003,17.206805000000003,18.23356,18.18986,18.156455
12
+ AIG1,18.27905225,18.11132725,17.87997575,17.93795975,18.679066249999998,19.0344225
13
+ AIR,5.070455166666667,5.061105166666667,4.936610666666667,5.118323666666667,4.909303166666667,4.807835
14
+ AKAP8,6.366576666666667,6.431273333333333,6.35048,6.637446666666667,6.043456666666667,6.0522366666666665
15
+ ALB,2.804737676767677,2.7542586868686865,2.7811612626262625,2.64201202020202,2.5958716666666666,2.6413053535353535
16
+ ALG10,3.669945,3.788215,3.64354,3.951235,3.82961,3.87257
17
+ ALG3,4.313725,4.31389,4.24333,4.67354,4.518875,4.424105
18
+ ALG6,4.272443333333333,4.19639,4.143996666666666,4.724783333333333,4.444026666666667,4.285713333333334
19
+ ALG8,4.272443333333333,4.19639,4.143996666666666,4.724783333333333,4.444026666666667,4.285713333333334
20
+ ALK,1.467825,1.4249525,1.3810875,1.4177325,1.390135,1.33883
21
+ AMMECR1,9.273465,9.021765,9.08984,9.422235,9.268455,8.423755
22
+ ANKS1B,2.8399312500000002,2.76401,2.7753437499999998,2.837853125,2.7426793750000003,2.6383831250000003
23
+ ANKS4B,0.8171833333333334,0.8516116666666668,0.8264983333333333,0.7995,0.7514216666666668,0.7986333333333334
24
+ AQP1,1.883837777777778,2.0704322222222222,2.05195,1.92886,1.8826244444444442,2.0642766666666668
25
+ ARID1B,16.247368825757576,15.93978606060606,16.183315151515153,15.354027954545455,15.196054886363637,15.702561477272727
26
+ ARL6IP4,2.5551933333333334,2.51465,2.473196666666667,2.4274633333333333,2.47729,2.4238833333333334
27
+ ARTN,3.5708475,3.59851,3.707115,3.6964575,3.7704874999999998,3.97459
28
+ ASAP1,19.214238833333333,19.440867333333333,19.431995,19.372904666666667,19.020010833333334,19.246647333333335
29
+ ASD1,4.3573525,4.305159166666666,4.258743333333333,4.317975833333334,4.23467,4.229591666666667
30
+ ASPH,15.363189563492064,15.055301626984127,15.327442142857143,15.136833253968254,15.150764523809524,15.175809206349207
31
+ ASPSCR1,1.3520379999999999,1.312856,1.356902,1.3701539999999999,1.324446,1.429602
32
+ ATIC,2.77073,2.81184,2.8019433333333335,2.861136666666667,2.7277966666666664,2.6164133333333335
33
+ ATP23,1.5048466666666667,1.4522933333333334,1.44586,1.59644,1.5391033333333333,1.3708233333333333
34
+ ATP5PF,1.5905166666666668,1.6341,1.6926133333333333,1.7034566666666666,1.79917,1.6402566666666667
35
+ ATP6V0A4,9.405251666666667,9.582821666666666,9.458853333333334,9.443328333333334,10.663851666666666,9.841425000000001
36
+ ATP8A2,18.476918166666668,18.609134666666666,18.2111185,19.159514833333333,18.424330833333332,18.033152833333332
37
+ ATPAF1,2.78021,2.88655,2.91766,2.91846,2.673905,2.567705
38
+ ATPAF2,1.9648666666666665,1.9730333333333334,1.9223,2.0277833333333333,2.04934,2.03042
39
+ ATXN3,5.468451666666667,5.5477083333333335,5.55468,5.56985,5.410998333333334,5.333613333333333
40
+ ATXN7,13.13048,12.30814,12.2786775,12.6208075,11.951135,12.412625
41
+ AVL9,7.6523699999999995,7.698615833333333,7.746739166666667,7.895964166666667,7.801588333333333,7.726695833333333
42
+ B9D1,7.457364999999999,7.18594,7.159745,6.83439,7.017015,6.437315
43
+ BAAT,6.3332093333333335,6.674867619047619,6.3517217142857145,6.290031857142857,6.589650333333333,6.590907238095238
44
+ BAD,4.88501,4.72331,4.84898,5.099345,4.81975,4.642135
45
+ BANF1,5.557435,5.608755,5.477774999999999,5.70607,5.552595,5.419985
46
+ BAZ1B,2.550986571428571,2.4936411428571432,2.474361142857143,2.4626840000000003,2.366090285714286,2.4149279999999997
47
+ BBS9,5.30143,5.2662700000000005,5.1715,5.493645,6.12606,5.73926
48
+ BBX,1.4322300000000001,1.4707599999999998,1.467508,1.34355,1.31396,1.300032
49
+ BCL7A,8.803075,8.914945,8.734765,9.086120000000001,8.962955000000001,9.275770000000001
50
+ BFAR,23.97784807142857,24.043008547619046,23.62765738095238,24.457878452380953,23.59144757142857,23.56400845238095
51
+ BLOC1S6,21.1253865,21.31072066666667,21.219315,21.6080255,21.895462,21.28044
52
+ BLTP2,1.2887042857142856,1.266652857142857,1.2886757142857144,1.2279414285714285,1.2553142857142858,1.2834514285714285
53
+ BMS1,2.35942125,2.34054625,2.3192025,2.39044,2.3380825,2.2392149999999997
54
+ BNIP3,7.257999999999999,7.266775,7.23554,7.226445,7.835750000000001,8.129105
55
+ BOP1,1.465388,1.39751,1.4244080000000001,1.48965,1.37874,1.328982
56
+ BORCS5,2.438125,2.644715,2.580015,2.58899,2.590135,2.589815
57
+ BPIFA2,3.3870732142857145,3.391365357142857,3.3029717857142855,3.384435,3.2669217857142856,3.3264539285714285
58
+ BRAP,5.035093333333334,4.866355416666667,5.04730125,5.09986625,4.9837275,4.9884458333333335
59
+ BRCA1,3.449985,3.53098,3.448135,3.533145,3.49738,3.432545
60
+ BRCA2,0.8474833333333334,0.8051666666666667,0.73832,0.7578266666666668,0.783995,0.7132766666666667
61
+ BRD2,3.4650966666666667,3.552990952380952,3.4126457142857145,3.364497857142857,3.549335,3.413685238095238
62
+ BRD4,44.247375380952384,42.23878166666667,42.23768992857143,42.723851333333336,43.53150564285714,41.40638907142857
63
+ BRI3,5.654155,5.746415,5.974185,5.72871,5.765985,5.781965
64
+ BUB1,3.6387533333333337,3.5938808333333334,3.3672041666666663,3.5965566666666664,3.5151891666666666,3.1915291666666663
65
+ C1D,6.6063725,6.646380000000001,6.4836875,6.91017,7.0189825,6.4523875
66
+ C1QL1,4.11877,4.33293,4.305295,4.21562,4.33453,4.4355649999999995
67
+ C1orf43,7.97095,7.949725,8.30463,8.619250000000001,8.111509999999999,8.348435
68
+ C2,209.8815207738095,209.886480505772,211.10279506204907,209.4044530223665,209.81673346717173,212.57742509199133
69
+ C21orf91,2.78762,2.956165,2.931135,2.680975,2.697405,2.634945
70
+ C4B,45.2719446545399,44.523341765567764,44.06059901140526,43.49356256993007,42.602762896298145,43.388690817765564
71
+ CARM1,0.744969,0.754089,0.756114,0.784347,0.69917,0.757592
72
+ CARTPT,1.838085,1.87365,2.004325,1.89471,1.859455,2.15969
73
+ CAVIN2,76.7830839614552,77.79266876090576,77.3174887942058,76.84989723418248,78.09309468464869,76.84558967707292
74
+ CCL4L1,25.971856523809524,26.079037916666667,26.03957332142857,26.561225047619047,26.67057026190476,26.125902904761904
75
+ CD34,9.9078,9.188125,9.506855,9.78491,9.9962,10.54277
76
+ CD36,8.61719,9.157135,8.859085,8.68001,8.695395,8.29874
77
+ CD38,4.600483333333333,4.638663333333334,5.067896666666667,4.79854,4.787093333333333,4.828386666666667
78
+ CD4,0.28258222222222223,0.3020922222222222,0.3005933333333333,0.32356444444444443,0.30271000000000003,0.29799333333333333
79
+ CD46,1.142695,1.0167375,1.0621975,1.12023,1.04216,0.9718075
80
+ CD47,4.014895,4.060256666666667,3.8726583333333333,3.67452,3.9634583333333335,3.74012
81
+ CD59,74.71160766666667,78.889349,76.117541,76.58593483333334,79.39519233333333,80.757357
82
+ CD99,3.692635,3.69676,3.64845,3.916545,3.760385,3.836065
83
+ CDC123,3.949705,3.877735,4.01465,4.131835,4.266,4.01711
84
+ CDC26,3.563785,3.50411,3.524085,3.64615,3.65119,3.354855
85
+ CDC45,2.877345,2.70942,2.66619,2.898095,3.09369,2.69328
86
+ CDC6,1.7108486666666667,1.6514757777777778,1.5190406666666667,1.7280466666666667,1.680203111111111,1.64411
87
+ CDCA7L,6.49796,6.04083,6.17006,6.538775,6.258884999999999,5.715574999999999
88
+ CDIP1,30.490373345238094,30.81079666269841,30.689849337301588,30.712669753968253,30.253747924603175,30.139749468253967
89
+ CDK5RAP2,19.31417,19.21337,19.65844333333333,19.834303333333335,19.127376666666667,19.44601
90
+ CDKN2A,164.20789062617936,162.97124192704518,163.64807976409702,165.8377998654401,163.81420587978687,163.11264691000665
91
+ CDKN3,1.4230775,1.3959775,1.2925575,1.48607,1.530475,1.2724075
92
+ CDT1,3.43376,3.47802,3.25174,3.48045,3.168705,3.233665
93
+ CEBPZ,80.42350690476191,80.634406,78.70643885714286,86.2682793095238,87.02991888095238,83.94461716666667
94
+ CENPS-CORT,2.58127,2.60005,2.513905,2.82924,2.78841,2.75518
95
+ CEP55,2.9979175,2.94408,2.77732,2.7838925000000003,2.7362175,2.632175
96
+ CFAP97,0.749402,0.732536,0.622688,0.728606,0.9094900000000001,0.820552
97
+ CFI,1.78733858974359,1.747391923076923,1.7768926923076922,1.7645816666666665,1.6346485897435896,1.6811021794871794
98
+ CHRD,1.14617,1.0827033333333334,1.1115,1.0319800000000001,1.2210266666666667,1.2277266666666666
99
+ CHRM3,1.68827,1.6043666666666667,1.5802433333333334,1.6739300000000001,1.54667,1.57423
100
+ CHTOP,3.273315,3.1502074999999996,3.1684725,3.35323,3.256855,3.1818775
101
+ CHURC1,24.72577,24.42198,24.736625,24.79708,24.59111,23.53421
102
+ CIMAP2,3.3152541666666666,3.2202158333333335,3.2556575,3.2862783333333336,3.1341091666666667,3.252396666666667
103
+ CISH,36.15428141666666,36.35329875,36.49348258333333,36.2934975,36.04608275,37.553074083333335
104
+ CLASRP,5.811468666666666,5.855383333333333,5.789422666666667,5.596246,5.599786,5.7276826666666665
105
+ CLIC4,16.811858273809523,16.79572755952381,16.949986904761904,18.28842267857143,18.206285833333332,18.316207976190476
106
+ CLIP2,0.814095,0.7672599999999999,0.6215666666666667,0.7711783333333333,0.75779,0.7194600000000001
107
+ CLN8,23.909393666666666,24.050097916666665,23.96634475,24.563349333333335,24.658858833333333,24.127564333333332
108
+ CNOT2,3.083088214285714,3.067714642857143,3.0309385714285715,3.0403707142857144,2.9918428571428572,3.0478360714285717
109
+ CNOT3,3.083088214285714,3.067714642857143,3.0309385714285715,3.0403707142857144,2.9918428571428572,3.0478360714285717
110
+ CNOT7,10.171936666666667,10.282446666666667,9.898511666666668,10.608953333333334,10.239196666666667,10.2376
111
+ CNTF,6.13915,5.933955,5.848907499999999,6.0305775,5.6940124999999995,5.740215
112
+ COA5,3.95653,4.00693,3.89074,4.090195,3.888425,3.954855
113
+ COG2,0.85459,0.8485071428571428,0.8536157142857144,0.9222628571428572,0.8616485714285714,0.8554700000000001
114
+ COPS5,20.62311875,20.732979583333332,20.778225694444444,20.96664375,20.719297083333334,20.339385416666666
115
+ COPS8,8.320762333333333,8.146341666666666,8.216191666666667,8.388005666666666,8.153418333333333,8.132211666666667
116
+ COQ5,15.450862483516485,15.811756486263736,15.458722095238095,16.00397539010989,15.649636217948718,15.731993838827838
117
+ COQ9,2.807925,2.854575,2.743005,2.83173,2.63562,2.6921
118
+ COX20,3.259555,3.12298,3.359545,4.00297,4.0788,3.92747
119
+ COX8A,1.460785,1.445635,1.358285,1.51429,1.460845,1.29828
120
+ CPAT1,1.4730699999999999,1.5330342857142858,1.5811542857142857,1.4831514285714285,1.6238185714285716,1.5399528571428571
121
+ CPE,2.30521125,2.2651275,2.3059133333333333,1.9446091666666665,1.7495720833333333,1.8861720833333333
122
+ CR1,16.65595666666667,16.778526666666668,16.508103333333334,16.80471,16.131643333333333,16.605466666666665
123
+ CRIPT,2.8825366666666667,2.8570533333333334,2.8923799999999997,3.0202033333333334,3.0716666666666668,2.9196233333333335
124
+ CROT,14.366881904761906,14.171832380952381,14.449089523809523,14.283882380952381,14.030689523809524,13.288690476190476
125
+ CRTAC1,0.52579,0.5156633333333334,0.5697283333333333,0.5264683333333333,0.5412666666666667,0.5424833333333333
126
+ CRTAP,1.2624600000000001,1.2160283333333333,1.3049666666666666,1.2254083333333334,1.1600916666666665,1.15608
127
+ CRYGD,38.77260015620491,39.457901576479074,38.33066438419913,37.69171614862915,38.76519490909091,38.301762072510826
128
+ CRYGEP,6.026883505050505,5.812711414141414,5.613513181818182,5.887827464646465,5.924549858585859,5.649538333333333
129
+ CS,38.61195869047619,37.848528333333334,38.401210654761904,38.53283773809524,37.50655023809524,36.86378630952381
130
+ CST12P,130.9695953095238,132.38207046825397,132.74466694444445,134.38662263492063,131.52538923809524,132.76071296031745
131
+ CTD,2.736554,2.753072,2.776996,2.691354,2.5225619999999997,2.7209779999999997
132
+ CTDSP1,4.946528333333333,4.768361666666666,4.9323516666666665,5.15735,5.047263333333333,4.79039
133
+ CTNNB1,4.909935,4.8403075,4.863175,4.6923425,4.8279175,4.8128425
134
+ CTNNBIP1,7.02806,7.214575,6.8779900000000005,7.017445,6.63631,6.212455
135
+ CTNNBL1,35.142615,34.86517,35.45634,35.01661,33.92627,33.50658
136
+ CYGB,1.634566217948718,1.5893775641025643,1.5724332692307692,1.5377075641025642,1.535991794871795,1.5868565384615385
137
+ CYP2B6,157.05743142857142,159.29645714285715,157.425035,158.1367407142857,164.6534142857143,162.10027642857142
138
+ CYRIB,19.482788333333332,20.61996333333333,20.107588333333332,19.095965,19.074938333333332,18.185164999999998
139
+ CYTH1,7.697578,7.7094673333333334,7.811185333333333,7.268223333333333,7.28393,7.159521333333334
140
+ DAP,5.149066,4.999232,4.964752,5.044156,5.0666139999999995,5.005308
141
+ DBI,20.55776,20.434163333333334,20.737013333333334,20.884791666666665,20.495226666666667,20.105596666666667
142
+ DDT,4.760911238095238,4.656085142857143,4.720086809523809,4.4706209999999995,4.361744285714286,4.443583333333334
143
+ DECR1,0.46598428571428574,0.4582,0.54642,0.5105271428571428,0.5258885714285715,0.5032128571428571
144
+ DEK,7.226119166666667,7.004300000000001,7.01314,7.13235,6.813056666666666,6.905681666666667
145
+ DHCR7-DT,49.989135857142855,48.865964142857145,49.406974142857145,50.215321357142855,49.45340142857143,48.20681021428572
146
+ DHDDS,14.366881904761906,14.171832380952381,14.449089523809523,14.283882380952381,14.030689523809524,13.288690476190476
147
+ DHX40,4.793518333333333,4.67888,4.706098333333333,4.786296666666667,5.169143333333333,5.252555
148
+ DIABLO,3.110785,2.956125,2.943685,3.062475,2.94453,2.9375
149
+ DISC1,1.7411033333333332,1.6726133333333333,1.7186766666666669,1.6618899999999999,1.6218866666666667,1.5658966666666665
150
+ DKK1,4.39187,4.6047424999999995,4.34375,4.236585,4.3342325,4.586075
151
+ DMPK,5.983329166666667,6.317270166666667,6.256375833333333,6.406073833333334,6.5432435,6.599687
152
+ DNAJC7,62.27380760353535,61.71458593908869,61.69341285353535,61.96213949236874,60.726319452630705,60.83201521131646
153
+ DOT1L,4.934385,4.899378333333333,4.9103216666666665,4.774016666666666,4.651508333333333,4.612016666666666
154
+ DPH1,3.0693900000000003,2.9061866666666667,2.875636666666667,2.991085,2.804185,2.798103333333333
155
+ DPH2,3.0693900000000003,2.9061866666666667,2.875636666666667,2.991085,2.804185,2.798103333333333
156
+ DRAM1,19.084875,19.147175,18.7505675,18.820610000000002,19.3923925,18.9639675
157
+ DSCAM-AS1,5.854526571428572,5.827554857142857,5.813090214285714,5.875121142857143,5.741921928571429,5.789790928571428
158
+ DSCC1,1.30929,1.38217,1.479255,1.367285,1.295095,1.30958
159
+ DSN1,2.270725,2.324095,2.49022,2.356795,2.15901,1.959945
160
+ DUSP5,9.659116666666666,9.481178333333334,9.415068333333332,9.654065833333334,9.1449175,9.472900833333334
161
+ DVL1P1,1.8830175,1.86341,1.8963812500000001,1.8489875,1.7801312500000002,1.79720625
162
+ DYM,23.292412,23.340785,22.968865666666666,22.9514015,22.7784495,22.189973833333333
163
+ DYRK3,1.4116600000000001,1.4081733333333333,1.3755266666666666,1.4163983333333334,1.3921083333333335,1.3621400000000001
164
+ ECD,3.76754,3.7843,3.7348,3.87226,3.62394,3.64007
165
+ ECSIT,2.396665,2.59429,2.53287,2.663545,2.406485,2.31709
166
+ EEF1A2,22.54176898043623,21.834998155760907,22.115463233433232,22.26923016774892,22.238976312687313,22.324619194638696
167
+ EEF1B2,43.767040373376624,43.842672377705625,43.58674965909091,43.78815217424243,43.004557471861474,43.17342231493507
168
+ EEF2,11.330843795454545,11.444758946969698,11.47920046969697,11.652137227272728,11.481921234848485,11.774690848484848
169
+ EEIG1,3.720605,3.5912875,3.622425,3.6707574999999997,3.6105025,3.71056
170
+ EGF,51.92661286874237,52.126659437118434,51.577851423992676,50.09503646489622,50.65496493376068,49.471416304334554
171
+ EGFR,3.6146495833333336,3.637440416666667,3.6269358333333335,3.61147625,3.5218687500000003,3.738817916666667
172
+ EHBP1,3.720605,3.5912875,3.622425,3.6707574999999997,3.6105025,3.71056
173
+ EIF1,21.961105,21.861805,22.29355,22.45029,23.050240000000002,21.507955000000003
174
+ EIF5B,1.792688,1.78114,1.771686,1.8479379999999999,1.752468,1.7840699999999998
175
+ ELL,9.2725425,9.260028166666666,9.322511,9.357046833333333,9.316835,8.7736245
176
+ ELOA,1.269275,1.2390999999999999,1.2670299999999999,1.2757783333333335,1.1885466666666666,1.240835
177
+ ELP1,5.410299999999999,5.3836675,5.3674375,5.4990125,5.3056925,5.1784975
178
+ EMC4,2.3734533333333334,2.40328,2.38508,2.5790666666666664,2.46168,2.42158
179
+ EMG1,2.24339,2.2446366666666666,2.2400533333333335,2.3285633333333333,2.3030433333333336,2.08876
180
+ EMILIN1,11.886714226190476,12.223447023809523,12.081236261904762,12.01729611904762,12.439099428571428,12.371068869047619
181
+ EMSY,2.61483,2.5325966666666666,2.516626666666667,2.55858,2.3737333333333335,2.3341266666666667
182
+ ENOPH1,14.516516785714286,15.03433884920635,14.824368253968254,14.575763134920635,14.615666785714286,14.590135634920635
183
+ ENTPD1,21.38715,21.284683333333334,21.35023,19.459826666666665,19.362616666666668,19.42564
184
+ EOGT,6.664054999999999,6.43647,6.59056,6.43079,6.029345,6.12214
185
+ ERCC4,9.17042,8.662498,8.805173,9.653347,9.068441,8.991351
186
+ ERCC5,5.613246,5.404484,5.155512,5.751994,5.61813,5.192498
187
+ ESCO1,5.437451666666667,5.332321666666667,5.330116666666667,5.282558333333333,5.147683333333333,5.052875
188
+ ESS2,3.35052,3.42944,3.290785,3.50323,3.475465,3.511895
189
+ EVA1C,1.9628766666666666,1.9883966666666666,2.0974533333333336,2.1281266666666667,2.23851,2.04994
190
+ EXOSC1,4.1025,4.247415,4.01375,4.35618,4.204175,3.88678
191
+ EXTL2,9.0757875,8.921168333333332,8.868499166666666,8.3568625,8.1245625,8.420964166666666
192
+ EZH2,3.103928,3.1310160000000002,3.16097,3.121402,3.123424,3.15665
193
+ F2,0.45133875,0.49353625,0.4140025,0.39945625,0.41848,0.4326125
194
+ FAM50A,4.54147,4.61154,4.620335,4.7804199999999994,4.933235,4.7416149999999995
195
+ FAS,5.073272333333334,4.996454333333333,5.059911333333334,4.882932333333334,5.0331426666666665,5.163020666666666
196
+ FAS-AS1,3.127135,3.1129825,2.99558,3.0146575,3.00701,2.9870025
197
+ FAT1,9.144320496392496,8.84614557828283,9.013294377344877,8.739055615079366,8.278316555194806,8.493514835858585
198
+ FATE1,3.83129,3.87665,3.859955,4.00934,3.83841,3.82427
199
+ FAU,9.54863,9.44709,9.56662,9.5594,9.733856666666666,9.13576
200
+ FBXO3,8.068479166666666,7.933604166666666,8.064575833333333,7.33848,7.2841175,7.277321666666667
201
+ FEN1,5.613246,5.404484,5.155512,5.751994,5.61813,5.192498
202
+ FGF9,8.645136666666666,8.768143333333333,8.524586666666666,8.79651,8.969046666666667,8.774723333333334
203
+ FGFR1,3.273315,3.1502074999999996,3.1684725,3.35323,3.256855,3.1818775
204
+ FGGY,8.769498,8.877591333333333,8.695127333333334,8.720436,8.356986666666668,8.411802
205
+ FIG4,8.668708333333333,8.495451666666666,8.722021666666667,8.365635000000001,7.930725000000001,8.078861666666667
206
+ FLVCR2,5.654138333333333,5.690611666666666,5.666996666666666,5.606616666666667,5.612993333333334,5.7236183333333335
207
+ FMN1,2.5742225000000003,2.70959,2.4675374999999997,2.40644,2.4983825,2.2187075
208
+ FOXD3-AS1,6.935148666666667,6.9786850000000005,6.883486333333333,6.962807333333333,6.791309333333333,6.441482333333333
209
+ FRAXE,8.25282,7.932556666666667,7.89387,7.941686666666667,7.68355,7.9150833333333335
210
+ FXN,7.466140833333333,7.464559444444444,7.38779,7.351653333333333,7.283716666666667,7.392863611111111
211
+ GAD1,1.0423666666666667,1.0623583333333333,1.0245283333333333,1.07284,0.9704766666666668,1.047175
212
+ GAL,0.97775,1.0075533333333333,0.99397,1.02289,1.0594433333333333,0.9287566666666667
213
+ GAP43,0.360125,0.3059825,0.32612375,0.30831875,0.33996125,0.29327125
214
+ GAPT,1.334625,1.45733,1.375135,1.376395,1.42631,1.34083
215
+ GAS1,9.03326,8.978523333333333,8.910066666666667,9.415123333333334,9.611550000000001,9.7951
216
+ GATA4,5.8256625,5.644996666666667,5.585885833333333,5.832560833333334,5.6296425,5.583364166666667
217
+ GATM,2.474556666666667,2.643403333333333,2.52617,2.77711,2.6194866666666665,2.9555866666666666
218
+ GBA2,1.530575,1.433665,1.483435,1.372145,1.23021,1.2357775
219
+ GDNF,9.03326,8.978523333333333,8.910066666666667,9.415123333333334,9.611550000000001,9.7951
220
+ GFM1,4.520488128787878,4.506303446969697,4.499345803030303,4.641043560606061,4.381365734848485,4.478934848484848
221
+ GIP,7.4589566666666665,7.0103800000000005,7.00216,7.239356666666667,7.25547,7.412176666666666
222
+ GLA,22.387836492063492,22.911072222222224,22.88217892063492,25.16849438095238,24.55230412698413,25.825423158730157
223
+ GLUL,4.34558625,4.31089125,4.3033975,4.2460825,4.210215,4.34975375
224
+ GLYAT,13.202738499999999,13.0750105,12.867886,13.337822000000001,12.909607,13.050721
225
+ GLYATL1,62.06262228571428,62.630909238095235,62.39440907142857,61.082274857142856,60.99579569047619,60.38761504761905
226
+ GORAB,33.233088333333335,36.671925,36.753618333333335,37.550093333333336,32.493338333333334,33.29363333333333
227
+ GORASP2,4.672553333333333,4.653006666666667,4.632826666666666,4.766836666666666,4.5039766666666665,4.6538466666666665
228
+ GPHA2,19.683639166666666,20.515496666666667,20.317350833333332,19.886240833333332,21.091375,21.958975
229
+ GPI,33.81867510714286,33.58946264285714,33.54512928571429,32.75778170238095,32.94219197619048,31.91524939285714
230
+ GPR166P,1627.9537178733767,1651.344651141414,1628.9464768210678,1638.6763441356422,1710.4711202871572,1724.5425854051227
231
+ GRIK4,7.164490785714285,7.149552357142857,7.047931428571428,7.257597714285715,7.207346357142857,7.345159642857143
232
+ GRIP1,12.809795,12.613825,12.64948,12.55991,12.178515,12.56085
233
+ GTF2B,2.358065,2.258185,2.3102549999999997,2.3618550000000003,2.2780933333333335,2.2650116666666666
234
+ GTF2H5,4.5139543333333325,4.501428333333333,4.384156249999999,4.63101775,4.62703575,4.521142333333334
235
+ GTF2IRD1,19.332899,19.157139,18.915709,18.824224,18.750397,19.488128
236
+ GTF3C1,5.834976666666667,5.704978333333333,5.708633333333333,5.880095,5.582498333333334,5.675488333333334
237
+ GYPC,5.7988875,5.835235,5.715925833333333,5.665094166666667,5.542399166666667,5.405631666666666
238
+ H3P44,0.61136,0.6004128571428572,0.6103542857142857,0.6423728571428572,0.6221057142857143,0.6237371428571429
239
+ H3P7,1.2900566666666666,1.4382433333333333,1.3406200000000001,1.3030066666666666,1.3596033333333333,1.4056833333333334
240
+ HACD1,10.0542275,9.7862925,10.288147500000001,10.3358,10.32794,9.92172
241
+ HADH,9.645847603174603,9.953835761904761,9.950381587301587,9.870726142857142,10.085136746031745,9.866318238095237
242
+ HAP1,5.707661666666667,5.516181666666666,5.509225833333334,5.3628175,4.994918333333333,5.30271
243
+ HAT1,3.864673333333333,3.7336566666666666,3.7516833333333333,3.7831599999999996,3.93309,3.83723
244
+ HAVCR1,6.9261525,7.296687500000001,7.431587,7.020112,6.979807,6.665656
245
+ HBP1,6.0397108333333325,6.051645833333334,6.012875,5.973278333333333,5.886945833333334,6.141965833333334
246
+ HCST,1.78904,1.93773,1.85319,1.902655,2.116915,1.874915
247
+ HEBP2,5.0679,5.0413499999999996,5.30798,4.86428,4.5022400000000005,4.25089
248
+ HEPH,3.79311,3.71359,3.76652,3.77862,3.640965,3.515305
249
+ HEXIM2,8.631780000000001,8.56701,8.853255,8.69664,9.154555,8.741525
250
+ HIRA,1.0738483333333333,1.0540866666666666,1.058745,1.0410066666666666,0.9875183333333334,1.0154116666666666
251
+ HJURP,1.1948983333333334,1.1696883333333334,1.19088,1.2206683333333335,1.18821,1.2246249999999999
252
+ HLA-C,39.3533225,39.19389698412699,38.83099861111111,37.05332305555555,38.40573496031746,38.08780063492063
253
+ HLTF,0.728494,0.719372,0.735759,0.726059,0.714213,0.688763
254
+ HMGA2,13.39758,13.03886,13.108835000000001,14.310495,13.167965,13.161710000000001
255
+ HRH4,2.969745,2.93248,2.92578,2.952075,2.888215,2.7128
256
+ HTT,7.457085,7.530855,7.554007499999999,7.5603425,7.6147225,6.9417349999999995
257
+ HUWE1,1.2043325,1.168575,1.1662,1.2785175,1.2480875,1.002905
258
+ IFI30,3.81398,3.77863,3.77931,3.62262,3.7318,3.198555
259
+ IGKJ1,4.892053333333333,4.839713333333333,4.899523333333333,4.896973333333333,4.865966666666667,4.951656666666667
260
+ IGKV1-12,4.31552,4.1598939999999995,4.163409,4.300008,4.172273000000001,4.116943
261
+ IGKV1-13,2.2671733333333335,2.12177,2.184136666666667,2.3514466666666665,2.40483,2.1622866666666667
262
+ IGKV1-5,14.522488708333334,14.243060125,14.155815541666666,14.707277333333334,14.586934875,14.40037575
263
+ IGKV1-8,2.08588,2.09912,2.0895233333333336,2.0528033333333333,2.0459533333333333,2.0935366666666666
264
+ IGKV1D-17,4.789495,4.820655,4.809975,4.93681,4.88956,4.750415
265
+ IGKV1D-42,15.916203333333334,16.34795666666667,16.380543333333332,16.119226666666666,16.270613333333333,15.796869999999998
266
+ IGKV1D-43,24.040334666666666,24.626690666666665,25.373318666666666,26.008790666666666,25.456144,25.112891333333334
267
+ IGKV2D-10,2.864895,2.90913,2.85208,2.93236,2.99471,2.73486
268
+ IGKV2D-14,19.388743333333334,19.944946666666667,20.028958333333332,20.07217166666667,20.154668333333333,19.723695
269
+ IGKV2D-26,5.280675,5.359095,5.408885,5.36949,5.215115,5.204105
270
+ IGKV2D-29,2.8587341666666664,2.6769625,2.8571408333333332,2.9057108333333335,2.6879741666666668,3.372558333333333
271
+ IGKV2D-30,43.46226291666667,43.42422125,43.13488541666667,43.3376475,45.012422916666665,44.0818925
272
+ IGKV3-7,9.577023333333333,9.572698333333333,9.819663333333335,10.02455,9.7984225,9.671356666666666
273
+ IGKV3D-11,2.64948,2.458295,2.773415,2.90553,2.803475,2.47578
274
+ IGKV3D-15,11.596264999999999,11.645230000000002,11.69458,12.027280000000001,12.30232,11.66807
275
+ IGKV3D-7,24.040334666666666,24.626690666666665,25.373318666666666,26.008790666666666,25.456144,25.112891333333334
276
+ IGKV4-1,3.1954465,3.240804,3.2127265,3.145728,3.0920115,3.0774915
277
+ IKBKE,8.097175,8.058415,7.93192,8.261095000000001,7.94742,8.101595
278
+ IKBKG,5.7408165,5.76657,5.615023166666667,5.921173,5.5186505,5.602330833333333
279
+ IL6,6.559555,6.681494166666667,6.633868333333334,6.8519008333333336,6.682841666666667,6.559343333333333
280
+ INCENP,1.0902516666666666,1.0523216666666666,1.0200066666666667,1.0206883333333334,1.055485,0.9602133333333334
281
+ INMT,2.2281050000000002,2.1737675000000003,2.2412625,2.2060875,2.25312,2.15974
282
+ IRAG1,4.243875,4.23175,4.601095,4.04029,4.440265,4.1623149999999995
283
+ ITGB3BP,1.56039,1.534275,1.629145,1.533985,1.71769,1.319765
284
+ ITGBL1,3.41922,3.318673333333333,3.3192199999999996,3.5107066666666666,3.60538,3.4384966666666665
285
+ ITPR3,4.507681666666667,4.438657976190476,4.527731309523809,4.270274880952381,4.090081071428571,4.400652738095238
286
+ ITSN2,11.2163915,11.124747166666666,11.047173,11.174959666666666,10.9492785,11.092737333333334
287
+ JPT2,27.025072972222222,27.288567706349205,27.013927702380954,27.242074190476192,27.130958805555554,26.450459837301587
288
+ KAT2B,2.4053666666666667,2.318675,2.3974116666666667,2.2697933333333333,2.126733333333333,2.1800966666666666
289
+ KAT6A,9.137174916666666,9.11115425,9.208116333333333,9.237034583333333,8.9326075,8.857035333333332
290
+ KCNH6,3.236705,3.25512,3.21416,3.342545,3.21395,3.08117
291
+ KCNMB2,0.7549675,0.788715,0.785635,0.7915625,0.8507475,0.939755
292
+ KNCN,21.583458333333333,22.43543,21.757481666666664,22.904556666666664,22.833925,22.070096666666664
293
+ KNG1,10.7291775,11.160409166666668,11.2894425,10.848825,11.617148333333333,11.848855833333333
294
+ KNTC1,1.2002000000000002,1.176682,1.097168,1.161316,1.162102,1.037536
295
+ KRAS,0.897205,0.90643,0.7822399999999999,1.048705,1.0272566666666667,0.9778116666666666
296
+ KRR1,2.63791,2.624595,2.735965,2.6929,2.706535,2.63628
297
+ KRTCAP2,4.123695,4.18796,4.186195,4.22498,4.21912,4.13304
298
+ KTI12,13.955872,14.086789,13.93528375,14.197978749999999,14.05553125,14.08293325
299
+ LDB1,25.238325333333332,25.479873333333334,24.853024333333334,25.510576,25.205041333333334,25.344688333333334
300
+ LDLR,15.88989846825397,15.84164246825397,15.872050476190477,15.089349174603175,15.038251865079365,16.039949928571428
301
+ LEMD3,4.029343333333333,4.171973333333334,4.11503,3.91887,3.702186666666667,4.060723333333334
302
+ LHX2,17.52040778594771,17.227427357843137,17.289056068627453,17.432174130718955,17.26191272385621,17.126615565359476
303
+ LIAS,4.7547075,4.7032375,4.72403,4.8163,4.796535,4.8704425
304
+ LILRB4,3.1954465,3.240804,3.2127265,3.145728,3.0920115,3.0774915
305
+ LIN9,5.545900714285715,5.569348333333334,5.476408571428571,5.761308809523809,5.605822619047619,5.49412619047619
306
+ LMNA,2.63819,2.685225,2.65344,2.57651,2.579005,2.43256
307
+ LOC107228318,2.59185,2.628825,2.58665,2.639725,2.62745,2.566775
308
+ LOC107228383,4.269455,4.50639,4.41134,4.7763,4.708575,4.52283
309
+ LOC108281177,2.94734,2.727485,2.919765,2.946265,2.95398,2.77487
310
+ LOC124904439,5.492723333333334,5.74474,5.456706666666666,5.740963333333333,5.808596666666666,5.719593333333333
311
+ LOC124908102,17.77068166666667,17.80758833333333,18.034945,18.545371666666668,18.218761666666666,18.331015
312
+ LRPAP1,8.620001166666666,8.7343575,8.611241333333332,8.714819833333333,8.420456833333333,8.132842333333333
313
+ LSR,11.474605,10.737200000000001,11.022525,11.378449999999999,11.50716,11.31571
314
+ LUC7L3,3.3182582857142857,3.190127714285714,3.236122285714286,3.248931142857143,3.170064857142857,3.2475
315
+ MADD,20.91421411111111,20.407199916666666,21.023329027777777,19.485408111111113,19.156394527777778,19.692931277777777
316
+ MAEA,55.0808705,55.9257025,55.41259266666667,56.3236085,58.387684666666665,57.57074016666667
317
+ MAP1B,4.29254,4.24126,4.35412,4.09688,4.19817,3.75951
318
+ MAP2,0.9747166666666667,1.0003516666666668,0.9844216666666666,0.9934383333333333,0.9758733333333334,0.9638049999999999
319
+ MAP6,2.5999166666666667,2.5706166666666665,2.7429499999999996,2.95998,2.84839,2.6506499999999997
320
+ MAP7,9.23961,9.264115,9.236515,9.169585,8.675285,9.124985
321
+ MAPK8,8.37753,8.239763,8.4394805,8.032651166666666,7.716260166666666,7.691131
322
+ MARCHF8,14.18013755952381,13.96751244047619,14.237857976190476,14.13865505952381,13.9676375,13.528090178571428
323
+ MARCKS,4.458453333333333,4.415836666666666,4.4847399999999995,4.681896666666667,4.519196666666667,4.91076
324
+ MARCKSL1,2.841863333333333,2.8052266666666665,2.78735,2.68919,2.6350666666666664,2.6729299999999996
325
+ MARVELD2,5.050599999999999,4.850795,4.919425,4.93579,4.647475,4.3323599999999995
326
+ MAS1L,15.32399,15.57602,15.275545,15.935025,15.520715,15.616295000000001
327
+ MATN1,12.987074166666666,13.073565833333333,12.783923333333334,12.550867499999999,12.649482500000001,12.5987975
328
+ MCM3AP,8.668708333333333,8.495451666666666,8.722021666666667,8.365635000000001,7.930725000000001,8.078861666666667
329
+ MDM2,11.44912,11.231658333333334,11.166628333333334,11.165523333333333,10.838511666666667,10.869730833333334
330
+ MED10,30.08075,30.139931,30.851049,30.068896000000002,30.272442,28.151932000000002
331
+ MEF2A,3.37585,3.372815,3.20161,3.26189,3.08493,3.1637
332
+ METTL9,2.43799,2.52869,2.579375,2.566875,2.565125,2.5522125
333
+ MFAP1,15.002600000000001,14.990841666666668,15.08477,15.779268333333333,14.960963333333332,15.314226666666666
334
+ MICOS10-NBL1,13.2882075,14.20289,13.300875833333333,12.8610875,13.3450325,13.50622
335
+ MKI67,1.8752775,1.8253525,1.880955,1.9300325,1.96139,1.813915
336
+ MMEL1,6.1424825,6.0763025,6.087865,5.9872125,5.9022025000000005,5.684085
337
+ MMS19,3.6358673333333336,3.533676,3.5586026666666664,3.6305826666666667,3.3126759999999997,3.589622
338
+ MOBP,4.59911,4.96386,4.6230400000000005,5.35713,5.960745,7.2540249999999995
339
+ MPG,1.7405433333333333,1.7880333333333331,1.7330833333333333,1.93061,1.8620566666666667,1.8769633333333333
340
+ MRGBP,2.672265,2.69328,2.786915,3.06692,2.835185,2.76556
341
+ MRLN,18.573435,18.314051666666668,18.6218,17.900258333333333,17.734291666666667,17.988925
342
+ MSC-AS1,3.14149,3.12385,3.01986,3.04161,2.898535,2.88231
343
+ MTCP1,7.202313333333333,6.922503333333333,7.370866666666666,6.854655833333334,7.549553333333333,7.2701641666666665
344
+ MTG1,58.911272613553116,59.168592161172164,58.98433543040293,59.04269446428572,57.8917105540293,59.16501439377289
345
+ MTSS1,8.236482714285714,8.168719142857142,8.113486,8.463108761904762,8.552150857142857,8.825751428571428
346
+ MXD1,16.287926666666667,16.262971166666667,16.225467666666667,16.298256333333335,15.847063833333333,16.027201
347
+ MYCBP2,5.6378683333333335,5.697533333333333,5.614464999999999,5.672183333333333,5.49569,5.502943333333333
348
+ MYRF,3.0577633333333334,2.9253733333333334,2.7705366666666666,3.24191,3.4842866666666668,2.860636666666667
349
+ NAPSA,4.111587803030303,3.896986893939394,4.144580227272727,4.170365075757576,4.032096439393939,4.161862651515151
350
+ NBEAL2,19.564217127578303,19.2446499714795,19.33175027858416,18.52026525445633,18.6985937610135,19.270498716513877
351
+ NDE1,4.810456666666667,4.85379,4.944533333333333,4.820416666666667,4.65413,4.587843333333334
352
+ NDOR1,0.8482255555555556,0.8692566666666666,0.8471466666666667,0.9089377777777777,0.9647266666666667,1.15207
353
+ NDUFA13,3.656065,3.63295,3.74953,3.907105,4.026635,3.70395
354
+ NDUFA6,2.27142,2.3818966666666666,2.36895,2.4120333333333335,2.2952233333333334,2.3527299999999998
355
+ NDUFB11,3.3632233333333335,3.4070633333333333,3.0516133333333335,3.20991,3.2457433333333334,3.4034966666666664
356
+ NDUFB5,1.4381425,1.4904175,1.499995,1.522525,1.57401,1.5002425
357
+ NDUFB8,1.7523433333333334,1.6693833333333332,1.8649333333333333,1.8802199999999998,1.81006,1.6921566666666665
358
+ NEDD4,4.896323333333333,4.851356666666666,4.998086666666667,5.065033333333334,5.08542,4.951323333333333
359
+ NELFCD,3.07988,3.083405,3.048635,3.172185,3.138275,3.113075
360
+ NEO1,1.415055,1.4037300000000001,1.4044616666666665,1.388755,1.2516216666666666,1.37599
361
+ NGFR,28.499653333333335,28.312735833333335,28.78851166666667,29.203465833333333,28.991295833333332,30.042790833333335
362
+ NHEJ1,2.063855,2.19837,1.76153,2.05345,1.84933,1.87268
363
+ NHERF1,2.951008,2.9057880000000003,2.893758,3.013578,2.967982,2.88159
364
+ NLE1,2.968525,2.8316575,2.960925,2.9966675,2.82634,2.7058850000000003
365
+ NLRP1,12.80871,12.689795,12.924380000000001,12.82027,12.82876,12.753060000000001
366
+ NMD3,4.813915,4.90968,5.04955,4.8353850000000005,4.968995,4.6819299999999995
367
+ NNMT,2.2281050000000002,2.1737675000000003,2.2412625,2.2060875,2.25312,2.15974
368
+ NOB1,3.574455,3.62367,3.556795,3.670315,3.60377,3.437745
369
+ NOG,0.899764,0.9099809999999999,0.8981709999999999,0.885266,0.8446149999999999,0.84329
370
+ NOLC1,2.458276666666667,2.4569366666666665,2.4327633333333334,2.4907966666666668,2.4059633333333332,2.3903133333333333
371
+ NOP58,2.96326,2.9104333333333336,2.8361650000000003,3.0891666666666664,2.9822316666666664,2.9541983333333333
372
+ NPB,2.5793575,2.5828025,2.5373,2.6760525,2.61759,2.454705
373
+ NPLOC4,2.391105,2.364035,2.36617,2.3955175,2.3562175,2.3471175
374
+ NR1I2,164.20789062617936,162.97124192704518,163.64807976409702,165.8377998654401,163.81420587978687,163.11264691000665
375
+ NSA2,13.315415,14.06198,14.01707,14.15863,13.91002,13.61492
376
+ NSUN5,16.378608,16.428922,16.1989405,17.089664,16.199856,15.867829
377
+ NT5C2,17.748542261904763,17.86553941017316,17.811037873376623,18.307123944805195,17.850830357142858,17.801260313852815
378
+ NTPCR,2.24061,2.31421,2.36571,2.3258,2.41856,2.286585
379
+ NUMB,2.910875,3.0779225,2.9740650000000004,3.0752125,2.720685,2.9697649999999998
380
+ OA3,16.729233333333333,17.51571,16.958576666666666,17.104626666666668,18.304706666666668,18.388286666666666
381
+ OSR1,5.654138333333333,5.690611666666666,5.666996666666666,5.606616666666667,5.612993333333334,5.7236183333333335
382
+ OXA1L,5.283623333333333,5.412166666666667,5.381873333333333,5.5061333333333335,5.51875,5.359616666666668
383
+ P4HB,2.820284,2.7539816666666663,2.74891,2.7718499999999997,2.6009453333333337,2.765357
384
+ PCBP4,5.811044833333334,5.7275715,5.7347323333333335,5.765602666666666,5.7901295,5.8290500000000005
385
+ PCNA,1.2544342857142858,1.2382528571428573,1.2415942857142857,1.286132857142857,1.311977142857143,1.2389057142857143
386
+ PCNT,3.014445,3.0854753333333336,3.0538835,2.8478951666666665,2.9472495,2.9543045
387
+ PCSK9,9.452560035714285,9.480050357142858,9.468317214285713,9.411018464285714,9.37929267857143,9.513635142857142
388
+ PDCD6IP,2.9979175,2.94408,2.77732,2.7838925000000003,2.7362175,2.632175
389
+ PDGFB,3.0625825,3.0697875,2.9109075,2.7097625,2.8738775,2.7238425
390
+ PDSS1,29.887604999999997,30.25614,30.52775,29.826729999999998,31.14312,31.70706
391
+ PDXP,6.6715599999999995,6.59052,6.62806,5.786105,5.654065,5.800975
392
+ PEBP1,11.530975,11.482895,11.063435,12.874514999999999,12.435315,12.800045
393
+ PGPEP1,9.87578,10.09679,9.908795,10.164845,10.476379999999999,10.724355
394
+ PHACTR1,15.106467,14.682768000000001,14.972615000000001,13.556518,14.593281000000001,14.473481
395
+ PHF5A,3.641805,3.63625,3.513765,3.707255,3.683765,3.14256
396
+ PHGDH,0.9395416666666666,0.93079,0.906075,0.9577183333333333,0.9291466666666667,0.9355950000000001
397
+ PIEZO1,18.383265,18.37348,18.059305,18.800145,18.8959,17.847355
398
+ PIF1,1.057005,1.0699575,1.00974,1.10035,1.0760375,1.0757475
399
+ PIGA,1.03449,1.0844475,1.0293325,0.900185,1.02779,1.04479
400
+ PIGP,2.88098,2.848875,2.858105,2.941135,2.942735,2.709995
401
+ PIGU,2.5098533333333335,2.5025333333333335,2.562656666666667,2.7045366666666664,2.73458,2.603006666666667
402
+ PIGW,2.27924,2.336185,2.44167,2.165485,2.501395,2.604625
403
+ PIGX,1.6155933333333332,1.5542966666666667,1.5520333333333334,1.6402400000000001,1.6229933333333333,1.5233466666666666
404
+ PIK3CG,5.358940357142857,5.184888321428572,5.266673309523809,5.215530880952381,5.283484476190476,5.270672642857143
405
+ PKD1,25.68656290499533,26.169060095938374,26.113221271008403,25.917830035480858,26.449167092903828,26.209801553454714
406
+ PKD2,25.68656290499533,26.169060095938374,26.113221271008403,25.917830035480858,26.449167092903828,26.209801553454714
407
+ PLAA,1.0690328571428571,1.0257757142857142,1.0418785714285714,1.0707771428571429,1.0348428571428572,1.0262514285714286
408
+ PLAC8,5.095065,5.339475,5.2198,4.900295,4.88218,5.2206
409
+ PLP1,9.479513333333333,9.704198333333334,9.610306666666666,9.163681666666667,8.994416666666666,9.27338
410
+ PLVAP,1.570005,1.55828,1.420195,1.593345,1.502365,1.647885
411
+ PMP22,11.23025,10.9892675,10.878455,10.5898275,10.6349675,10.207809999999998
412
+ PNMA3,27.30953166666667,27.462866666666667,26.880203333333334,27.21339,26.065964166666667,25.899116666666664
413
+ PNMT,2.2281050000000002,2.1737675000000003,2.2412625,2.2060875,2.25312,2.15974
414
+ POLR1G,1.9342499999999998,1.9279533333333332,1.7469000000000001,1.8744033333333334,1.8300966666666667,1.6257833333333334
415
+ POLR2F,3.900575,3.828115,3.90424,4.24093,4.09974,4.158795
416
+ POLR3K,1.4624739999999998,1.472974,1.40638,1.442446,1.431368,1.3897220000000001
417
+ POMC,0.612752,0.53478,0.548844,0.582334,0.608108,0.69889
418
+ POMP,3.609605,3.489515,3.700985,3.70691,3.782475,3.56165
419
+ POP1,1.178682,1.120762,0.952208,1.285294,1.15202,1.16472
420
+ POT1,3.141185,3.209405,3.09374,3.39908,3.133725,3.2506
421
+ POTEM,2.124035,2.157175,2.2303425,2.2238175,2.3558725,2.304635
422
+ PPP1R2,4.924555,5.269845,5.31963,5.032265000000001,5.17451,6.192285
423
+ PPY,2.5969885714285716,2.71671,2.6509314285714285,2.8495042857142856,2.7785642857142854,2.6972914285714285
424
+ PRB4,0.7485820000000001,0.75646,0.722584,0.73802,0.809938,0.76359
425
+ PRC1,3.4213299999999998,3.427776666666667,3.2959699999999996,3.351,3.537436666666667,3.288943333333333
426
+ PRCC,2.2872333333333335,2.314626666666667,2.2985266666666666,2.24361,2.2754333333333334,2.41939
427
+ PRELID1,6.0151055555555555,6.025668888888889,5.971708888888889,5.922997777777777,6.307235555555556,6.2038866666666665
428
+ PRKD1,12.46553320261438,12.327700274509805,12.944475235294117,12.531144130718953,12.930090640522875,12.931099732026144
429
+ PRM2,2.715865,2.803865,2.875175,2.762875,3.112235,2.921835
430
+ PRMT5,7.310456376984127,7.269327087301587,7.184312869047619,7.466445333333334,7.098264138888889,7.014346623015873
431
+ PRNT,2.161605,2.16616,2.066885,2.23247,2.15819,2.157885
432
+ PRPF4,3.6928608333333335,3.8788591666666665,3.6453691666666663,3.974244166666667,3.635506666666666,3.8064391666666664
433
+ PRPF8,0.5254949999999999,0.5219383333333334,0.5250194444444445,0.49715000000000004,0.4808983333333333,0.4910916666666667
434
+ PRRC2A,10.429093333333334,10.284236666666667,10.307063333333334,9.722986666666666,9.429293333333334,9.617763333333334
435
+ PRSS27,20.62311875,20.732979583333332,20.778225694444444,20.96664375,20.719297083333334,20.339385416666666
436
+ PSEN1,85.60995184280996,86.17645445752858,85.95209669853757,85.3390799197053,85.0896400231019,84.87700551913365
437
+ PSIP1,3.571085,3.5626875,3.5353450000000004,3.5471975000000002,3.4392075,3.2398249999999997
438
+ PSMD1,162.8940444025974,166.70694777453102,163.4745359491342,165.48155056168832,169.72999429329005,168.15098952705628
439
+ PSMD6,21.388021666666667,21.611296250000002,21.528678333333332,21.98209,21.570672916666666,21.04688541666667
440
+ PSME3IP1,2.1069325,2.0515775,2.1027375,2.0614225,2.06576,2.0124525
441
+ PSMF1,3.7864924999999996,3.7087108333333334,3.7119541666666667,3.8207758333333333,3.6782483333333333,3.6856333333333335
442
+ PTBP1,28.385073000000002,28.383469,28.713037333333332,27.954769333333335,27.724154666666667,28.365571
443
+ PTH2,4.041475,3.88292,3.916475,4.19562,3.80223,3.82581
444
+ PTK6,3.9347851767676767,3.8867602344877343,3.9291651911976913,3.7888307106782104,3.6249536904761905,3.739141782106782
445
+ PTPA,3.335465,3.23849,3.1987,3.441945,3.29845,3.354885
446
+ PTPRN,3.9513299999999996,4.24453,4.10093,3.47966,3.24891,3.5099166666666664
447
+ PXMP4,18.320845000000002,18.466775000000002,18.39606,18.769405,18.960175,17.98496
448
+ PYCARD,20.754321666666666,20.523854999999998,20.812356666666666,20.410025,20.120964166666667,20.110299166666664
449
+ QRFP,1.3917766666666667,1.4161033333333333,1.4171366666666667,1.4483466666666667,1.2772066666666666,1.6054933333333334
450
+ RABAC1,11.72965,11.840219999999999,11.862314999999999,12.0046,12.15621,11.77733
451
+ RASGRF1,30.44095275,30.374312166666666,29.993140662698412,30.07444521031746,29.70048915079365,30.267813988095238
452
+ RBBP4,6.916812,6.951058,6.8720445,6.9506995,6.955666,6.946842999999999
453
+ RCC1,32.94467922619047,32.57634307142857,31.98285807142857,32.39492675,31.272811023809524,30.492219083333335
454
+ REEP5,11.4945375,11.4397,11.4087575,11.1162,11.102535,11.1645725
455
+ REG1A,7.416367619047619,7.469547142857143,7.2612628571428575,7.338691428571429,7.4128066666666665,7.551481904761904
456
+ RELT,4.214416666666667,4.3816412499999995,4.283195,4.172845,4.068920833333333,3.838492083333333
457
+ RFC1,1.0220242857142856,0.9873571428571429,0.9518942857142857,0.9775128571428572,0.9350371428571428,0.9079342857142858
458
+ RFT1,2.78518,2.92077,2.88544,3.013085,2.989405,2.95766
459
+ RFX1,3.009432,3.0100659999999997,2.937954,3.0777460000000003,2.94544,2.89568
460
+ RGS6,20.1295415,19.730882166666667,19.818423833333334,19.3372475,18.846939666666668,18.820300666666668
461
+ RHO,6.739491666666667,6.581625833333334,6.684891666666667,6.736684166666667,7.064386666666667,6.9695599999999995
462
+ RIDA,3.933135,3.969925,3.50049,3.28385,3.332675,3.13838
463
+ RIGI,1.8582944444444442,1.824368,1.7755165555555554,1.477748,1.4468072222222224,1.434166888888889
464
+ RINT1,1.9158566666666665,1.9158,1.9287666666666665,2.08576,1.7894033333333335,1.9479866666666668
465
+ RIOK2,1.2230842857142858,1.2551314285714286,1.2421257142857143,1.3162857142857143,1.2854242857142857,1.2001314285714284
466
+ RLN2,4.252048,4.1527519999999996,4.082792,4.151716,4.249262,3.751519
467
+ RMND5A,3.3182582857142857,3.190127714285714,3.236122285714286,3.248931142857143,3.170064857142857,3.2475
468
+ RNF135,10.271048333333333,10.274658333333335,10.465776666666667,10.499673333333334,10.739345,9.940665000000001
469
+ RNF20,1.5149266666666668,1.5271233333333332,1.3823266666666667,1.5321300000000002,1.6476033333333333,1.5176066666666665
470
+ RNU1-1,2.236995,2.177335,2.19811,2.1594725,2.05101,2.0786825
471
+ RPL27,11.672808313131313,11.604639138888889,11.60859338888889,12.01566262121212,12.266354474747475,11.830405424242425
472
+ RPL28,4.788493333333333,4.897725,4.741405,4.772438333333334,5.035548333333333,4.8974899999999995
473
+ RPL29,12.061875,12.286415,13.31207,13.484705000000002,13.512975,12.62318
474
+ RPL34,3.576965,3.482525,3.475805,3.69501,3.588195,3.474295
475
+ RPL35,3.355015,3.43808,3.44858,3.542655,3.667175,3.28286
476
+ RPL35A,2.61962,2.74184,3.091635,2.759255,3.2071,3.02956
477
+ RPL36,4.07898,4.12575,4.25001,4.397905,4.075575,4.376025
478
+ RPL37,7.673585,7.680475,7.900313333333333,7.923363333333334,7.975161666666667,7.312188333333333
479
+ RPL41,35.48903833333333,35.746335,35.53919166666667,36.92210166666666,37.046685,36.00539166666667
480
+ RPLP0,9.577023333333333,9.572698333333333,9.819663333333335,10.02455,9.7984225,9.671356666666666
481
+ RPS11,7.0410200000000005,6.9117999999999995,7.199315,7.154515,7.1040399999999995,7.340695
482
+ RPS12,8.128820000000001,8.262573333333334,7.940796666666666,8.131446666666665,8.21401,8.132476666666667
483
+ RPS13,12.555459,13.225608000000001,14.265481000000001,12.793495,13.057403,12.475532000000001
484
+ RPS15,7.825260666666667,8.296303,8.695832666666666,8.009216666666665,8.615151333333333,7.656188666666667
485
+ RPS16,11.509076794871795,11.4159497008547,11.635525085470086,11.228621196581196,11.376772307692308,10.547807222222222
486
+ RPS17,8.53239,8.69276,8.491615,9.06174,8.85473,9.303995
487
+ RPS18,10.564185,10.164825,10.47439,10.251505,10.39041,9.760515
488
+ RPS19,2.4796666666666667,2.4296699999999998,2.5637666666666665,2.6492566666666666,3.0836033333333335,2.6588366666666667
489
+ RPS2,8.17094,8.25578,8.132375,8.48764,8.12727,8.230855
490
+ RPS21,2.826065,2.898675,2.906455,3.041435,3.19751,2.974225
491
+ RPS23,12.34248,12.508846666666667,12.288923333333333,12.47229,12.454556666666667,12.398313333333334
492
+ RPS24,7.184338333333333,7.430350833333334,7.337754166666667,7.108646666666667,7.454815,6.966503333333334
493
+ RPS25,5.829881666666667,6.0111799999999995,6.276565,6.071728333333334,6.484778333333334,5.960428333333334
494
+ RPS26,1.013895,1.0313533333333333,1.0469883333333334,1.0446133333333334,1.0433816666666667,0.9015399999999999
495
+ RPS27,10.171093333333333,9.913658333333334,9.7574,10.665071666666666,10.181026666666668,9.826255
496
+ RPS28,8.554325833333333,8.4393825,8.676866666666667,8.52579,8.497568333333334,7.7436825
497
+ RPS29,2.0688333333333335,2.052093333333333,2.1159066666666666,2.09268,1.9823133333333331,2.0066433333333333
498
+ RPS4Y1,7.770788333333334,7.653033333333333,7.972909166666667,8.149324166666666,7.768588333333334,7.727849583333334
499
+ RPS5,16.906572,17.039122,17.1922,17.75927,17.670856,17.233006
500
+ RPS6,140.08400295021644,143.86510984595958,140.88714113961038,141.7364170378788,146.45418062662338,145.6949384556277
501
+ RPS7,12.58965,12.78568,12.709925,12.761470000000001,12.667901666666667,12.507051666666666
502
+ RPS8,19.1541415,18.271775833333333,18.429327833333332,18.3498885,17.314497833333334,17.684769333333335
503
+ RPS9,41.207433,41.24197708333333,40.96879391666667,42.58235466666667,41.78503741666667,40.30691158333333
504
+ RRM2,4.002785,4.007755,3.98906,4.344465,4.10775,4.26552
505
+ RRN3,4.02188,4.012385,4.032425,4.08146,4.0849,3.949205
506
+ RSAD2,15.836018333333334,15.597880833333333,15.445697666666666,15.520874,14.756187,15.8188895
507
+ RSL24D1,8.7924325,9.261865,9.56136,9.5709975,9.59615,9.1518575
508
+ RTEL1,12.640311380952381,12.728314523809525,12.636050174603174,12.87646819047619,12.628165047619047,12.833922000000001
509
+ RUVBL1,4.342662619047619,4.35804261904762,4.296090952380952,4.493615952380953,4.319688571428571,4.265996666666666
510
+ S100A9,3.487766666666667,3.504106,3.5726579999999997,3.698004,3.8024953333333333,3.372603333333333
511
+ S100B,48.8343075,49.7423,50.761375,51.37636,53.31913,51.533625
512
+ SARAF,3.7445266666666663,3.7996533333333335,4.062883333333334,3.6193600000000004,3.5596,3.6547799999999997
513
+ SBDS,1.544918,1.55729,1.5676539999999999,1.5935380000000001,1.613972,1.55161
514
+ SCAMP1,19.842802499999998,20.1051275,19.83419,20.2969975,19.885092500000003,19.8148625
515
+ SCGB1D4,11.648759666666667,11.718760571428572,11.71721780952381,11.72262280952381,11.614275809523809,11.306170999999999
516
+ SCO1,2.528242380952381,2.440134761904762,2.5012038095238096,2.5797395238095238,2.5308914285714286,2.6077709523809522
517
+ SCP2,7.528149285714286,7.697582142857143,7.85885,7.283837857142857,8.032666428571428,7.7726307142857145
518
+ SCYL1,5.795315,5.821035,5.742195,6.259455,6.092585,6.166215
519
+ SDAD1,1.403618,1.393956,1.359154,1.345488,1.2707000000000002,1.23803
520
+ SEA,17.770712190836942,17.841207634559883,17.888258080808082,17.372981190836942,18.0816610508658,18.609331795815297
521
+ SEC14L2,2.114035714285714,2.0973757142857146,2.0821014285714283,2.148705714285714,2.176577142857143,2.2211185714285713
522
+ SEM1,2.74471,2.83268,2.8747566666666664,2.9555900000000004,3.009183333333333,2.844246666666667
523
+ SEMA4D,43.016244666666665,42.45800144047619,42.39249480952381,40.407398095238094,40.411316880952384,41.01194838095238
524
+ SEPTIN4,15.317665773809523,15.309940059523809,15.472316904761906,16.802262678571427,16.729950833333334,16.876750476190477
525
+ SEPTIN9,6.0151055555555555,6.025668888888889,5.971708888888889,5.922997777777777,6.307235555555556,6.2038866666666665
526
+ SERPINA5,52.07867066666667,51.925715833333335,51.6747425,52.82645983333333,51.853724166666666,50.39689583333333
527
+ SESN1,10.46956,9.90015,10.117455,10.14095,9.688075000000001,9.16325
528
+ SET,63.221860834776336,62.909268704184704,62.48546655988456,61.86977865151515,60.31270036363637,61.077330344877346
529
+ SETD2,2.0133328571428573,1.9625957142857144,1.9498757142857142,1.8768500000000001,1.7989614285714286,1.9017357142857143
530
+ SGCG,14.756329833333332,14.73463830952381,14.763557869047618,14.577044107142857,14.718595738095237,14.70478486904762
531
+ SGF29,5.37716,5.431570000000001,5.2472900000000005,5.481475,5.359959999999999,5.0375700000000005
532
+ SGSM3,6.404686666666667,6.579656666666667,6.434686666666667,6.490963333333333,6.612078333333333,6.64329
533
+ SH2D1A,35.19873871428572,34.21108191269841,34.24141831349206,35.187573972222225,33.81007436904762,34.223576400793654
534
+ SH3BP5,2.578570833333333,2.5003866666666665,2.4790183333333333,2.4895975000000004,2.4571275,2.4906658333333334
535
+ SHD,2.820284,2.7539816666666663,2.74891,2.7718499999999997,2.6009453333333337,2.765357
536
+ SHQ1,2.6319,2.757165,2.66196,2.774015,2.59324,2.167975
537
+ SINHCAF,11.6032,11.844235,11.751190000000001,12.219289999999999,12.124105,11.634609999999999
538
+ SKI,3.48262625,3.4871670833333335,3.4558035416666666,3.5258456249999997,3.4293552083333334,3.420334791666667
539
+ SKP1,4.2515825,4.228725833333334,4.4973125,4.601751666666667,4.643860833333333,4.283986666666667
540
+ SLC25A1,2.5110133333333335,2.51554,2.506675,2.4114233333333335,2.2681233333333335,2.24795
541
+ SLC25A5,8.771889999999999,8.645855,8.85315,8.774735,8.7577,7.812045
542
+ SLC2A1,1.2874057142857143,1.2939528571428571,1.2782714285714287,1.3304742857142855,1.2982214285714286,1.30597
543
+ SLC2A4,1.3520379999999999,1.312856,1.356902,1.3701539999999999,1.324446,1.429602
544
+ SLC36A1,3.686703333333333,3.6106933333333338,3.7091899999999995,3.5735433333333333,3.5610633333333332,3.793476666666667
545
+ SLC4A1,6.879584666666667,6.931601833333334,6.939045,6.993113666666667,6.918675666666667,6.963713333333333
546
+ SLCO1A2,16.796414166666665,16.395720833333332,16.269856666666666,15.636038333333333,15.695324166666666,16.046060833333332
547
+ SLCO1B1,1.323165,1.147595,1.17446,1.223305,1.367135,1.164435
548
+ SMARCA5,0.6230226666666667,0.6306926666666667,0.6090926666666667,0.615054,0.5936686666666666,0.5981793333333334
549
+ SMARCB1,1.9378874999999998,1.94937,1.9189875,1.9877200000000002,1.9149125,1.96429
550
+ SMPD1,0.72803,0.72491375,0.72641125,0.69008125,0.6459725,0.6750125
551
+ SNAP25,4.40758,4.65477,4.3111825,4.460515,4.5704674999999995,4.3541525
552
+ SNAPC1,2.7978,2.51786,2.89323,3.03421,2.689125,3.10119
553
+ SNF8,4.738569999999999,4.636935,4.6220175,5.0913775,5.0539375,4.8671225
554
+ SNHG32,6.581754,6.739975857142857,6.413034714285714,6.333468714285714,6.281345571428571,6.535708714285715
555
+ SNORA73A,4.5382425,4.701383333333334,4.699371666666666,4.645035833333333,4.5535375,4.5707125
556
+ SNORD12C,16.184930595238097,16.070532023809523,16.203426904761905,16.073475535714287,15.850699523809524,15.458408452380953
557
+ SNORD3F,4.472888333333334,4.45717,4.409083333333333,4.498943333333333,4.422663333333333,4.215793333333333
558
+ SNRPN,2.98439,2.885915,2.950735,3.005065,2.861515,2.91558
559
+ SOAT1,5.940810793650794,5.938316031746032,5.873953031746032,5.637714984126984,5.380174142857143,5.692538126984127
560
+ SPAG11A,1.1286966666666667,1.0460666666666667,1.1278166666666667,1.0719266666666667,1.1121266666666667,1.0404066666666667
561
+ SPARC,14.741834404761905,15.010482261904762,14.935683214285714,14.076252738095238,14.823584880952382,14.772292023809523
562
+ SPHKAP,1.940875,1.9211025,1.912175,1.95425,1.837145,1.8611125
563
+ SPRR1B,8.71451,8.47837,8.2690075,8.789982499999999,9.12124,8.647300000000001
564
+ SPTY2D1,3.41156,3.411465,3.379675,3.436005,3.358885,3.34913
565
+ SPX,1.2348866666666667,1.2418633333333333,1.2537266666666667,1.2212966666666667,1.1751566666666666,1.1553666666666667
566
+ SRFBP1,3.05495,3.134605,3.07944,3.339045,3.174245,3.052615
567
+ SRI,1.0687614285714286,1.0683914285714287,1.04562,0.9966042857142857,0.9515428571428571,1.0222442857142857
568
+ SRP14,3.364235,3.35982,3.41252,3.46492,3.59976,3.23826
569
+ SRP19,2.850935,2.99968,3.047625,2.972715,2.961015,2.9174
570
+ SRP54,8.139055714285714,8.13033857142857,8.247697142857144,8.38621,7.880532857142857,8.178757142857142
571
+ SRP72,3.2568099999999998,3.282826666666667,3.2288933333333336,3.365766666666667,3.281053333333333,3.2788566666666665
572
+ SRP9,2.702815,2.61087,2.78105,2.9459,2.982235,2.91978
573
+ SRPRA,2.580096666666667,2.546518333333333,2.55864,2.5722883333333333,2.5167716666666666,2.432516666666667
574
+ SS18,9.19728,9.327605,9.268075,9.560565,9.461005,8.728305
575
+ SSBP3,6.196203333333333,6.148493333333334,6.29145,6.288743333333334,6.07198,6.034800000000001
576
+ SSRP1,1.5130458333333334,1.505395,1.4669273333333335,1.5171918333333334,1.458608,1.4840713333333333
577
+ ST6GALNAC4,36.09623749417249,36.08859851107226,35.711407753885005,34.10941357342657,33.909733824592074,33.755058483100235
578
+ ST7,4.89143,4.90142,4.959225,5.214510000000001,5.42207,4.917455
579
+ STAT5A,4.117476666666667,4.147943333333333,3.8375266666666668,4.05483,3.9385000000000003,4.6529300000000005
580
+ STN1,1.0636183333333333,1.0638666666666667,1.0672650000000001,1.1223083333333335,1.1217483333333333,1.1396066666666667
581
+ STT3A,20.36672,20.57565,20.467865,20.72236,20.85929,20.824465
582
+ SUPT20H,7.63702,8.011785,7.9603649999999995,7.364965,7.076585,7.43753
583
+ SYF2,3.558955,3.668665,3.526195,3.571425,3.65585,3.365285
584
+ TAF4,2.2342583333333335,2.190045,2.237293333333333,2.1086066666666667,2.004828333333333,2.0567183333333334
585
+ TAF7,4.8160799999999995,4.706315,4.843085,5.08444,5.174225,5.1987
586
+ TAF8,129.41201209072872,129.0741608169192,128.47352661778498,130.3688585196609,128.8963513612915,127.89500519751083
587
+ TAF9,1.9896191666666667,1.8392975,1.8824966666666667,2.0483741666666666,2.21615,2.0644441666666666
588
+ TAFA2,6.86348,7.616505,7.08034,7.587655,7.751785,7.56513
589
+ TAX1BP3,1.9158566666666665,1.9158,1.9287666666666665,2.08576,1.7894033333333335,1.9479866666666668
590
+ TBC1D1,89.14798621428571,87.58115585714286,88.39079830952382,87.34245666666666,83.91985261904762,85.38084471428571
591
+ TBCC,2.626175,2.70728,2.74551,2.93051,3.0027049999999997,2.952935
592
+ TBP,15.511703166666667,15.532419,15.698669833333334,15.800172,15.197137833333333,15.234765
593
+ TCL1A,7.202313333333333,6.922503333333333,7.370866666666666,6.854655833333334,7.549553333333333,7.2701641666666665
594
+ TEP1,0.8267014285714286,0.8186171428571428,0.821417142857143,0.8156714285714285,0.7552342857142857,0.7558842857142858
595
+ TEX11,2.5073125000000003,2.52695,2.581375,2.5326275000000003,2.5845525,2.38481
596
+ TFAP2A,5.48729,5.507393333333333,5.712973333333333,6.287610000000001,6.25856,6.866806666666667
597
+ THBD,4.2598416666666665,4.010945833333333,4.209084166666666,4.003144166666667,3.7549925,3.860819166666667
598
+ THOC1,1.7713975,1.79874,1.8054125,1.851585,1.794285,1.73114
599
+ TIMP1,15.51166756060606,15.633244575757576,15.43321356060606,14.733549393939395,15.746574348484849,15.151570575757576
600
+ TMED7-TICAM2,25.952505333333335,26.001819583333333,25.863608083333332,26.604989333333332,26.657323833333333,26.089304333333335
601
+ TMEM131,4.858166666666667,4.776526666666667,4.817253333333333,4.859686666666667,4.608966666666666,4.729253333333333
602
+ TMEM144,1.5447225,1.4220225,1.420665,1.36005,1.2667575,1.2912675
603
+ TMEM175,1.6572133333333332,1.7142066666666667,1.7500799999999999,2.0527866666666665,1.8696266666666668,1.9558866666666666
604
+ TMEM19,2.2084966666666666,2.18499,2.2211433333333335,2.5066466666666667,2.3329733333333333,2.4351566666666664
605
+ TMEM208,2.21128,2.2571766666666666,2.2536133333333335,2.259863333333333,2.2867933333333332,2.0630366666666666
606
+ TMEM214,2.76984,2.83154,2.7772733333333335,2.915366666666667,2.7731766666666666,2.8346
607
+ TMEM53,1.3928633333333333,1.46286,1.4918966666666666,1.5369266666666668,1.4785733333333333,1.5287233333333334
608
+ TMEM59,6.977650000000001,6.631275,6.923125,6.345314999999999,6.36144,6.421215
609
+ TMEM70,2.35894,2.30695,2.4181433333333335,2.5464966666666666,2.524973333333333,2.32713
610
+ TMEM9,5.9806799999999996,6.187329999999999,6.14667,6.7195149999999995,6.4327950000000005,6.388045
611
+ TMPRSS11D,6.2825575,6.202863333333333,6.337758333333333,6.405805833333333,6.423115833333333,6.354877500000001
612
+ TMX2-CTNND1,4.885379047619048,4.861329761904761,4.923499761904762,5.012005476190476,5.012710714285714,4.946782619047619
613
+ TNF,4.214416666666667,4.3816412499999995,4.283195,4.172845,4.068920833333333,3.838492083333333
614
+ TNFAIP1,10.63680875,10.483408333333333,10.543941666666667,10.531341666666666,10.349628333333333,10.27385375
615
+ TNFRSF13B,1.285345,1.523285,1.346275,1.325245,1.39195,1.50956
616
+ TNFRSF17,1.1196333333333335,1.0313266666666667,1.0681,1.04118,1.1712666666666667,0.9811899999999999
617
+ TNFSF13B,3.4231033333333336,3.3985516666666666,3.5774999999999997,3.488715,3.5825766666666663,3.556635
618
+ TPD52,10.753645,10.924735,10.68741,10.95645,10.74219,11.003834999999999
619
+ TPMT,3.4973566666666667,3.450301666666667,3.479791666666667,3.681973333333333,3.4565133333333335,3.441456666666667
620
+ TPR,3.15648,3.06641,2.82659,3.3568,3.15467,3.028005
621
+ TPRKB,2.67361,2.667305,2.728735,2.672205,2.64482,2.34062
622
+ TRADD,1.427935,1.45474,1.463675,1.5716475,1.47671,1.40225
623
+ TRAF3,1.7411033333333332,1.6726133333333333,1.7186766666666669,1.6618899999999999,1.6218866666666667,1.5658966666666665
624
+ TRIO,5.555918888888889,5.481902222222223,5.4137788888888885,5.594657777777778,5.534227222222222,5.4485
625
+ TRIP10,26.382330833333334,26.45637175,26.217182833333332,26.6261205,26.28195716666667,27.23802925
626
+ TRIT1,28.777251523809525,28.275372186507937,28.697162095238095,27.331821634920637,27.45530926984127,27.788246666666666
627
+ TRMT61A,2.81761,2.584145,2.8158,2.707155,2.609365,2.228935
628
+ TSG101,2.9979175,2.94408,2.77732,2.7838925000000003,2.7362175,2.632175
629
+ TSR1,2.35942125,2.34054625,2.3192025,2.39044,2.3380825,2.2392149999999997
630
+ TSR2,2.94428,2.6648,2.722825,2.839965,2.871025,2.618015
631
+ TTR,1.0636183333333333,1.0638666666666667,1.0672650000000001,1.1223083333333335,1.1217483333333333,1.1396066666666667
632
+ UBA52,2.1065733333333334,2.11194,2.0719600000000002,2.0902333333333334,2.2225733333333335,2.16858
633
+ UBE4B,11.246716666666668,11.0502,11.241436666666667,10.904833333333332,10.680323333333334,10.717106666666666
634
+ UBR5,1.013815,1.00301,1.0308775,0.96066125,0.9345475,0.9679175
635
+ UFD1,3.750455,3.712035,3.7191,4.10718,4.03069,4.142325
636
+ UPF1,1.8504775,1.784875,1.783305,1.7379275,1.5506325,1.67919
637
+ UPF3A,6.195069999999999,5.955439999999999,6.09753,6.118995,5.913,5.76837
638
+ UQCC2,5.47402,5.525755,5.66026,5.418855,5.78892,5.93452
639
+ USP8,1.38281,1.3383,1.36269,1.3736033333333333,1.3355249999999999,1.3182983333333333
640
+ VASP,5.4027449999999995,5.312675,5.329885,5.3104875,5.2290399999999995,5.2028
641
+ VCP,2.0370329807692307,1.9884766346153846,1.997474903846154,2.0093694230769232,1.9611808653846154,1.9663122115384615
642
+ VIM2P,0.96785,0.95557,0.970444,1.003026,0.98124,1.014662
643
+ VIP,7.4589566666666665,7.0103800000000005,7.00216,7.239356666666667,7.25547,7.412176666666666
644
+ VIT,8.829219166666666,9.015043833333333,9.090981166666667,8.750744833333334,8.987721916666667,9.067759666666666
645
+ VPS28,4.538275,4.62564,4.558625,4.648985,4.72923,4.63798
646
+ VPS72,3.637244166666667,3.7185249999999996,3.5947674999999997,3.734960833333333,3.6252825,3.641120833333334
647
+ WASHC3,2.1182833333333333,2.19564,2.2398866666666666,2.32986,2.3290266666666666,2.139063333333333
648
+ WDR46,1.780902,1.7995899999999998,1.7241399999999998,1.7971119999999998,1.7106940000000002,1.678126
649
+ WLS,12.025027,11.934632,11.746953,12.603399,12.46904,11.961045
650
+ XK,15.475155,14.790425,14.747645,14.963165,15.506,13.485495
651
+ XPA,1.4523,1.460225,1.35996,1.43229,1.30438,1.317125
652
+ XPNPEP1,1.8218865,1.757775,1.7308135,1.78368125,1.74514925,1.7763852500000001
653
+ XPO1,1.2963850000000001,1.2608916666666665,1.25522,1.3426716666666667,1.2794416666666668,1.297885
654
+ XRCC4,1.4858733333333334,1.5692866666666667,1.55418,1.6651366666666665,1.8248499999999999,1.7040333333333333
655
+ ZACN,4.004425,3.99081,3.9934225,4.011207499999999,4.11171,3.8743774999999996
656
+ ZBTB12,3.149925,3.126785,3.060105,3.350365,3.14989,3.07722
657
+ ZC3HC1,13.963148333333333,13.858705,13.895743333333334,14.584119999999999,14.398996666666665,14.250734999999999
658
+ ZNF330,6.742315,6.64903,6.664075,6.54749,6.579845000000001,6.401865
659
+ ZNF469,1.1423320000000001,1.203262,1.13107,1.222996,1.24674,1.0988580000000001
660
+ ZNF787,2.364754,2.334582,2.35386,2.18823,2.253952,2.256302
p1/preprocess/Pancreatic_Cancer/gene_data/GSE125158.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Pancreatic_Cancer/gene_data/GSE130563.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ Gene,GSM3743555,GSM3743556,GSM3743557,GSM3743558,GSM3743559,GSM3743560,GSM3743561,GSM3743562,GSM3743563,GSM3743564,GSM3743565,GSM3743566,GSM3743567,GSM3743568,GSM3743569,GSM3743570,GSM3743571,GSM3743572,GSM3743573,GSM3743574,GSM3743575,GSM3743576,GSM3743577,GSM3743578,GSM3743579,GSM3743580,GSM3743581,GSM3743582,GSM3743583,GSM3743584,GSM3743585,GSM3743586,GSM3743587,GSM3743588,GSM3743589,GSM3743590,GSM3743591,GSM3743592,GSM3743593,GSM3743594,GSM3743595,GSM3743596,GSM3743597,GSM3743598,GSM3743599,GSM3743600
p1/preprocess/Pancreatic_Cancer/gene_data/GSE131027.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8582008fe6fc5b90879aea7d12ca4ea58cc0bbe03209acb333425d229be6e33
3
+ size 24379939
p1/preprocess/Pancreatic_Cancer/gene_data/GSE157494.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Pancreatic_Cancer/gene_data/GSE222788.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ ID,GSM6932288,GSM6932289,GSM6932290,GSM6932291,GSM6932292,GSM6932293,GSM6932294,GSM6932295,GSM6932296,GSM6932297,GSM6932298,GSM6932299,GSM6932300,GSM6932301,GSM6932302,GSM6932303,GSM6932304,GSM6932305,GSM6932306,GSM6932307,GSM6932308,GSM6932309,GSM6932310,GSM6932311,GSM6932312,GSM6932313,GSM6932314,GSM6932315,GSM6932316,GSM6932317,GSM6932318,GSM6932319,GSM6932320,GSM6932321,GSM6932322,GSM6932323,GSM6932324,GSM6932325,GSM6932326,GSM6932327,GSM6932328
p1/preprocess/Pancreatic_Cancer/gene_data/GSE223409.csv ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Gene,GSM6947318,GSM6947319,GSM6947320,GSM6947321,GSM6947322,GSM6947323,GSM6947324,GSM6947325,GSM6947326,GSM6947327,GSM6947328,GSM6947329,GSM6947330,GSM6947331,GSM6947332
2
+ ATP8,5.08333129,4.995270496,5.878991576,5.278847404,5.147282029,5.184992274,5.177250704,5.214208934,5.307577377,5.158350884,5.136567982,5.156021736,5.094846468,5.119166046,5.111951433
3
+ C2,6.932202533,7.00409574,6.685623747,6.253716152,7.043147902,6.717368469,6.601205721,5.302941209,7.560956746,7.404546689,7.508906662,6.849514186,7.457255328,7.140690127,7.301056262
4
+ C3,82.923412736,82.219319082,81.527160087,86.426853536,81.25175813,82.348485564,81.632498508,86.845028381,82.578840543,81.5797836,85.409731826,83.626756187,84.10001301,81.844826684,84.549439387
5
+ C6,6.031168316,6.560885551,6.153464952,7.023069695,6.147464217,6.263726183,5.500629565,6.615263085,5.87747682,6.20379668,5.707920914,5.674820508,5.652128196,5.671730173,5.627313075
6
+ C7,5.601838095,5.559570656,5.544928216,5.371170165,5.547193378,5.432397404,5.347669731,6.3040909,5.487236038,5.075915602,5.495723812,5.972728223,5.76539329,5.891930472,5.730168472
7
+ C9,6.680131928,6.730965658,5.691345534,6.139807563,6.719725737,5.801912666,6.04693282,6.847250277,6.000680776,9.555979423,6.028478347,5.277118052,5.899907228,5.302645308,5.578003173
8
+ COX1,5.562108978,5.549636625,5.502372264,5.554580339,5.357625451,5.507572015,5.570158573,5.770207038,5.732624149,6.742345648,5.307578543,5.645194313,5.772449608,5.570477736,5.444661734
9
+ COX2,5.762639717,6.345996031,6.017741248,7.225911561,6.061305877,5.96196413,5.529981716,6.826250215,5.657664012,5.419817831,5.528681569,5.188729645,5.837471901,5.36966004,5.509259252
10
+ COX3,6.086194268,6.12065171,5.734138715,5.899270671,6.242045949,6.129525356,5.54154792,5.671389549,5.220330587,8.167529947,7.616483989,5.442540922,5.278378212,5.839203637,7.49913252
11
+ CYTB,5.401357876,5.742728474,5.19578563,5.591287916,5.187813134,5.291329061,5.510669649,5.183075588,6.019342545,5.994250072,5.927814506,5.502392368,5.839377237,5.680161266,5.84986107
12
+ F10,17.111854633,16.985364665,17.350760646,16.425721852000002,16.827659713,18.053473554,17.557622607,16.371708167,17.895019102,17.095571828,17.306008194,17.508499662,17.657683956,17.506432629,17.93082486
13
+ F11,5.468122426,5.551077544,5.553018488,6.086124206,5.520766107,5.36509829,5.324559898,5.916682262,5.917235818,5.416901902,5.798794333,5.611854144,5.542868981,5.666141413,5.565842255
14
+ F12,10.65586448,10.58254259,10.41292603,15.11493114,10.54808899,10.39473845,10.47643671,15.02376154,15.94396266,12.50719116,15.96328882,13.35626484,15.43301502,15.02376154,15.4513498
15
+ F2,5.311172654,5.197134084,5.507652985,5.840615401,5.436878011,5.68872014,5.927551379,6.133342526,5.353788093,5.276904205,5.536602305,5.311931782,5.310654949,5.255664695,5.167316389
16
+ F3,11.579617638,11.56774099,12.232279113,11.777360425000001,11.596407202,11.781527079,11.688725613999999,11.343068685,11.232325082,10.582544691999999,11.185316751,11.408457426,11.181269417,11.391221232,10.87557293
17
+ F5,10.791303805,10.604677554,11.018081218999999,10.752904069,10.728748126,10.586417276999999,10.755403115,11.588942561,11.390751662,11.726789722,11.172797858,10.931854839,11.261369157,11.404024691,12.694728555
18
+ F7,14.134706249,14.625787255999999,16.250175114,14.622420058,14.036179668,16.073009177,15.596579005999999,15.142107181,16.136150473999997,12.701261912,15.876005334999999,15.227876796,15.761324726000002,15.548284236,15.731490938
19
+ F8,14.127142917,14.066583925,14.435968785,13.136497258999999,13.900700234,14.444526119999999,14.428458783,13.745339189,14.803982437,12.152041161,13.930640999,12.877813056,14.100119868,13.549834582999999,14.309518586
20
+ F9,5.962970565,5.851378981,6.0671641,6.931453123,5.465684504,5.702580587,5.841051572,5.770207038,5.451864282,6.28428403,5.502986192,5.522699113,5.697136051,5.669585097,5.698610841
21
+ H19,5.154323573,5.410132393,5.074579676,5.01591539,5.349375918,5.176949214,5.371043001,5.188180742,5.968634994,5.574577967,6.513141136,5.364104765,5.819560062,5.37932335,5.503875401
22
+ HM13,28.639699299,28.812237478,30.604053194,28.495419107,28.941505547,30.179968739000003,30.074829634,28.402087779,31.60442217,35.926576369,31.54562186,29.979588012,31.062201547999997,30.797706709,31.158067085
23
+ IGSF3,5.627926478,5.525529882,5.33755183,6.421190932,5.529218595,5.292264924,5.573250115,6.204559459,5.212106264,5.397609209,5.450943642,5.336189693,5.269452575,5.419899251,5.269649527
24
+ MOSMO,16.78803022,17.501790446,17.345795137,16.087720171,17.116659121,17.378878685,17.055269944,17.095573338,16.582872154,19.338209362,16.540366347,16.399815496000002,16.390161781,16.764737286,16.279824003999998
25
+ ND1,5.736143475,5.405916038,5.478359079,5.53467534,5.28578733,5.677028298,5.826396812,5.219998835,5.306763348,6.00018122,5.294361126,5.536632546,5.385865805,5.555023539,5.696553148
26
+ ND2,9.669692089,9.664250811,9.091069011,9.539529947,9.636597144,9.104223857,9.117317179,9.515878561,9.827453754,6.331441517,9.802525197,10.78890376,9.908519881,10.5059265,9.964232457
27
+ ND3,5.586571951,5.650260054,5.578399654,6.497748976,5.824029687,5.789249386,5.756455847,6.540513264,5.498498509,5.385102689,8.328243341,5.352080514,7.672773419,7.40781331,7.897730955
28
+ ND4,5.477472953,5.479880309,5.844807917,6.390381986,5.408138133,5.430653238,5.948226078,6.582326866,5.120347682,5.312807776,5.321364985,5.757332854,5.367511845,5.279365083,5.336835744
29
+ ND4L,6.363882149,5.790265625,5.309574819,5.232456872,5.209448583,5.449838266,5.15775119,5.1230963,6.306985108,5.355195532,5.921364283,5.43146745,5.341171429,5.465351774,5.096586459
30
+ ND5,5.16240183,5.265258849,5.185675019,5.255153815,5.175460289,5.345099805,5.041990818,5.541220588,5.37173107,6.112116488,5.932141949,5.269967116,5.108733026,5.360135059,5.643807493
31
+ SLC25A5,5.349596602,5.256994446,5.499266759,5.527136432,5.465417157,5.682002567,5.338636905,5.020689019,5.636168928,6.398387222,5.384862637,5.690842252,5.514930006,5.265042224,5.480202488
32
+ SUGCT,11.671516145,11.566628575,11.669612755,12.026656006,11.740035038999999,11.3975522,11.595854446,12.181105044,11.12424569,10.624329102,11.215030698,10.903320299,11.210866201,11.254982177999999,11.298469204
33
+ TRGV9,6.033018689,6.098020654,5.875969085,6.10947575,6.116552796,6.104734367,6.048524147,5.555091477,9.081140382,8.422075051,9.164142599,7.575444748,8.691853051,7.957181224,8.542367628
p1/preprocess/Pancreatic_Cancer/gene_data/GSE236951.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Parkinsons_Disease/GSE103099.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f38e052202820dfe20473732d190862071a10329a3d0451829e9ca65df1c9a73
3
+ size 12965283
p1/preprocess/Parkinsons_Disease/GSE202665.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46f9672f37d52e2560fa5fa0e4291af55a1f4cc41e1672ff8b415057a0b9b147
3
+ size 21295030
p1/preprocess/Parkinsons_Disease/GSE202667.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd5b6ed959bff07239f47079211fd1ad923f1e554a507f4b06b65ce7adadc40d
3
+ size 19381245
p1/preprocess/Parkinsons_Disease/GSE49126.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Parkinsons_Disease/GSE57475.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60c7b09cc1548f415895b7a7e49ffb9dd1c3cc6ed3f827b1d0b6de459c7cfc9a
3
+ size 25885275
p1/preprocess/Parkinsons_Disease/GSE72267.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Parkinsons_Disease/clinical_data/GSE101534.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ GSM2705776,GSM2705777,GSM2705778,GSM2705779,GSM2705780,GSM2705781,GSM2705782,GSM2705783,GSM2705784,GSM2705785,GSM2705786,GSM2705787,GSM2705788,GSM2705789,GSM2705790,GSM2705791,GSM2705792,GSM2705793,GSM2705794,GSM2705795,GSM2705796,GSM2705797,GSM2705798,GSM2705799,GSM2705800,GSM2705801,GSM2705802,GSM2705803,GSM2705804,GSM2705805,GSM2705806,GSM2705807,GSM2705808,GSM2705809,GSM2705810,GSM2705811,GSM2705812,GSM2705813,GSM2705814,GSM2705815,GSM2705816,GSM2705817,GSM2705818,GSM2705819,GSM2705820,GSM2705821,GSM2705822,GSM2705823,GSM2705824,GSM2705825,GSM2705826
2
+ 0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.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,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0
p1/preprocess/Parkinsons_Disease/clinical_data/GSE103099.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ GSM2742123,GSM2742124,GSM2742125,GSM2742126,GSM2742127,GSM2742128,GSM2742129,GSM2742130,GSM2742131,GSM2742132,GSM2742133,GSM2742134,GSM2742135,GSM2742136,GSM2742137,GSM2742138,GSM2742139,GSM2742140,GSM2742141,GSM2742142,GSM2743405,GSM2743406,GSM2743407,GSM2743408,GSM2743409,GSM2743410,GSM2743411,GSM2743412,GSM2743413,GSM2743414,GSM2743415,GSM2743416,GSM2743417,GSM2743418,GSM2743419,GSM2743420,GSM2743421,GSM2743422,GSM2743423,GSM2743424,GSM2743425,GSM2743426,GSM2743427,GSM2743428,GSM2743429,GSM2743430,GSM2743431,GSM2743432,GSM2743433,GSM2743434,GSM2743435,GSM2743436,GSM2743437,GSM2743438,GSM2743439,GSM2743440,GSM2743441,GSM2743442,GSM2743443
2
+ 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,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,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
p1/preprocess/Parkinsons_Disease/clinical_data/GSE202665.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ GSM6128044,GSM6128045,GSM6128046,GSM6128047,GSM6128048,GSM6128049,GSM6128050,GSM6128051,GSM6128052,GSM6128053,GSM6128054,GSM6128055,GSM6128056,GSM6128057,GSM6128058,GSM6128059,GSM6128060,GSM6128061,GSM6128062,GSM6128063,GSM6128064,GSM6128065,GSM6128066,GSM6128067,GSM6128068,GSM6128069,GSM6128070,GSM6128071,GSM6128072,GSM6128073,GSM6128074,GSM6128075,GSM6128076,GSM6128077,GSM6128078,GSM6128079,GSM6128080,GSM6128081,GSM6128082,GSM6128083,GSM6128084,GSM6128085,GSM6128086,GSM6128087,GSM6128088,GSM6128089,GSM6128090,GSM6128091,GSM6128092,GSM6128093,GSM6128094,GSM6128095,GSM6128096,GSM6128097,GSM6128098,GSM6128099,GSM6128100,GSM6128101,GSM6128102
2
+ 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,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,0.0,0.0,0.0,0.0,0.0
3
+ 53.0,53.0,53.0,53.0,53.0,53.0,57.0,57.0,57.0,57.0,57.0,63.0,63.0,63.0,63.0,63.0,63.0,75.0,75.0,75.0,75.0,75.0,75.0,85.0,85.0,85.0,85.0,85.0,85.0,76.0,76.0,76.0,76.0,76.0,76.0,63.0,63.0,63.0,63.0,63.0,63.0,69.0,69.0,69.0,69.0,69.0,69.0,66.0,66.0,66.0,66.0,66.0,66.0,53.0,53.0,53.0,53.0,53.0,53.0
p1/preprocess/Parkinsons_Disease/clinical_data/GSE202667.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ GSM6128103,GSM6128104,GSM6128105,GSM6128106,GSM6128107,GSM6128108,GSM6128109,GSM6128110,GSM6128111,GSM6128112,GSM6128113,GSM6128114,GSM6128115,GSM6128116,GSM6128117,GSM6128118,GSM6128119,GSM6128120,GSM6128121,GSM6128122,GSM6128123,GSM6128124,GSM6128125,GSM6128126,GSM6128127,GSM6128128,GSM6128129,GSM6128130,GSM6128131,GSM6128132,GSM6128133,GSM6128134,GSM6128135,GSM6128136,GSM6128137,GSM6128138,GSM6128139,GSM6128140,GSM6128141,GSM6128142,GSM6128143,GSM6128144,GSM6128145,GSM6128146,GSM6128147,GSM6128148,GSM6128149,GSM6128150,GSM6128151,GSM6128152,GSM6128153,GSM6128154,GSM6128155,GSM6128156,GSM6128157,GSM6128158,GSM6128159,GSM6128160,GSM6128161,GSM6128162
2
+ 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,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,0.0,0.0,0.0,0.0,0.0
3
+ 53.0,53.0,53.0,53.0,53.0,53.0,57.0,57.0,57.0,57.0,57.0,57.0,63.0,63.0,63.0,63.0,63.0,63.0,75.0,75.0,75.0,75.0,75.0,75.0,85.0,85.0,85.0,85.0,85.0,85.0,76.0,76.0,76.0,76.0,76.0,76.0,63.0,63.0,63.0,63.0,63.0,63.0,69.0,69.0,69.0,69.0,69.0,69.0,66.0,66.0,66.0,66.0,66.0,66.0,53.0,53.0,53.0,53.0,53.0,53.0
p1/preprocess/Parkinsons_Disease/clinical_data/GSE49126.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ GSM1194062,GSM1194063,GSM1194064,GSM1194065,GSM1194066,GSM1194067,GSM1194068,GSM1194069,GSM1194070,GSM1194071,GSM1194072,GSM1194073,GSM1194074,GSM1194075,GSM1194076,GSM1194077,GSM1194078,GSM1194079,GSM1194080,GSM1194081,GSM1194082,GSM1194083,GSM1194084,GSM1194085,GSM1194086,GSM1194087,GSM1194088,GSM1194089,GSM1194090,GSM1194091,GSM1194092,GSM1194093,GSM1194094,GSM1194095,GSM1194096,GSM1194097,GSM1194098,GSM1194099,GSM1194100,GSM1194101,GSM1194102,GSM1194103,GSM1194104,GSM1194105,GSM1194106,GSM1194107,GSM1194108,GSM1194109,GSM1194110,GSM1194111
2
+ 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,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
p1/preprocess/Parkinsons_Disease/clinical_data/GSE57475.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ GSM1383302,GSM1383303,GSM1383304,GSM1383305,GSM1383306,GSM1383307,GSM1383308,GSM1383309,GSM1383310,GSM1383311,GSM1383312,GSM1383313,GSM1383314,GSM1383315,GSM1383316,GSM1383317,GSM1383318,GSM1383319,GSM1383320,GSM1383321,GSM1383322,GSM1383323,GSM1383324,GSM1383325,GSM1383326,GSM1383327,GSM1383328,GSM1383329,GSM1383330,GSM1383331,GSM1383332,GSM1383333,GSM1383334,GSM1383335,GSM1383336,GSM1383337,GSM1383338,GSM1383339,GSM1383340,GSM1383341,GSM1383342,GSM1383343,GSM1383344,GSM1383345,GSM1383346,GSM1383347,GSM1383348,GSM1383349,GSM1383350,GSM1383351,GSM1383352,GSM1383353,GSM1383354,GSM1383355,GSM1383356,GSM1383357,GSM1383358,GSM1383359,GSM1383360,GSM1383361,GSM1383362,GSM1383363,GSM1383364,GSM1383365,GSM1383366,GSM1383367,GSM1383368,GSM1383369,GSM1383370,GSM1383371,GSM1383372,GSM1383373,GSM1383374,GSM1383375,GSM1383376,GSM1383377,GSM1383378,GSM1383379,GSM1383380,GSM1383381,GSM1383382,GSM1383383,GSM1383384,GSM1383385,GSM1383386,GSM1383387,GSM1383388,GSM1383389,GSM1383390,GSM1383391,GSM1383392,GSM1383393,GSM1383394,GSM1383395,GSM1383396,GSM1383397,GSM1383398,GSM1383399,GSM1383400,GSM1383401,GSM1383402,GSM1383403,GSM1383404,GSM1383405,GSM1383406,GSM1383407,GSM1383408,GSM1383409,GSM1383410,GSM1383411,GSM1383412,GSM1383413,GSM1383414,GSM1383415,GSM1383416,GSM1383417,GSM1383418,GSM1383419,GSM1383420,GSM1383421,GSM1383422,GSM1383423,GSM1383424,GSM1383425,GSM1383426,GSM1383427,GSM1383428,GSM1383429,GSM1383430,GSM1383431,GSM1383432,GSM1383433,GSM1383434,GSM1383435,GSM1383436,GSM1383437,GSM1383438,GSM1383439,GSM1383440,GSM1383441,GSM1383442,GSM1383443
2
+ 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,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,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,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,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,0.0,0.0,0.0,0.0,0.0,0.0
3
+ 62.0,54.0,58.0,76.0,52.0,52.0,72.0,54.0,78.0,61.0,67.0,68.0,76.0,84.0,65.0,58.0,86.0,49.0,72.0,71.0,69.0,64.0,55.0,69.0,60.0,56.0,60.0,61.0,53.0,69.0,65.0,58.0,63.0,80.0,45.0,52.0,49.0,67.0,75.0,66.0,78.0,65.0,51.0,60.0,70.0,76.0,57.0,66.0,52.0,68.0,55.0,39.0,53.0,78.0,61.0,59.0,52.0,67.0,53.0,64.0,61.0,58.0,70.0,49.0,59.0,63.0,49.0,84.0,79.0,59.0,67.0,72.0,61.0,58.0,77.0,58.0,61.0,69.0,61.0,55.0,62.0,77.0,60.0,55.0,62.0,61.0,66.0,59.0,61.0,52.0,53.0,59.0,69.0,81.0,54.0,57.0,70.0,49.0,73.0,74.0,79.0,67.0,49.0,55.0,57.0,63.0,59.0,55.0,54.0,56.0,57.0,58.0,59.0,69.0,60.0,60.0,53.0,52.0,59.0,87.0,47.0,59.0,51.0,76.0,51.0,73.0,65.0,48.0,57.0,65.0,64.0,61.0,49.0,55.0,63.0,57.0,58.0,64.0,74.0,57.0,76.0,76.0
4
+ 1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.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,0.0,0.0,1.0,1.0,1.0,1.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,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,0.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,0.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,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,0.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
p1/preprocess/Parkinsons_Disease/clinical_data/GSE72267.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1859079,GSM1859080,GSM1859081,GSM1859082,GSM1859083,GSM1859084,GSM1859085,GSM1859086,GSM1859087,GSM1859088,GSM1859089,GSM1859090,GSM1859091,GSM1859092,GSM1859093,GSM1859094,GSM1859095,GSM1859096,GSM1859097,GSM1859098,GSM1859099,GSM1859100,GSM1859101,GSM1859102,GSM1859103,GSM1859104,GSM1859105,GSM1859106,GSM1859107,GSM1859108,GSM1859109,GSM1859110,GSM1859111,GSM1859112,GSM1859113,GSM1859114,GSM1859115,GSM1859116,GSM1859117,GSM1859118,GSM1859119,GSM1859120,GSM1859121,GSM1859122,GSM1859123,GSM1859124,GSM1859125,GSM1859126,GSM1859127,GSM1859128,GSM1859129,GSM1859130,GSM1859131,GSM1859132,GSM1859133,GSM1859134,GSM1859135,GSM1859136,GSM1859137
2
+ Parkinsons_Disease,0.0,1.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,0.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,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
p1/preprocess/Parkinsons_Disease/code/GSE101534.py ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE101534"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE101534"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE101534.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE101534.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE101534.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # Step 1: Determine gene expression data availability
37
+ # Based on the series title "Genome-wide expression profiling...", we conclude:
38
+ is_gene_available = True
39
+
40
+ # Step 2: Determine variable availability and define row indices
41
+ # The sample characteristics dictionary only has key=0 with multiple distinct values
42
+ # representing different mutation statuses ("healthy", "patient", etc.).
43
+ # We'll treat this as the trait variable (Parkinson's vs. non-Parkinson's).
44
+ trait_row = 0
45
+ age_row = None
46
+ gender_row = None
47
+
48
+ # Step 2.2: Data Type Conversion Functions
49
+ def convert_trait(value: str):
50
+ """
51
+ Convert trait string to binary indicator:
52
+ 'healthy' -> 0
53
+ 'gene corrected' -> 0
54
+ 'patient' -> 1
55
+ 'inserted G2019S' -> 1
56
+ Unknown -> None
57
+ """
58
+ # Extract substring after colon if present
59
+ parts = value.split(':')
60
+ if len(parts) > 1:
61
+ val = parts[1].strip().lower()
62
+ else:
63
+ val = value.strip().lower()
64
+
65
+ if val == 'healthy':
66
+ return 0
67
+ elif val == 'gene corrected':
68
+ return 0
69
+ elif val == 'patient':
70
+ return 1
71
+ elif val == 'inserted g2019s':
72
+ return 1
73
+ else:
74
+ return None
75
+
76
+ def convert_age(value: str):
77
+ # Not used because age_row is None, but defined as required
78
+ return None
79
+
80
+ def convert_gender(value: str):
81
+ # Not used because gender_row is None, but defined as required
82
+ return None
83
+
84
+ # Step 3: Initial filtering and saving metadata
85
+ is_trait_available = (trait_row is not None)
86
+ is_usable = validate_and_save_cohort_info(
87
+ is_final=False,
88
+ cohort=cohort,
89
+ info_path=json_path,
90
+ is_gene_available=is_gene_available,
91
+ is_trait_available=is_trait_available
92
+ )
93
+
94
+ # Step 4: Clinical feature extraction (only if trait data is available)
95
+ if trait_row is not None:
96
+ selected_clinical_df = geo_select_clinical_features(
97
+ clinical_data,
98
+ trait=trait,
99
+ trait_row=trait_row,
100
+ convert_trait=convert_trait,
101
+ age_row=age_row,
102
+ convert_age=convert_age,
103
+ gender_row=gender_row,
104
+ convert_gender=convert_gender
105
+ )
106
+
107
+ # Preview the extracted clinical data
108
+ preview = preview_df(selected_clinical_df)
109
+ print("Clinical data preview:", preview)
110
+
111
+ # Save to CSV
112
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
113
+ # STEP3
114
+ import gzip
115
+ import pandas as pd
116
+
117
+ try:
118
+ # 1. Attempt to extract gene expression data using the library function
119
+ gene_data = get_genetic_data(matrix_file)
120
+ except KeyError:
121
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
122
+ # and rename the first column to "ID".
123
+ marker = "!series_matrix_table_begin"
124
+ skip_rows = None
125
+
126
+ # Determine how many rows to skip before the matrix data begins
127
+ with gzip.open(matrix_file, 'rt') as f:
128
+ for i, line in enumerate(f):
129
+ if marker in line:
130
+ skip_rows = i + 1
131
+ break
132
+ else:
133
+ raise ValueError(f"Marker '{marker}' not found in the file.")
134
+
135
+ # Read the data from the determined position
136
+ gene_data = pd.read_csv(
137
+ matrix_file,
138
+ compression='gzip',
139
+ skiprows=skip_rows,
140
+ comment='!',
141
+ delimiter='\t',
142
+ on_bad_lines='skip'
143
+ )
144
+
145
+ # If a different column name is used instead of 'ID_REF', rename appropriately
146
+ if 'ID_REF' in gene_data.columns:
147
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
148
+ else:
149
+ first_col = gene_data.columns[0]
150
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
151
+
152
+ gene_data['ID'] = gene_data['ID'].astype(str)
153
+ gene_data.set_index('ID', inplace=True)
154
+
155
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
156
+ print(gene_data.index[:20])
157
+ # These appear to be numeric identifiers rather than standard human gene symbols, so gene mapping is required.
158
+ print("requires_gene_mapping = True")
159
+ # STEP5
160
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
161
+ gene_annotation = get_gene_annotation(soft_file)
162
+
163
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
164
+ print("Gene annotation preview:")
165
+ print(preview_df(gene_annotation))
166
+ # STEP 6: Gene Identifier Mapping
167
+
168
+ # After reviewing the annotation and expression data, it appears that the numeric row IDs in gene_data
169
+ # (e.g., "16650001", "16650003", etc.) do not match the "ID" column in gene_annotation (e.g., "16657436", "16657440").
170
+ # There's no direct overlap, so standard probe-to-gene mapping yields an empty dataframe.
171
+
172
+ # 1) Let's check if there's any overlap at all between gene_data.index and the annotation "ID":
173
+ common_ids_with_ID = set(gene_data.index).intersection(set(gene_annotation["ID"].astype(str)))
174
+ if len(common_ids_with_ID) > 0:
175
+ # If we somehow have overlap with the "ID" column in annotation:
176
+ print("Using gene_annotation['ID'] to map gene_data.")
177
+ mapping_df = get_gene_mapping(gene_annotation, prob_col="ID", gene_col="GB_ACC")
178
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
179
+ print("Mapping dataframe shape:", mapping_df.shape)
180
+ print("Gene expression dataframe shape after mapping:", gene_data.shape)
181
+ else:
182
+ # 2) Otherwise, check if there's overlap with the "SPOT_ID" column:
183
+ if "SPOT_ID" in gene_annotation.columns:
184
+ # Convert SPOT_ID to string just in case
185
+ gene_annotation["SPOT_ID"] = gene_annotation["SPOT_ID"].astype(str)
186
+ common_ids_with_spot = set(gene_data.index).intersection(set(gene_annotation["SPOT_ID"]))
187
+ if len(common_ids_with_spot) > 0:
188
+ print("Using gene_annotation['SPOT_ID'] to map gene_data.")
189
+ # Create a mapping dataframe from SPOT_ID to GB_ACC
190
+ temp_annot = gene_annotation.rename(columns={"SPOT_ID": "ID", "GB_ACC": "Gene"})
191
+ temp_annot = temp_annot[["ID", "Gene"]]
192
+ # Map
193
+ gene_data = apply_gene_mapping(gene_data, temp_annot)
194
+ print("Gene expression dataframe shape after mapping:", gene_data.shape)
195
+ else:
196
+ # 3) If no column overlaps, skip mapping
197
+ print(
198
+ "No overlap found between gene_data row IDs and any relevant column in gene_annotation. "
199
+ "Skipping probe-to-gene mapping step. The gene_data DataFrame remains as probe-level data."
200
+ )
201
+ else:
202
+ # If there's no SPOT_ID column, just skip
203
+ print(
204
+ "No overlap found between gene_data row IDs and gene_annotation['ID'], "
205
+ "and 'SPOT_ID' column not available. Skipping mapping step."
206
+ )
207
+ import os
208
+ import pandas as pd
209
+
210
+ # STEP 7: Data Normalization and Linking
211
+
212
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
213
+ if not os.path.exists(out_clinical_data_file):
214
+ # No trait data file => dataset is not usable for trait analysis
215
+ df_null = pd.DataFrame()
216
+ is_biased = True # Arbitrary boolean to satisfy function requirement
217
+ validate_and_save_cohort_info(
218
+ is_final=True,
219
+ cohort=cohort,
220
+ info_path=json_path,
221
+ is_gene_available=True,
222
+ is_trait_available=False,
223
+ is_biased=is_biased,
224
+ df=df_null,
225
+ note="No trait data file found; dataset not usable for trait analysis."
226
+ )
227
+
228
+ else:
229
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
230
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
231
+ normalized_gene_data.to_csv(out_gene_data_file)
232
+
233
+ # 2. Load the previously extracted clinical CSV.
234
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
235
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
236
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
237
+
238
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
239
+ combined_clinical_df = selected_clinical_df
240
+
241
+ # Link the clinical and genetic data by matching sample IDs in columns.
242
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
243
+
244
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
245
+ processed_data = handle_missing_values(linked_data, trait)
246
+
247
+ # 4. Check trait bias and remove any biased demographic features (if any).
248
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
249
+
250
+ # 5. Final validation and metadata saving.
251
+ is_usable = validate_and_save_cohort_info(
252
+ is_final=True,
253
+ cohort=cohort,
254
+ info_path=json_path,
255
+ is_gene_available=True,
256
+ is_trait_available=True,
257
+ is_biased=trait_biased,
258
+ df=processed_data,
259
+ note="Completed trait-based preprocessing."
260
+ )
261
+
262
+ # 6. If final dataset is usable, save. Otherwise, skip.
263
+ if is_usable:
264
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE103099.py ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE103099"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE103099"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE103099.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE103099.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE103099.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1. Determine if gene expression data is likely available
37
+ is_gene_available = True # Based on the series title mentioning LRRK2 expression
38
+
39
+ # 2. Identify data availability for trait, age, and gender
40
+
41
+ # From inspection:
42
+ # - Row 0 has only "gender: female" → single value → treat as not available
43
+ gender_row = None
44
+
45
+ # - Row 1 has only "age: 2 year old" → single value → treat as not available
46
+ age_row = None
47
+
48
+ # - Row 2 describes infection status (control vs. infected). We interpret this as our trait.
49
+ # Hence, multiple unique values → potential trait data
50
+ trait_row = 2
51
+
52
+ # 2.2 Define data type conversion functions
53
+ def convert_trait(x: str) -> int:
54
+ """
55
+ Converts raw infection descriptor into a binary trait:
56
+ 0 = no infection (control), 1 = infection (Parkinson's-like).
57
+ """
58
+ parts = x.split(':')
59
+ if len(parts) < 2:
60
+ return None # Unknown format
61
+ val = parts[-1].strip().lower()
62
+ if val == "no infection":
63
+ return 0
64
+ else:
65
+ return 1
66
+
67
+ # Age and gender are not available, so conversion functions are not needed.
68
+ convert_age = None
69
+ convert_gender = None
70
+
71
+ # 3. Initial filtering and saving metadata
72
+ is_trait_available = (trait_row is not None)
73
+ is_usable = validate_and_save_cohort_info(
74
+ is_final=False,
75
+ cohort=cohort,
76
+ info_path=json_path,
77
+ is_gene_available=is_gene_available,
78
+ is_trait_available=is_trait_available
79
+ )
80
+
81
+ # 4. Extract clinical features if trait data is available
82
+ if trait_row is not None:
83
+ selected_clinical_df = geo_select_clinical_features(
84
+ clinical_df=clinical_data, # assumed to be loaded in a previous step
85
+ trait=trait,
86
+ trait_row=trait_row,
87
+ convert_trait=convert_trait,
88
+ age_row=age_row,
89
+ convert_age=convert_age,
90
+ gender_row=gender_row,
91
+ convert_gender=convert_gender
92
+ )
93
+
94
+ # Preview and save clinical data
95
+ preview = preview_df(selected_clinical_df)
96
+ print("Clinical Data Preview:", preview)
97
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
98
+ # STEP3
99
+ import gzip
100
+ import pandas as pd
101
+
102
+ try:
103
+ # 1. Attempt to extract gene expression data using the library function
104
+ gene_data = get_genetic_data(matrix_file)
105
+ except KeyError:
106
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
107
+ # and rename the first column to "ID".
108
+ marker = "!series_matrix_table_begin"
109
+ skip_rows = None
110
+
111
+ # Determine how many rows to skip before the matrix data begins
112
+ with gzip.open(matrix_file, 'rt') as f:
113
+ for i, line in enumerate(f):
114
+ if marker in line:
115
+ skip_rows = i + 1
116
+ break
117
+ else:
118
+ raise ValueError(f"Marker '{marker}' not found in the file.")
119
+
120
+ # Read the data from the determined position
121
+ gene_data = pd.read_csv(
122
+ matrix_file,
123
+ compression='gzip',
124
+ skiprows=skip_rows,
125
+ comment='!',
126
+ delimiter='\t',
127
+ on_bad_lines='skip'
128
+ )
129
+
130
+ # If a different column name is used instead of 'ID_REF', rename appropriately
131
+ if 'ID_REF' in gene_data.columns:
132
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
133
+ else:
134
+ first_col = gene_data.columns[0]
135
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
136
+
137
+ gene_data['ID'] = gene_data['ID'].astype(str)
138
+ gene_data.set_index('ID', inplace=True)
139
+
140
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
141
+ print(gene_data.index[:20])
142
+ # Based on the observed identifiers (e.g., "1007_s_at", "1255_g_at"), these are Affymetrix probe set IDs
143
+ # and are not standard human gene symbols; therefore, mapping to gene symbols is needed.
144
+ print("requires_gene_mapping = True")
145
+ # STEP5
146
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
147
+ gene_annotation = get_gene_annotation(soft_file)
148
+
149
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
150
+ print("Gene annotation preview:")
151
+ print(preview_df(gene_annotation))
152
+ # Gene Identifier Mapping
153
+
154
+ # 1. Identify the appropriate columns for probe IDs and gene symbols.
155
+ # From inspection of the gene annotation preview:
156
+ # - The 'ID' column matches the probe IDs like '1007_s_at'.
157
+ # - The 'Gene Symbol' column contains the gene symbols (e.g., 'DDR1 /// MIR4640').
158
+
159
+ # 2. Create a mapping dataframe between probe IDs and gene symbols.
160
+ mapping_df = get_gene_mapping(
161
+ annotation=gene_annotation,
162
+ prob_col='ID',
163
+ gene_col='Gene Symbol'
164
+ )
165
+
166
+ # 3. Convert probe-level data to gene-level data by applying the mapping,
167
+ # distributing expression values equally across multiple mapped genes,
168
+ # and summing for genes that map from multiple probes.
169
+ gene_data = apply_gene_mapping(
170
+ expression_df=gene_data,
171
+ mapping_df=mapping_df
172
+ )
173
+
174
+ # Optional: Preview result
175
+ print("Mapped gene_data shape:", gene_data.shape)
176
+ print(gene_data.head())
177
+ import os
178
+ import pandas as pd
179
+
180
+ # STEP 7: Data Normalization and Linking
181
+
182
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
183
+ if not os.path.exists(out_clinical_data_file):
184
+ # No trait data file => dataset is not usable for trait analysis
185
+ df_null = pd.DataFrame()
186
+ is_biased = True # Arbitrary boolean to satisfy function requirement
187
+ validate_and_save_cohort_info(
188
+ is_final=True,
189
+ cohort=cohort,
190
+ info_path=json_path,
191
+ is_gene_available=True,
192
+ is_trait_available=False,
193
+ is_biased=is_biased,
194
+ df=df_null,
195
+ note="No trait data file found; dataset not usable for trait analysis."
196
+ )
197
+
198
+ else:
199
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
200
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
201
+ normalized_gene_data.to_csv(out_gene_data_file)
202
+
203
+ # 2. Load the previously extracted clinical CSV.
204
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
205
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
206
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
207
+
208
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
209
+ combined_clinical_df = selected_clinical_df
210
+
211
+ # Link the clinical and genetic data by matching sample IDs in columns.
212
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
213
+
214
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
215
+ processed_data = handle_missing_values(linked_data, trait)
216
+
217
+ # 4. Check trait bias and remove any biased demographic features (if any).
218
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
219
+
220
+ # 5. Final validation and metadata saving.
221
+ is_usable = validate_and_save_cohort_info(
222
+ is_final=True,
223
+ cohort=cohort,
224
+ info_path=json_path,
225
+ is_gene_available=True,
226
+ is_trait_available=True,
227
+ is_biased=trait_biased,
228
+ df=processed_data,
229
+ note="Completed trait-based preprocessing."
230
+ )
231
+
232
+ # 6. If final dataset is usable, save. Otherwise, skip.
233
+ if is_usable:
234
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE202665.py ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE202665"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE202665"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE202665.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE202665.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE202665.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1. Determine whether the dataset likely contains gene expression data
37
+ is_gene_available = True # Based on the series description ("mRNAarray")
38
+
39
+ # 2. Identify data availability and define data type conversion functions
40
+ trait_row = 0
41
+ age_row = 3
42
+ gender_row = None # All samples are male; hence it's effectively a constant variable
43
+
44
+ def convert_trait(value: str) -> int:
45
+ """
46
+ Convert trait data to binary integers:
47
+ 'Parkinson's disease' -> 1
48
+ 'Healthy Control' -> 0
49
+ otherwise -> None
50
+ """
51
+ parts = value.split(':', 1)
52
+ if len(parts) < 2:
53
+ return None
54
+ val = parts[1].strip().lower()
55
+ if "parkinson" in val:
56
+ return 1
57
+ elif "healthy" in val:
58
+ return 0
59
+ else:
60
+ return None
61
+
62
+ def convert_age(value: str) -> float:
63
+ """
64
+ Convert age data to a continuous variable (float or int).
65
+ Returns None if conversion is not possible.
66
+ """
67
+ parts = value.split(':', 1)
68
+ if len(parts) < 2:
69
+ return None
70
+ val = parts[1].strip()
71
+ try:
72
+ return float(val)
73
+ except ValueError:
74
+ return None
75
+
76
+ def convert_gender(value: str) -> int:
77
+ """
78
+ Convert gender data to binary integers:
79
+ female -> 0
80
+ male -> 1
81
+ otherwise -> None
82
+ """
83
+ parts = value.split(':', 1)
84
+ if len(parts) < 2:
85
+ return None
86
+ val = parts[1].strip().lower()
87
+ if "female" in val:
88
+ return 0
89
+ elif "male" in val:
90
+ return 1
91
+ else:
92
+ return None
93
+
94
+ # 3. Conduct initial filtering with validate_and_save_cohort_info
95
+ is_trait_available = (trait_row is not None)
96
+ _ = validate_and_save_cohort_info(
97
+ is_final=False,
98
+ cohort=cohort,
99
+ info_path=json_path,
100
+ is_gene_available=is_gene_available,
101
+ is_trait_available=is_trait_available,
102
+ note=''
103
+ )
104
+
105
+ # 4. If trait data is available, extract clinical features, preview, and save
106
+ if trait_row is not None:
107
+ selected_clinical_df = geo_select_clinical_features(
108
+ clinical_df=clinical_data,
109
+ trait=trait,
110
+ trait_row=trait_row,
111
+ convert_trait=convert_trait,
112
+ age_row=age_row,
113
+ convert_age=convert_age,
114
+ gender_row=gender_row,
115
+ convert_gender=convert_gender
116
+ )
117
+ preview = preview_df(selected_clinical_df, n=5, max_items=200)
118
+ print("Clinical Data Preview:", preview)
119
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
120
+ # STEP3
121
+ import gzip
122
+ import pandas as pd
123
+
124
+ try:
125
+ # 1. Attempt to extract gene expression data using the library function
126
+ gene_data = get_genetic_data(matrix_file)
127
+ except KeyError:
128
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
129
+ # and rename the first column to "ID".
130
+ marker = "!series_matrix_table_begin"
131
+ skip_rows = None
132
+
133
+ # Determine how many rows to skip before the matrix data begins
134
+ with gzip.open(matrix_file, 'rt') as f:
135
+ for i, line in enumerate(f):
136
+ if marker in line:
137
+ skip_rows = i + 1
138
+ break
139
+ else:
140
+ raise ValueError(f"Marker '{marker}' not found in the file.")
141
+
142
+ # Read the data from the determined position
143
+ gene_data = pd.read_csv(
144
+ matrix_file,
145
+ compression='gzip',
146
+ skiprows=skip_rows,
147
+ comment='!',
148
+ delimiter='\t',
149
+ on_bad_lines='skip'
150
+ )
151
+
152
+ # If a different column name is used instead of 'ID_REF', rename appropriately
153
+ if 'ID_REF' in gene_data.columns:
154
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
155
+ else:
156
+ first_col = gene_data.columns[0]
157
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
158
+
159
+ gene_data['ID'] = gene_data['ID'].astype(str)
160
+ gene_data.set_index('ID', inplace=True)
161
+
162
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
163
+ print(gene_data.index[:20])
164
+ # Based on the given gene identifiers (1, 2, 3, ...), they do not appear to be standard human gene symbols.
165
+ # They likely require mapping to recognized gene symbols.
166
+ print("requires_gene_mapping = True")
167
+ # STEP5
168
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
169
+ gene_annotation = get_gene_annotation(soft_file)
170
+
171
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
172
+ print("Gene annotation preview:")
173
+ print(preview_df(gene_annotation))
174
+ # STEP6: Gene Identifier Mapping
175
+
176
+ # 1. Identify columns in the annotation dataframe
177
+ # The 'ID' column in gene_annotation matches the row IDs in the gene expression data,
178
+ # and 'GENE_SYMBOL' holds the gene symbols to which we need to map.
179
+
180
+ # 2. Get a gene mapping dataframe
181
+ mapping_df = get_gene_mapping(
182
+ annotation=gene_annotation,
183
+ prob_col="ID",
184
+ gene_col="GENE_SYMBOL"
185
+ )
186
+
187
+ # 3. Convert probe-level measurements to gene expression data
188
+ gene_data = apply_gene_mapping(
189
+ expression_df=gene_data,
190
+ mapping_df=mapping_df
191
+ )
192
+
193
+ # (Optional) Preview the mapped gene data dimensions and a few rows
194
+ print("Mapped Gene Data Shape:", gene_data.shape)
195
+ print(gene_data.head())
196
+ import os
197
+ import pandas as pd
198
+
199
+ # STEP 7: Data Normalization and Linking
200
+
201
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
202
+ if not os.path.exists(out_clinical_data_file):
203
+ # No trait data file => dataset is not usable for trait analysis
204
+ df_null = pd.DataFrame()
205
+ is_biased = True # Arbitrary boolean to satisfy function requirement
206
+ validate_and_save_cohort_info(
207
+ is_final=True,
208
+ cohort=cohort,
209
+ info_path=json_path,
210
+ is_gene_available=True,
211
+ is_trait_available=False,
212
+ is_biased=is_biased,
213
+ df=df_null,
214
+ note="No trait data file found; dataset not usable for trait analysis."
215
+ )
216
+
217
+ else:
218
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
219
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
220
+ normalized_gene_data.to_csv(out_gene_data_file)
221
+
222
+ # 2. Load the previously extracted clinical CSV.
223
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
224
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
225
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
226
+
227
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
228
+ combined_clinical_df = selected_clinical_df
229
+
230
+ # Link the clinical and genetic data by matching sample IDs in columns.
231
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
232
+
233
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
234
+ processed_data = handle_missing_values(linked_data, trait)
235
+
236
+ # 4. Check trait bias and remove any biased demographic features (if any).
237
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
238
+
239
+ # 5. Final validation and metadata saving.
240
+ is_usable = validate_and_save_cohort_info(
241
+ is_final=True,
242
+ cohort=cohort,
243
+ info_path=json_path,
244
+ is_gene_available=True,
245
+ is_trait_available=True,
246
+ is_biased=trait_biased,
247
+ df=processed_data,
248
+ note="Completed trait-based preprocessing."
249
+ )
250
+
251
+ # 6. If final dataset is usable, save. Otherwise, skip.
252
+ if is_usable:
253
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE202667.py ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE202667"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE202667"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE202667.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE202667.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE202667.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1. Gene Expression Data Availability
37
+ is_gene_available = True # Based on "RNA signatures", this dataset likely contains gene expression data
38
+
39
+ # 2. Variable Availability and Data Type Conversion
40
+ trait_row = 0 # 0 -> ["disease state: Parkinson's disease", 'disease state: Healthy Control']
41
+ age_row = 3 # 3 -> ['age: 53', 'age: 57', 'age: 63', 'age: 75', ...]
42
+ gender_row = None # Only 'male' is observed (constant), so treat as not available
43
+
44
+ # Define the conversion functions
45
+ def convert_trait(x: str):
46
+ """Convert 'disease state: X' to binary (Parkinson's disease -> 1, Healthy Control -> 0)."""
47
+ if not isinstance(x, str):
48
+ return None
49
+ parts = x.split(':', 1)
50
+ if len(parts) < 2:
51
+ return None
52
+ val = parts[1].strip().lower()
53
+ if 'parkinson' in val:
54
+ return 1
55
+ elif 'healthy control' in val:
56
+ return 0
57
+ return None
58
+
59
+ def convert_age(x: str):
60
+ """Convert 'age: XX' to numeric."""
61
+ if not isinstance(x, str):
62
+ return None
63
+ parts = x.split(':', 1)
64
+ if len(parts) < 2:
65
+ return None
66
+ val = parts[1].strip()
67
+ try:
68
+ return float(val)
69
+ except ValueError:
70
+ return None
71
+
72
+ # 3. Save Metadata (initial filtering)
73
+ is_trait_available = (trait_row is not None)
74
+ is_usable = validate_and_save_cohort_info(
75
+ is_final=False,
76
+ cohort=cohort,
77
+ info_path=json_path,
78
+ is_gene_available=is_gene_available,
79
+ is_trait_available=is_trait_available
80
+ )
81
+
82
+ # 4. Clinical Feature Extraction (only if trait_row is not None)
83
+ if trait_row is not None:
84
+ selected_clinical_df = geo_select_clinical_features(
85
+ clinical_data,
86
+ trait=trait,
87
+ trait_row=trait_row,
88
+ convert_trait=convert_trait,
89
+ age_row=age_row,
90
+ convert_age=convert_age,
91
+ gender_row=gender_row,
92
+ convert_gender=None # Not used since gender_row is None
93
+ )
94
+ preview = preview_df(selected_clinical_df)
95
+ print("Preview of selected clinical features:", preview)
96
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
97
+ # STEP3
98
+ import gzip
99
+ import pandas as pd
100
+
101
+ try:
102
+ # 1. Attempt to extract gene expression data using the library function
103
+ gene_data = get_genetic_data(matrix_file)
104
+ except KeyError:
105
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
106
+ # and rename the first column to "ID".
107
+ marker = "!series_matrix_table_begin"
108
+ skip_rows = None
109
+
110
+ # Determine how many rows to skip before the matrix data begins
111
+ with gzip.open(matrix_file, 'rt') as f:
112
+ for i, line in enumerate(f):
113
+ if marker in line:
114
+ skip_rows = i + 1
115
+ break
116
+ else:
117
+ raise ValueError(f"Marker '{marker}' not found in the file.")
118
+
119
+ # Read the data from the determined position
120
+ gene_data = pd.read_csv(
121
+ matrix_file,
122
+ compression='gzip',
123
+ skiprows=skip_rows,
124
+ comment='!',
125
+ delimiter='\t',
126
+ on_bad_lines='skip'
127
+ )
128
+
129
+ # If a different column name is used instead of 'ID_REF', rename appropriately
130
+ if 'ID_REF' in gene_data.columns:
131
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
132
+ else:
133
+ first_col = gene_data.columns[0]
134
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
135
+
136
+ gene_data['ID'] = gene_data['ID'].astype(str)
137
+ gene_data.set_index('ID', inplace=True)
138
+
139
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
140
+ print(gene_data.index[:20])
141
+ # Based on the numeric-only identifiers (e.g., '1', '2', '3', ...),
142
+ # it is clear they are not standard human gene symbols.
143
+ # Therefore, gene mapping is required.
144
+
145
+ print("requires_gene_mapping = True")
146
+ # STEP5
147
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
148
+ gene_annotation = get_gene_annotation(soft_file)
149
+
150
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
151
+ print("Gene annotation preview:")
152
+ print(preview_df(gene_annotation))
153
+ # STEP: Gene Identifier Mapping
154
+
155
+ # 1. Identify the columns in the annotation DataFrame that correspond to the same IDs as in the gene expression data,
156
+ # and the column that holds the gene symbols.
157
+ # From the previews, it appears "ID" matches the numeric IDs in the gene expression data,
158
+ # and "GENE_SYMBOL" corresponds to the gene symbols.
159
+
160
+ # 2. Obtain the gene mapping DataFrame using these two columns.
161
+ mapping_df = get_gene_mapping(gene_annotation, prob_col="ID", gene_col="GENE_SYMBOL")
162
+
163
+ # 3. Apply the gene mapping to convert probe-level measurements to gene-level expression data.
164
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
165
+
166
+ # For confirmation, let's print out some basic information about the remapped gene data.
167
+ print("Remapped gene_data shape:", gene_data.shape)
168
+ print("First 20 gene indices after mapping:")
169
+ print(gene_data.index[:20])
170
+ import os
171
+ import pandas as pd
172
+
173
+ # STEP 7: Data Normalization and Linking
174
+
175
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
176
+ if not os.path.exists(out_clinical_data_file):
177
+ # No trait data file => dataset is not usable for trait analysis
178
+ df_null = pd.DataFrame()
179
+ is_biased = True # Arbitrary boolean to satisfy function requirement
180
+ validate_and_save_cohort_info(
181
+ is_final=True,
182
+ cohort=cohort,
183
+ info_path=json_path,
184
+ is_gene_available=True,
185
+ is_trait_available=False,
186
+ is_biased=is_biased,
187
+ df=df_null,
188
+ note="No trait data file found; dataset not usable for trait analysis."
189
+ )
190
+
191
+ else:
192
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
193
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
194
+ normalized_gene_data.to_csv(out_gene_data_file)
195
+
196
+ # 2. Load the previously extracted clinical CSV.
197
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
198
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
199
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
200
+
201
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
202
+ combined_clinical_df = selected_clinical_df
203
+
204
+ # Link the clinical and genetic data by matching sample IDs in columns.
205
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
206
+
207
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
208
+ processed_data = handle_missing_values(linked_data, trait)
209
+
210
+ # 4. Check trait bias and remove any biased demographic features (if any).
211
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
212
+
213
+ # 5. Final validation and metadata saving.
214
+ is_usable = validate_and_save_cohort_info(
215
+ is_final=True,
216
+ cohort=cohort,
217
+ info_path=json_path,
218
+ is_gene_available=True,
219
+ is_trait_available=True,
220
+ is_biased=trait_biased,
221
+ df=processed_data,
222
+ note="Completed trait-based preprocessing."
223
+ )
224
+
225
+ # 6. If final dataset is usable, save. Otherwise, skip.
226
+ if is_usable:
227
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE30335.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE30335"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE30335"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE30335.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE30335.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE30335.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1. Determine availability of gene expression data
37
+ is_gene_available = True # From the series summary, it clearly states "Blood gene expression"
38
+
39
+ # 2. Determine availability for trait, age, and gender
40
+ # and define the corresponding data type conversion functions.
41
+
42
+ # From the provided dictionary and background,
43
+ # there is no Parkinson's Disease status key (trait),
44
+ # no mention of age, and everyone in the dataset is male (constant feature).
45
+ # Hence, none of them are effectively available for analysis.
46
+ trait_row = None
47
+ age_row = None
48
+ gender_row = None
49
+
50
+ # Placeholder conversion functions returning None
51
+ def convert_trait(value: str):
52
+ return None
53
+
54
+ def convert_age(value: str):
55
+ return None
56
+
57
+ def convert_gender(value: str):
58
+ return None
59
+
60
+ # 3. Save initial metadata using validate_and_save_cohort_info
61
+ # (trait availability is False because trait_row is None).
62
+ is_trait_available = (trait_row is not None)
63
+ validate_and_save_cohort_info(
64
+ is_final=False,
65
+ cohort=cohort,
66
+ info_path=json_path,
67
+ is_gene_available=is_gene_available,
68
+ is_trait_available=is_trait_available
69
+ )
70
+
71
+ # 4. Since trait_row is None, we skip the clinical feature extraction step.
p1/preprocess/Parkinsons_Disease/code/GSE49126.py ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE49126"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE49126"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE49126.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE49126.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE49126.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1. Determine gene expression data availability
37
+ is_gene_available = True # Based on the provided info ("Transcriptomic profiling" on Agilent)
38
+
39
+ # 2. Variable availability and data type conversion
40
+ # Observing the sample characteristics dictionary:
41
+ # 0: ['disease state: control', "disease state: Parkinson's disease"]
42
+ # 1: ['cell type: peripheral blood mononuclear cells']
43
+ # We see that row 0 has two unique values ("control" vs. "Parkinson's disease"), which map to the trait.
44
+ trait_row = 0
45
+ age_row = None
46
+ gender_row = None
47
+
48
+ def convert_trait(value: str) -> Optional[int]:
49
+ if ':' in value:
50
+ val = value.split(':', 1)[1].strip().lower()
51
+ if 'control' in val:
52
+ return 0
53
+ elif 'parkinson' in val:
54
+ return 1
55
+ return None
56
+
57
+ def convert_age(value: str) -> Optional[float]:
58
+ # Not available in this dataset
59
+ return None
60
+
61
+ def convert_gender(value: str) -> Optional[int]:
62
+ # Not available in this dataset
63
+ return None
64
+
65
+ # 3. Save metadata via initial filtering
66
+ is_trait_available = (trait_row is not None)
67
+ is_usable = validate_and_save_cohort_info(
68
+ is_final=False,
69
+ cohort=cohort,
70
+ info_path=json_path,
71
+ is_gene_available=is_gene_available,
72
+ is_trait_available=is_trait_available
73
+ )
74
+
75
+ # 4. If trait data is available, extract clinical features
76
+ if trait_row is not None:
77
+ selected_clinical_df = geo_select_clinical_features(
78
+ clinical_df=clinical_data,
79
+ trait=trait,
80
+ trait_row=trait_row,
81
+ convert_trait=convert_trait,
82
+ age_row=age_row,
83
+ convert_age=convert_age,
84
+ gender_row=gender_row,
85
+ convert_gender=convert_gender
86
+ )
87
+ preview = preview_df(selected_clinical_df)
88
+ print("Clinical Data Preview:", preview)
89
+
90
+ # Save extracted clinical dataframe
91
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
92
+ # STEP3
93
+ import gzip
94
+ import pandas as pd
95
+
96
+ try:
97
+ # 1. Attempt to extract gene expression data using the library function
98
+ gene_data = get_genetic_data(matrix_file)
99
+ except KeyError:
100
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
101
+ # and rename the first column to "ID".
102
+ marker = "!series_matrix_table_begin"
103
+ skip_rows = None
104
+
105
+ # Determine how many rows to skip before the matrix data begins
106
+ with gzip.open(matrix_file, 'rt') as f:
107
+ for i, line in enumerate(f):
108
+ if marker in line:
109
+ skip_rows = i + 1
110
+ break
111
+ else:
112
+ raise ValueError(f"Marker '{marker}' not found in the file.")
113
+
114
+ # Read the data from the determined position
115
+ gene_data = pd.read_csv(
116
+ matrix_file,
117
+ compression='gzip',
118
+ skiprows=skip_rows,
119
+ comment='!',
120
+ delimiter='\t',
121
+ on_bad_lines='skip'
122
+ )
123
+
124
+ # If a different column name is used instead of 'ID_REF', rename appropriately
125
+ if 'ID_REF' in gene_data.columns:
126
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
127
+ else:
128
+ first_col = gene_data.columns[0]
129
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
130
+
131
+ gene_data['ID'] = gene_data['ID'].astype(str)
132
+ gene_data.set_index('ID', inplace=True)
133
+
134
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
135
+ print(gene_data.index[:20])
136
+ # Based on the observed identifiers (numeric indices), they are not standard human gene symbols.
137
+ # Therefore, they require mapping to gene symbols.
138
+ print("requires_gene_mapping = True")
139
+ # STEP5
140
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
141
+ gene_annotation = get_gene_annotation(soft_file)
142
+
143
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
144
+ print("Gene annotation preview:")
145
+ print(preview_df(gene_annotation))
146
+ # STEP: Gene Identifier Mapping
147
+
148
+ # 1. Decide which columns in 'gene_annotation' match the gene expression data and the gene symbols:
149
+ # From the preview, the 'ID' column in 'gene_annotation' appears to correspond to the probe IDs
150
+ # in 'gene_data'. The 'GENE_SYMBOL' column is presumably the gene symbol field.
151
+
152
+ probe_id_column = "ID"
153
+ gene_symbol_column = "GENE_SYMBOL"
154
+
155
+ # 2. Get a dataframe mapping probe IDs to gene symbols
156
+ mapping_df = get_gene_mapping(gene_annotation, probe_id_column, gene_symbol_column)
157
+
158
+ # 3. Convert the probe-level measurements to gene-level by applying the mapping
159
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
160
+
161
+ # Just print a brief shape info for verification
162
+ print("Mapped gene_data shape:", gene_data.shape)
163
+ import os
164
+ import pandas as pd
165
+
166
+ # STEP 7: Data Normalization and Linking
167
+
168
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
169
+ if not os.path.exists(out_clinical_data_file):
170
+ # No trait data file => dataset is not usable for trait analysis
171
+ df_null = pd.DataFrame()
172
+ is_biased = True # Arbitrary boolean to satisfy function requirement
173
+ validate_and_save_cohort_info(
174
+ is_final=True,
175
+ cohort=cohort,
176
+ info_path=json_path,
177
+ is_gene_available=True,
178
+ is_trait_available=False,
179
+ is_biased=is_biased,
180
+ df=df_null,
181
+ note="No trait data file found; dataset not usable for trait analysis."
182
+ )
183
+
184
+ else:
185
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
186
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
187
+ normalized_gene_data.to_csv(out_gene_data_file)
188
+
189
+ # 2. Load the previously extracted clinical CSV.
190
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
191
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
192
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
193
+
194
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
195
+ combined_clinical_df = selected_clinical_df
196
+
197
+ # Link the clinical and genetic data by matching sample IDs in columns.
198
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
199
+
200
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
201
+ processed_data = handle_missing_values(linked_data, trait)
202
+
203
+ # 4. Check trait bias and remove any biased demographic features (if any).
204
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
205
+
206
+ # 5. Final validation and metadata saving.
207
+ is_usable = validate_and_save_cohort_info(
208
+ is_final=True,
209
+ cohort=cohort,
210
+ info_path=json_path,
211
+ is_gene_available=True,
212
+ is_trait_available=True,
213
+ is_biased=trait_biased,
214
+ df=processed_data,
215
+ note="Completed trait-based preprocessing."
216
+ )
217
+
218
+ # 6. If final dataset is usable, save. Otherwise, skip.
219
+ if is_usable:
220
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE57475.py ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE57475"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE57475"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE57475.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE57475.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE57475.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ import re
37
+
38
+ # 1) Determine if gene expression data is available
39
+ is_gene_available = True # Based on the series title and summary, it clearly involves gene expression data
40
+
41
+ # 2) Identify the keys in the sample characteristics dictionary
42
+ # From the background, we see:
43
+ # key=0 -> age data
44
+ # key=1 -> gender data
45
+ # key=2 -> disease state (PD or control)
46
+ trait_row = 2
47
+ age_row = 0
48
+ gender_row = 1
49
+
50
+ # 2.2) Define conversion functions
51
+ def convert_trait(value: str):
52
+ # Extract the portion after the first colon
53
+ match = re.split(r':\s*', value, maxsplit=1)
54
+ if len(match) < 2:
55
+ return None
56
+ val = match[1].strip().lower()
57
+ # Map PD to 1, control to 0
58
+ if "pd" in val:
59
+ return 1
60
+ elif "control" in val:
61
+ return 0
62
+ else:
63
+ return None
64
+
65
+ def convert_age(value: str):
66
+ # Extract the portion after the first colon
67
+ match = re.split(r':\s*', value, maxsplit=1)
68
+ if len(match) < 2:
69
+ return None
70
+ val = match[1].strip()
71
+ # Convert to float if possible
72
+ try:
73
+ return float(val)
74
+ except ValueError:
75
+ return None
76
+
77
+ def convert_gender(value: str):
78
+ # Extract the portion after the first colon
79
+ match = re.split(r':\s*', value, maxsplit=1)
80
+ if len(match) < 2:
81
+ return None
82
+ val = match[1].strip().upper()
83
+ # Map F -> 0, M -> 1
84
+ if val == "F":
85
+ return 0
86
+ elif val == "M":
87
+ return 1
88
+ else:
89
+ return None
90
+
91
+ # 3) Initial filtering on the usability of the dataset
92
+ is_trait_available = (trait_row is not None)
93
+ is_usable = validate_and_save_cohort_info(
94
+ is_final=False,
95
+ cohort=cohort,
96
+ info_path=json_path,
97
+ is_gene_available=is_gene_available,
98
+ is_trait_available=is_trait_available
99
+ )
100
+
101
+ # 4) If trait data is available, extract and preview clinical features
102
+ if trait_row is not None:
103
+ df_clinical = geo_select_clinical_features(
104
+ clinical_df=clinical_data,
105
+ trait=trait,
106
+ trait_row=trait_row,
107
+ convert_trait=convert_trait,
108
+ age_row=age_row,
109
+ convert_age=convert_age,
110
+ gender_row=gender_row,
111
+ convert_gender=convert_gender
112
+ )
113
+ # Preview
114
+ clinical_preview = preview_df(df_clinical)
115
+ print("Clinical Feature Preview:", clinical_preview)
116
+
117
+ # Save the extracted clinical features
118
+ df_clinical.to_csv(out_clinical_data_file, index=False)
119
+ # STEP3
120
+ import gzip
121
+ import pandas as pd
122
+
123
+ try:
124
+ # 1. Attempt to extract gene expression data using the library function
125
+ gene_data = get_genetic_data(matrix_file)
126
+ except KeyError:
127
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
128
+ # and rename the first column to "ID".
129
+ marker = "!series_matrix_table_begin"
130
+ skip_rows = None
131
+
132
+ # Determine how many rows to skip before the matrix data begins
133
+ with gzip.open(matrix_file, 'rt') as f:
134
+ for i, line in enumerate(f):
135
+ if marker in line:
136
+ skip_rows = i + 1
137
+ break
138
+ else:
139
+ raise ValueError(f"Marker '{marker}' not found in the file.")
140
+
141
+ # Read the data from the determined position
142
+ gene_data = pd.read_csv(
143
+ matrix_file,
144
+ compression='gzip',
145
+ skiprows=skip_rows,
146
+ comment='!',
147
+ delimiter='\t',
148
+ on_bad_lines='skip'
149
+ )
150
+
151
+ # If a different column name is used instead of 'ID_REF', rename appropriately
152
+ if 'ID_REF' in gene_data.columns:
153
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
154
+ else:
155
+ first_col = gene_data.columns[0]
156
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
157
+
158
+ gene_data['ID'] = gene_data['ID'].astype(str)
159
+ gene_data.set_index('ID', inplace=True)
160
+
161
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
162
+ print(gene_data.index[:20])
163
+ # These identifiers are Illumina probe IDs, not standard human gene symbols.
164
+ # Therefore, we need to map them to the corresponding gene symbols.
165
+ print("Based on the provided gene identifiers, they appear to be Illumina probe IDs "
166
+ "rather than standard human gene symbols.\nrequires_gene_mapping = True")
167
+ # STEP5
168
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
169
+ gene_annotation = get_gene_annotation(soft_file)
170
+
171
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
172
+ print("Gene annotation preview:")
173
+ print(preview_df(gene_annotation))
174
+ # STEP: Gene Identifier Mapping
175
+
176
+ # 1. Identify which columns in gene_annotation match the probe IDs in gene_data and the actual gene symbols.
177
+ # From the preview, the "ID" column in gene_annotation corresponds to the probe IDs (e.g. ILMN_1811966),
178
+ # and the "Symbol" column corresponds to the gene symbol (e.g. FCGR2B, TRIM44).
179
+ prob_col = 'ID'
180
+ gene_col = 'Symbol'
181
+
182
+ # 2. Get a gene mapping dataframe by extracting these two columns.
183
+ mapping_df = get_gene_mapping(gene_annotation, prob_col=prob_col, gene_col=gene_col)
184
+
185
+ # 3. Map probe-level expression data to gene-level expression data:
186
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
187
+ import os
188
+ import pandas as pd
189
+
190
+ # STEP 7: Data Normalization and Linking
191
+
192
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
193
+ if not os.path.exists(out_clinical_data_file):
194
+ # No trait data file => dataset is not usable for trait analysis
195
+ df_null = pd.DataFrame()
196
+ is_biased = True # Arbitrary boolean to satisfy function requirement
197
+ validate_and_save_cohort_info(
198
+ is_final=True,
199
+ cohort=cohort,
200
+ info_path=json_path,
201
+ is_gene_available=True,
202
+ is_trait_available=False,
203
+ is_biased=is_biased,
204
+ df=df_null,
205
+ note="No trait data file found; dataset not usable for trait analysis."
206
+ )
207
+
208
+ else:
209
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
210
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
211
+ normalized_gene_data.to_csv(out_gene_data_file)
212
+
213
+ # 2. Load the previously extracted clinical CSV.
214
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
215
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
216
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
217
+
218
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
219
+ combined_clinical_df = selected_clinical_df
220
+
221
+ # Link the clinical and genetic data by matching sample IDs in columns.
222
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
223
+
224
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
225
+ processed_data = handle_missing_values(linked_data, trait)
226
+
227
+ # 4. Check trait bias and remove any biased demographic features (if any).
228
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
229
+
230
+ # 5. Final validation and metadata saving.
231
+ is_usable = validate_and_save_cohort_info(
232
+ is_final=True,
233
+ cohort=cohort,
234
+ info_path=json_path,
235
+ is_gene_available=True,
236
+ is_trait_available=True,
237
+ is_biased=trait_biased,
238
+ df=processed_data,
239
+ note="Completed trait-based preprocessing."
240
+ )
241
+
242
+ # 6. If final dataset is usable, save. Otherwise, skip.
243
+ if is_usable:
244
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE71220.py ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE71220"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE71220"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE71220.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE71220.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE71220.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # Step 1: Determine if this dataset contains gene expression data
37
+ # Based on the background information, it mentions "Whole blood gene expression was measured"
38
+ # using Affymetrix microarray chips. Hence we can conclude:
39
+ is_gene_available = True
40
+
41
+ # Step 2: Check variable (trait, age, gender) availability
42
+
43
+ # 2.1 Data Availability
44
+ # - The sample characteristics dictionary does not contain "Parkinson's Disease" or an equivalent field.
45
+ # Therefore, we cannot map the trait "Parkinsons_Disease" to any row:
46
+ trait_row = None
47
+
48
+ # - For age, the dictionary at key=2 contains age information ("age: XX"):
49
+ age_row = 2
50
+
51
+ # - For gender, the dictionary at key=3 contains sex information ("Sex: F" or "Sex: M"):
52
+ gender_row = 3
53
+
54
+ # 2.2 Data Type Conversion
55
+
56
+ def convert_trait(value: str) -> Optional[int]:
57
+ """
58
+ Convert the trait string to a binary value:
59
+ - If it indicates 'Parkinsons_Disease', return 1
60
+ - If it indicates a control or non-PD state, return 0
61
+ - Otherwise, return None
62
+ Since the dataset does not have explicit PD data, this function is mostly a placeholder.
63
+ """
64
+ # Typically, we parse after the colon:
65
+ val_part = value.split(':')[-1].strip().lower()
66
+ if 'parkinson' in val_part:
67
+ return 1
68
+ elif 'control' in val_part or 'no' in val_part:
69
+ return 0
70
+ else:
71
+ return None
72
+
73
+ def convert_age(value: str) -> Optional[float]:
74
+ """
75
+ Convert age from string to a float. If parsing fails, return None.
76
+ Example input: "age: 57"
77
+ """
78
+ val_part = value.split(':')[-1].strip()
79
+ try:
80
+ return float(val_part)
81
+ except ValueError:
82
+ return None
83
+
84
+ def convert_gender(value: str) -> Optional[int]:
85
+ """
86
+ Convert gender to binary:
87
+ - Female (F) -> 0
88
+ - Male (M) -> 1
89
+ - Otherwise -> None
90
+ Example input: "Sex: F"
91
+ """
92
+ val_part = value.split(':')[-1].strip().lower()
93
+ if val_part == 'f':
94
+ return 0
95
+ elif val_part == 'm':
96
+ return 1
97
+ return None
98
+
99
+ # Step 3: Save metadata (initial filtering) using validate_and_save_cohort_info
100
+ # trait data is not available because trait_row is None.
101
+ is_trait_available = (trait_row is not None)
102
+
103
+ validate_and_save_cohort_info(
104
+ is_final=False,
105
+ cohort=cohort,
106
+ info_path=json_path,
107
+ is_gene_available=is_gene_available,
108
+ is_trait_available=is_trait_available
109
+ )
110
+
111
+ # Step 4: Since trait_row is None, we do NOT proceed with clinical feature extraction (skip).
112
+ # STEP3
113
+ import gzip
114
+ import pandas as pd
115
+
116
+ try:
117
+ # 1. Attempt to extract gene expression data using the library function
118
+ gene_data = get_genetic_data(matrix_file)
119
+ except KeyError:
120
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
121
+ # and rename the first column to "ID".
122
+ marker = "!series_matrix_table_begin"
123
+ skip_rows = None
124
+
125
+ # Determine how many rows to skip before the matrix data begins
126
+ with gzip.open(matrix_file, 'rt') as f:
127
+ for i, line in enumerate(f):
128
+ if marker in line:
129
+ skip_rows = i + 1
130
+ break
131
+ else:
132
+ raise ValueError(f"Marker '{marker}' not found in the file.")
133
+
134
+ # Read the data from the determined position
135
+ gene_data = pd.read_csv(
136
+ matrix_file,
137
+ compression='gzip',
138
+ skiprows=skip_rows,
139
+ comment='!',
140
+ delimiter='\t',
141
+ on_bad_lines='skip'
142
+ )
143
+
144
+ # If a different column name is used instead of 'ID_REF', rename appropriately
145
+ if 'ID_REF' in gene_data.columns:
146
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
147
+ else:
148
+ first_col = gene_data.columns[0]
149
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
150
+
151
+ gene_data['ID'] = gene_data['ID'].astype(str)
152
+ gene_data.set_index('ID', inplace=True)
153
+
154
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
155
+ print(gene_data.index[:20])
156
+ # Based on observation, these numeric IDs (e.g., 7892501, 7892504) appear to be probe identifiers, not standard gene symbols.
157
+ # Therefore, they likely require mapping to human gene symbols.
158
+ print("requires_gene_mapping = True")
159
+ # STEP5
160
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
161
+ gene_annotation = get_gene_annotation(soft_file)
162
+
163
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
164
+ print("Gene annotation preview:")
165
+ print(preview_df(gene_annotation))
166
+ # STEP: Gene Identifier Mapping
167
+
168
+ # 1. Decide which columns in gene_annotation correspond to probe IDs and gene symbols
169
+ probe_col = "ID"
170
+ gene_col = "gene_assignment"
171
+
172
+ # 2. Get a gene mapping dataframe
173
+ mapping_df = get_gene_mapping(gene_annotation, prob_col=probe_col, gene_col=gene_col)
174
+
175
+ # 3. Convert probe-level measurements to gene expression data
176
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
177
+
178
+ # Optional: Print resulting shape to verify
179
+ print("Gene data shape after mapping:", gene_data.shape)
180
+ import os
181
+ import pandas as pd
182
+
183
+ # STEP 7: Data Normalization and Linking
184
+
185
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
186
+ if not os.path.exists(out_clinical_data_file):
187
+ # No trait data file => dataset is not usable for trait analysis
188
+ df_null = pd.DataFrame()
189
+ is_biased = True # Arbitrary boolean to satisfy function requirement
190
+ validate_and_save_cohort_info(
191
+ is_final=True,
192
+ cohort=cohort,
193
+ info_path=json_path,
194
+ is_gene_available=True,
195
+ is_trait_available=False,
196
+ is_biased=is_biased,
197
+ df=df_null,
198
+ note="No trait data file found; dataset not usable for trait analysis."
199
+ )
200
+
201
+ else:
202
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
203
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
204
+ normalized_gene_data.to_csv(out_gene_data_file)
205
+
206
+ # 2. Load the previously extracted clinical CSV.
207
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
208
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
209
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
210
+
211
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
212
+ combined_clinical_df = selected_clinical_df
213
+
214
+ # Link the clinical and genetic data by matching sample IDs in columns.
215
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
216
+
217
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
218
+ processed_data = handle_missing_values(linked_data, trait)
219
+
220
+ # 4. Check trait bias and remove any biased demographic features (if any).
221
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
222
+
223
+ # 5. Final validation and metadata saving.
224
+ is_usable = validate_and_save_cohort_info(
225
+ is_final=True,
226
+ cohort=cohort,
227
+ info_path=json_path,
228
+ is_gene_available=True,
229
+ is_trait_available=True,
230
+ is_biased=trait_biased,
231
+ df=processed_data,
232
+ note="Completed trait-based preprocessing."
233
+ )
234
+
235
+ # 6. If final dataset is usable, save. Otherwise, skip.
236
+ if is_usable:
237
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE72267.py ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE72267"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE72267"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE72267.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE72267.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE72267.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1) Determine gene expression data availability.
37
+ # Based on the background info indicating Affymetrix transcriptomic data,
38
+ # we set is_gene_available to True.
39
+ is_gene_available = True
40
+
41
+ # 2) Identify the availability of trait, age, and gender data from the sample characteristics dictionary
42
+ # and define the corresponding row indices. From the dictionary:
43
+ # 0: ['diagnosis: Healthy', "diagnosis: Parkinson's disease"]
44
+ # 1: ['tissue: blood']
45
+ # Only row 0 provides a meaningful variable for the trait (Parkinson's disease vs. Healthy).
46
+ # Age and gender data are not present, so we set them to None.
47
+
48
+ trait_row = 0
49
+ age_row = None
50
+ gender_row = None
51
+
52
+ # 2.2) Define conversion functions for each variable.
53
+ # The trait is considered a binary variable (0 = Healthy, 1 = Parkinson's disease).
54
+ # For unknown or unexpected values, return None.
55
+ def convert_trait(value: str):
56
+ parts = value.split(':', 1)
57
+ if len(parts) == 2:
58
+ val = parts[1].strip().lower()
59
+ if val == "healthy":
60
+ return 0
61
+ elif val == "parkinson's disease":
62
+ return 1
63
+ return None
64
+
65
+ # For age and gender, we have None for the row indices.
66
+ # Define placeholder converters (they won't be used if the row index is None).
67
+ def convert_age(value: str):
68
+ return None
69
+
70
+ def convert_gender(value: str):
71
+ return None
72
+
73
+ # 3) Conduct initial filtering of dataset usability and save metadata.
74
+ # We check if the trait data is available (i.e., trait_row is not None).
75
+ is_trait_available = (trait_row is not None)
76
+
77
+ is_usable = validate_and_save_cohort_info(
78
+ is_final=False,
79
+ cohort=cohort,
80
+ info_path=json_path,
81
+ is_gene_available=is_gene_available,
82
+ is_trait_available=is_trait_available
83
+ )
84
+
85
+ # 4) If trait_row is not None, extract clinical features and save the output.
86
+ # Assume a variable `clinical_data` contains the relevant sample characteristics DataFrame.
87
+ if trait_row is not None:
88
+ selected_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
+ preview = preview_df(selected_clinical_df)
99
+ print(preview) # For inspection; remove or comment out if not needed.
100
+ selected_clinical_df.to_csv(out_clinical_data_file)
101
+ # STEP3
102
+ import gzip
103
+ import pandas as pd
104
+
105
+ try:
106
+ # 1. Attempt to extract gene expression data using the library function
107
+ gene_data = get_genetic_data(matrix_file)
108
+ except KeyError:
109
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
110
+ # and rename the first column to "ID".
111
+ marker = "!series_matrix_table_begin"
112
+ skip_rows = None
113
+
114
+ # Determine how many rows to skip before the matrix data begins
115
+ with gzip.open(matrix_file, 'rt') as f:
116
+ for i, line in enumerate(f):
117
+ if marker in line:
118
+ skip_rows = i + 1
119
+ break
120
+ else:
121
+ raise ValueError(f"Marker '{marker}' not found in the file.")
122
+
123
+ # Read the data from the determined position
124
+ gene_data = pd.read_csv(
125
+ matrix_file,
126
+ compression='gzip',
127
+ skiprows=skip_rows,
128
+ comment='!',
129
+ delimiter='\t',
130
+ on_bad_lines='skip'
131
+ )
132
+
133
+ # If a different column name is used instead of 'ID_REF', rename appropriately
134
+ if 'ID_REF' in gene_data.columns:
135
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
136
+ else:
137
+ first_col = gene_data.columns[0]
138
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
139
+
140
+ gene_data['ID'] = gene_data['ID'].astype(str)
141
+ gene_data.set_index('ID', inplace=True)
142
+
143
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
144
+ print(gene_data.index[:20])
145
+ # Observing the identifiers, they appear to be Affymetrix microarray probe set IDs,
146
+ # which are not standard human gene symbols and therefore require gene mapping.
147
+
148
+ print("""
149
+ These IDs (e.g., '1007_s_at', '1053_at', etc.) are Affymetrix probe set identifiers
150
+ and do not directly correspond to standard human gene symbols.
151
+ They should be mapped to official gene symbols.
152
+
153
+ requires_gene_mapping = True
154
+ """.strip())
155
+ # STEP5
156
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
157
+ gene_annotation = get_gene_annotation(soft_file)
158
+
159
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
160
+ print("Gene annotation preview:")
161
+ print(preview_df(gene_annotation))
162
+ # STEP: Gene Identifier Mapping
163
+
164
+ # 1. From our earlier observations, the 'ID' column of the gene_annotation dataframe
165
+ # corresponds to the Affymetrix probe identifiers that match those in our gene_data index.
166
+ # The 'Gene Symbol' column in the gene_annotation holds the actual gene symbols.
167
+
168
+ # 2. Create a gene mapping dataframe from the gene_annotation, specifying
169
+ # the probe ID column as 'ID' and the gene symbol column as 'Gene Symbol'.
170
+ mapping_df = get_gene_mapping(
171
+ annotation=gene_annotation,
172
+ prob_col='ID',
173
+ gene_col='Gene Symbol'
174
+ )
175
+
176
+ # 3. Convert probe-level measurements to gene-level expression by applying the mapping.
177
+ # Each probe's expression is evenly distributed among mapped genes, then summed.
178
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
179
+
180
+ # For inspection, one could optionally print the top rows of the resulting gene_data:
181
+ #print(gene_data.head())
182
+ import os
183
+ import pandas as pd
184
+
185
+ # STEP 7: Data Normalization and Linking
186
+
187
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
188
+ if not os.path.exists(out_clinical_data_file):
189
+ # No trait data file => dataset is not usable for trait analysis
190
+ df_null = pd.DataFrame()
191
+ is_biased = True # Arbitrary boolean to satisfy function requirement
192
+ validate_and_save_cohort_info(
193
+ is_final=True,
194
+ cohort=cohort,
195
+ info_path=json_path,
196
+ is_gene_available=True,
197
+ is_trait_available=False,
198
+ is_biased=is_biased,
199
+ df=df_null,
200
+ note="No trait data file found; dataset not usable for trait analysis."
201
+ )
202
+
203
+ else:
204
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
205
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
206
+ normalized_gene_data.to_csv(out_gene_data_file)
207
+
208
+ # 2. Load the previously extracted clinical CSV.
209
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
210
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
211
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
212
+
213
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
214
+ combined_clinical_df = selected_clinical_df
215
+
216
+ # Link the clinical and genetic data by matching sample IDs in columns.
217
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
218
+
219
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
220
+ processed_data = handle_missing_values(linked_data, trait)
221
+
222
+ # 4. Check trait bias and remove any biased demographic features (if any).
223
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
224
+
225
+ # 5. Final validation and metadata saving.
226
+ is_usable = validate_and_save_cohort_info(
227
+ is_final=True,
228
+ cohort=cohort,
229
+ info_path=json_path,
230
+ is_gene_available=True,
231
+ is_trait_available=True,
232
+ is_biased=trait_biased,
233
+ df=processed_data,
234
+ note="Completed trait-based preprocessing."
235
+ )
236
+
237
+ # 6. If final dataset is usable, save. Otherwise, skip.
238
+ if is_usable:
239
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/GSE80599.py ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+ cohort = "GSE80599"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Parkinsons_Disease"
10
+ in_cohort_dir = "../DATA/GEO/Parkinsons_Disease/GSE80599"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/GSE80599.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/GSE80599.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/GSE80599.csv"
16
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+ # 1. Identify the paths to the SOFT file and the matrix file
21
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
22
+
23
+ # 2. Read the matrix file to obtain background information and sample characteristics data
24
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
25
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
26
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
27
+
28
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
29
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
30
+
31
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
32
+ print("Background Information:")
33
+ print(background_info)
34
+ print("Sample Characteristics Dictionary:")
35
+ print(sample_characteristics_dict)
36
+ # 1. Determine if gene expression data is available
37
+ is_gene_available = True # Based on platform information (Affymetrix HG-U219), it contains gene expression data
38
+
39
+ # 2.1 Identify data availability for trait, age, and gender
40
+ # The entire cohort has Parkinson's Disease, so there's no variation for the 'trait' variable.
41
+ trait_row = None # No key provides variation for presence/absence of Parkinson's Disease
42
+
43
+ # Row 4 in the sample characteristics stores multiple 'age at examination' values
44
+ age_row = 4
45
+
46
+ # Row 1 in the sample characteristics stores 'gender: Male' or 'gender: Female'
47
+ gender_row = 1
48
+
49
+ # 2.2 Define conversion functions
50
+ def convert_trait(value: str):
51
+ # Not used here because trait_row is None
52
+ return None
53
+
54
+ def convert_age(value: str):
55
+ parts = value.split(':', 1)
56
+ if len(parts) < 2:
57
+ return None
58
+ raw = parts[1].strip()
59
+ try:
60
+ return float(raw)
61
+ except ValueError:
62
+ return None
63
+
64
+ def convert_gender(value: str):
65
+ parts = value.split(':', 1)
66
+ if len(parts) < 2:
67
+ return None
68
+ raw = parts[1].strip().lower()
69
+ if raw == 'male':
70
+ return 1
71
+ elif raw == 'female':
72
+ return 0
73
+ return None
74
+
75
+ # 3. Save metadata with initial filtering
76
+ is_trait_available = (trait_row is not None)
77
+ validate_and_save_cohort_info(
78
+ is_final=False,
79
+ cohort=cohort,
80
+ info_path=json_path,
81
+ is_gene_available=is_gene_available,
82
+ is_trait_available=is_trait_available
83
+ )
84
+
85
+ # 4. Since trait_row is None, skip clinical feature extraction
86
+ # STEP3
87
+ import gzip
88
+ import pandas as pd
89
+
90
+ try:
91
+ # 1. Attempt to extract gene expression data using the library function
92
+ gene_data = get_genetic_data(matrix_file)
93
+ except KeyError:
94
+ # Fallback: the expected "ID_REF" column may be absent, so manually parse the file
95
+ # and rename the first column to "ID".
96
+ marker = "!series_matrix_table_begin"
97
+ skip_rows = None
98
+
99
+ # Determine how many rows to skip before the matrix data begins
100
+ with gzip.open(matrix_file, 'rt') as f:
101
+ for i, line in enumerate(f):
102
+ if marker in line:
103
+ skip_rows = i + 1
104
+ break
105
+ else:
106
+ raise ValueError(f"Marker '{marker}' not found in the file.")
107
+
108
+ # Read the data from the determined position
109
+ gene_data = pd.read_csv(
110
+ matrix_file,
111
+ compression='gzip',
112
+ skiprows=skip_rows,
113
+ comment='!',
114
+ delimiter='\t',
115
+ on_bad_lines='skip'
116
+ )
117
+
118
+ # If a different column name is used instead of 'ID_REF', rename appropriately
119
+ if 'ID_REF' in gene_data.columns:
120
+ gene_data.rename(columns={'ID_REF': 'ID'}, inplace=True)
121
+ else:
122
+ first_col = gene_data.columns[0]
123
+ gene_data.rename(columns={first_col: 'ID'}, inplace=True)
124
+
125
+ gene_data['ID'] = gene_data['ID'].astype(str)
126
+ gene_data.set_index('ID', inplace=True)
127
+
128
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
129
+ print(gene_data.index[:20])
130
+ # Based on the given identifiers, these are Affymetrix probe set IDs rather than standard gene symbols.
131
+ # Therefore, they likely require mapping to gene symbols.
132
+ print("requires_gene_mapping = True")
133
+ # STEP5
134
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
135
+ gene_annotation = get_gene_annotation(soft_file)
136
+
137
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
138
+ print("Gene annotation preview:")
139
+ print(preview_df(gene_annotation))
140
+ # STEP6: Gene Identifier Mapping
141
+
142
+ # 1. Identify the columns in the gene annotation that correspond to probe identifiers and gene symbols
143
+ probe_col = "ID"
144
+ gene_symbol_col = "Gene Symbol"
145
+
146
+ # 2. Create a mapping dataframe specifying which probe maps to which gene symbol
147
+ mapping_df = get_gene_mapping(gene_annotation, prob_col=probe_col, gene_col=gene_symbol_col)
148
+
149
+ # 3. Convert probe-level measurements to gene-level expression data
150
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
151
+ import os
152
+ import pandas as pd
153
+
154
+ # STEP 7: Data Normalization and Linking
155
+
156
+ # First, check if the clinical CSV file exists. If it does not, we cannot proceed with trait-based linking.
157
+ if not os.path.exists(out_clinical_data_file):
158
+ # No trait data file => dataset is not usable for trait analysis
159
+ df_null = pd.DataFrame()
160
+ is_biased = True # Arbitrary boolean to satisfy function requirement
161
+ validate_and_save_cohort_info(
162
+ is_final=True,
163
+ cohort=cohort,
164
+ info_path=json_path,
165
+ is_gene_available=True,
166
+ is_trait_available=False,
167
+ is_biased=is_biased,
168
+ df=df_null,
169
+ note="No trait data file found; dataset not usable for trait analysis."
170
+ )
171
+
172
+ else:
173
+ # 1. Normalize the mapped gene expression data using known gene symbol synonyms, then save.
174
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
175
+ normalized_gene_data.to_csv(out_gene_data_file)
176
+
177
+ # 2. Load the previously extracted clinical CSV.
178
+ selected_clinical_df = pd.read_csv(out_clinical_data_file)
179
+ # If we had a single-row trait, rename row 0 to the trait name (example usage).
180
+ selected_clinical_df = selected_clinical_df.rename(index={0: trait})
181
+
182
+ # Combine these as our final clinical data; in this dataset, we only have trait info (if any).
183
+ combined_clinical_df = selected_clinical_df
184
+
185
+ # Link the clinical and genetic data by matching sample IDs in columns.
186
+ linked_data = geo_link_clinical_genetic_data(combined_clinical_df, normalized_gene_data)
187
+
188
+ # 3. Handle missing values in the linked data (drop incomplete rows/columns, then impute).
189
+ processed_data = handle_missing_values(linked_data, trait)
190
+
191
+ # 4. Check trait bias and remove any biased demographic features (if any).
192
+ trait_biased, processed_data = judge_and_remove_biased_features(processed_data, trait)
193
+
194
+ # 5. Final validation and metadata saving.
195
+ is_usable = validate_and_save_cohort_info(
196
+ is_final=True,
197
+ cohort=cohort,
198
+ info_path=json_path,
199
+ is_gene_available=True,
200
+ is_trait_available=True,
201
+ is_biased=trait_biased,
202
+ df=processed_data,
203
+ note="Completed trait-based preprocessing."
204
+ )
205
+
206
+ # 6. If final dataset is usable, save. Otherwise, skip.
207
+ if is_usable:
208
+ processed_data.to_csv(out_data_file)
p1/preprocess/Parkinsons_Disease/code/TCGA.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Parkinsons_Disease"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/1/Parkinsons_Disease/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/1/Parkinsons_Disease/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/1/Parkinsons_Disease/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/1/Parkinsons_Disease/cohort_info.json"
15
+
16
+ import os
17
+ import pandas as pd
18
+
19
+ # List of subdirectories provided in the instructions:
20
+ subdirectories = [
21
+ 'CrawlData.ipynb', '.DS_Store', 'TCGA_lower_grade_glioma_and_glioblastoma_(GBMLGG)',
22
+ 'TCGA_Uterine_Carcinosarcoma_(UCS)', 'TCGA_Thyroid_Cancer_(THCA)', 'TCGA_Thymoma_(THYM)',
23
+ 'TCGA_Testicular_Cancer_(TGCT)', 'TCGA_Stomach_Cancer_(STAD)', 'TCGA_Sarcoma_(SARC)',
24
+ 'TCGA_Rectal_Cancer_(READ)', 'TCGA_Prostate_Cancer_(PRAD)', 'TCGA_Pheochromocytoma_Paraganglioma_(PCPG)',
25
+ 'TCGA_Pancreatic_Cancer_(PAAD)', 'TCGA_Ovarian_Cancer_(OV)', 'TCGA_Ocular_melanomas_(UVM)',
26
+ 'TCGA_Mesothelioma_(MESO)', 'TCGA_Melanoma_(SKCM)', 'TCGA_Lung_Squamous_Cell_Carcinoma_(LUSC)',
27
+ 'TCGA_Lung_Cancer_(LUNG)', 'TCGA_Lung_Adenocarcinoma_(LUAD)', 'TCGA_Lower_Grade_Glioma_(LGG)',
28
+ 'TCGA_Liver_Cancer_(LIHC)', 'TCGA_Large_Bcell_Lymphoma_(DLBC)', 'TCGA_Kidney_Papillary_Cell_Carcinoma_(KIRP)',
29
+ 'TCGA_Kidney_Clear_Cell_Carcinoma_(KIRC)', 'TCGA_Kidney_Chromophobe_(KICH)', 'TCGA_Head_and_Neck_Cancer_(HNSC)',
30
+ 'TCGA_Glioblastoma_(GBM)', 'TCGA_Esophageal_Cancer_(ESCA)', 'TCGA_Endometrioid_Cancer_(UCEC)',
31
+ 'TCGA_Colon_and_Rectal_Cancer_(COADREAD)', 'TCGA_Colon_Cancer_(COAD)', 'TCGA_Cervical_Cancer_(CESC)',
32
+ 'TCGA_Breast_Cancer_(BRCA)', 'TCGA_Bladder_Cancer_(BLCA)', 'TCGA_Bile_Duct_Cancer_(CHOL)',
33
+ 'TCGA_Adrenocortical_Cancer_(ACC)', 'TCGA_Acute_Myeloid_Leukemia_(LAML)'
34
+ ]
35
+
36
+ # Synonyms for "Parkinsons_Disease"
37
+ parkinsons_synonyms = ["parkinson", "parkinson's", "parkinsons"]
38
+
39
+ selected_subdirectory = None
40
+ for subdir in subdirectories:
41
+ # Skip non-directory markers
42
+ if subdir.lower() in ['crawldata.ipynb', '.ds_store']:
43
+ continue
44
+ subdir_lower = subdir.lower()
45
+ if any(syn in subdir_lower for syn in parkinsons_synonyms):
46
+ selected_subdirectory = subdir
47
+ break
48
+
49
+ if not selected_subdirectory:
50
+ # If no matching directory is found, mark dataset as unavailable
51
+ is_final = False
52
+ is_gene_available = False
53
+ is_trait_available = False
54
+ _ = validate_and_save_cohort_info(
55
+ is_final=is_final,
56
+ cohort="TCGA",
57
+ info_path=json_path,
58
+ is_gene_available=is_gene_available,
59
+ is_trait_available=is_trait_available
60
+ )
61
+ print(f"No suitable directory found for '{trait}'. Skipped this trait.")
62
+ else:
63
+ # Step 2: Identify clinicalMatrix file and PANCAN file
64
+ cohort_dir = os.path.join(tcga_root_dir, selected_subdirectory)
65
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
66
+
67
+ # Step 3: Load both files as dataframes
68
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
69
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
70
+
71
+ # Step 4: Print the column names of the clinical data
72
+ print("Clinical data columns:")
73
+ print(list(clinical_df.columns))