Liu-Hy commited on
Commit
b5650f0
·
verified ·
1 Parent(s): 0db4514

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 +14 -0
  2. p1/preprocess/Bladder_Cancer/TCGA.csv +3 -0
  3. p1/preprocess/Bladder_Cancer/gene_data/GSE245953.csv +3 -0
  4. p1/preprocess/Bladder_Cancer/gene_data/TCGA.csv +3 -0
  5. p1/preprocess/COVID-19/GSE213313.csv +3 -0
  6. p1/preprocess/COVID-19/GSE227080.csv +0 -0
  7. p1/preprocess/COVID-19/GSE243348.csv +0 -0
  8. p1/preprocess/COVID-19/GSE275334.csv +0 -0
  9. p1/preprocess/COVID-19/clinical_data/GSE212865.csv +2 -0
  10. p1/preprocess/COVID-19/clinical_data/GSE212866.csv +2 -0
  11. p1/preprocess/COVID-19/clinical_data/GSE213313.csv +2 -0
  12. p1/preprocess/COVID-19/clinical_data/GSE227080.csv +4 -0
  13. p1/preprocess/COVID-19/clinical_data/GSE243348.csv +4 -0
  14. p1/preprocess/COVID-19/clinical_data/GSE275334.csv +4 -0
  15. p1/preprocess/COVID-19/code/GSE185658.py +176 -0
  16. p1/preprocess/COVID-19/code/GSE211378.py +165 -0
  17. p1/preprocess/COVID-19/code/GSE212865.py +193 -0
  18. p1/preprocess/COVID-19/code/GSE212866.py +186 -0
  19. p1/preprocess/COVID-19/code/GSE213313.py +187 -0
  20. p1/preprocess/COVID-19/code/GSE216705.py +174 -0
  21. p1/preprocess/COVID-19/code/GSE227080.py +207 -0
  22. p1/preprocess/COVID-19/code/GSE243348.py +201 -0
  23. p1/preprocess/COVID-19/code/GSE273225.py +173 -0
  24. p1/preprocess/COVID-19/code/GSE275334.py +190 -0
  25. p1/preprocess/COVID-19/code/TCGA.py +50 -0
  26. p1/preprocess/COVID-19/cohort_info.json +1 -0
  27. p1/preprocess/COVID-19/gene_data/GSE185658.csv +3 -0
  28. p1/preprocess/COVID-19/gene_data/GSE211378.csv +0 -0
  29. p1/preprocess/COVID-19/gene_data/GSE213313.csv +3 -0
  30. p1/preprocess/COVID-19/gene_data/GSE216705.csv +0 -0
  31. p1/preprocess/COVID-19/gene_data/GSE227080.csv +0 -0
  32. p1/preprocess/COVID-19/gene_data/GSE243348.csv +0 -0
  33. p1/preprocess/COVID-19/gene_data/GSE273225.csv +0 -0
  34. p1/preprocess/COVID-19/gene_data/GSE275334.csv +0 -0
  35. p1/preprocess/Cervical_Cancer/gene_data/TCGA.csv +3 -0
  36. p1/preprocess/Chronic_Fatigue_Syndrome/gene_data/GSE67311.csv +3 -0
  37. p1/preprocess/Chronic_kidney_disease/gene_data/GSE104954.csv +3 -0
  38. p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE46517.csv +3 -0
  39. p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE46862.csv +3 -0
  40. p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE56699.csv +3 -0
  41. p1/preprocess/Congestive_heart_failure/gene_data/GSE182600.csv +3 -0
  42. p1/preprocess/Coronary_artery_disease/code/GSE59867.py +227 -0
  43. p1/preprocess/Coronary_artery_disease/code/GSE64554.py +227 -0
  44. p1/preprocess/Coronary_artery_disease/code/GSE86216.py +77 -0
  45. p1/preprocess/Coronary_artery_disease/code/TCGA.py +63 -0
  46. p1/preprocess/Coronary_artery_disease/gene_data/GSE109048.csv +11 -0
  47. p1/preprocess/Coronary_artery_disease/gene_data/GSE120774.csv +18 -0
  48. p1/preprocess/Coronary_artery_disease/gene_data/GSE234398.csv +9 -0
  49. p1/preprocess/Coronary_artery_disease/gene_data/GSE250283.csv +6 -0
  50. p1/preprocess/Coronary_artery_disease/gene_data/GSE54975.csv +9 -0
.gitattributes CHANGED
@@ -1018,3 +1018,17 @@ p1/preprocess/Celiac_Disease/gene_data/GSE20332.csv filter=lfs diff=lfs merge=lf
1018
  p1/preprocess/Chronic_Fatigue_Syndrome/GSE67311.csv filter=lfs diff=lfs merge=lfs -text
1019
  p1/preprocess/Chronic_kidney_disease/gene_data/GSE104948.csv filter=lfs diff=lfs merge=lfs -text
1020
  p1/preprocess/Chronic_kidney_disease/gene_data/GSE66494.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1018
  p1/preprocess/Chronic_Fatigue_Syndrome/GSE67311.csv filter=lfs diff=lfs merge=lfs -text
1019
  p1/preprocess/Chronic_kidney_disease/gene_data/GSE104948.csv filter=lfs diff=lfs merge=lfs -text
1020
  p1/preprocess/Chronic_kidney_disease/gene_data/GSE66494.csv filter=lfs diff=lfs merge=lfs -text
1021
+ p1/preprocess/Chronic_kidney_disease/gene_data/GSE104954.csv filter=lfs diff=lfs merge=lfs -text
1022
+ p1/preprocess/Chronic_Fatigue_Syndrome/gene_data/GSE67311.csv filter=lfs diff=lfs merge=lfs -text
1023
+ p1/preprocess/Bladder_Cancer/gene_data/GSE245953.csv filter=lfs diff=lfs merge=lfs -text
1024
+ p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE56699.csv filter=lfs diff=lfs merge=lfs -text
1025
+ p1/preprocess/Bladder_Cancer/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1026
+ p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE46517.csv filter=lfs diff=lfs merge=lfs -text
1027
+ p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE46862.csv filter=lfs diff=lfs merge=lfs -text
1028
+ p1/preprocess/Bladder_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1029
+ p1/preprocess/Congestive_heart_failure/gene_data/GSE182600.csv filter=lfs diff=lfs merge=lfs -text
1030
+ p1/preprocess/COVID-19/GSE213313.csv filter=lfs diff=lfs merge=lfs -text
1031
+ p1/preprocess/COVID-19/gene_data/GSE185658.csv filter=lfs diff=lfs merge=lfs -text
1032
+ p1/preprocess/COVID-19/gene_data/GSE213313.csv filter=lfs diff=lfs merge=lfs -text
1033
+ p1/preprocess/Crohns_Disease/GSE207022.csv filter=lfs diff=lfs merge=lfs -text
1034
+ p1/preprocess/Cervical_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
p1/preprocess/Bladder_Cancer/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07462a2cc70564c665076cfaa1f9447fbe1a6a7da1df62ba5a90cc6cdddf0643
3
+ size 128064949
p1/preprocess/Bladder_Cancer/gene_data/GSE245953.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77ff7c68c5202c9d866bd896ce6c4188bfd489a54f1c35c66410d2a1d7835a3a
3
+ size 101269272
p1/preprocess/Bladder_Cancer/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be64d77d83703f263dc51ead0994f75fb8147bcd662253db1dc58783e25690d0
3
+ size 128064088
p1/preprocess/COVID-19/GSE213313.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:589a5c78ac4c0fa7f110ab7c5cc291b574b447a38666d5a397756682d0a5dd77
3
+ size 16891141
p1/preprocess/COVID-19/GSE227080.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/GSE243348.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/GSE275334.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/clinical_data/GSE212865.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ GSM6559856,GSM6559857,GSM6559858,GSM6559859,GSM6559860,GSM6559861,GSM6559862,GSM6559863,GSM6559864,GSM6559865,GSM6559866,GSM6559867,GSM6559868,GSM6559869,GSM6559870,GSM6559871,GSM6559872,GSM6559873,GSM6559874,GSM6559875,GSM6559876,GSM6559877,GSM6559878,GSM6559879,GSM6559880,GSM6559881,GSM6559882,GSM6559883,GSM6559884,GSM6559885,GSM6559886,GSM6559887,GSM6559888,GSM6559889,GSM6559890,GSM6559891,GSM6559892,GSM6559893,GSM6559894,GSM6559895,GSM6559896,GSM6559897,GSM6559898,GSM6559899,GSM6559900,GSM6559901,GSM6559902,GSM6559903,GSM6559904,GSM6559905,GSM6559906,GSM6559907,GSM6559908,GSM6559909,GSM6559910,GSM6559911,GSM6559912,GSM6559913,GSM6559914,GSM6559915,GSM6559916,GSM6559917,GSM6559918,GSM6559919,GSM6559920,GSM6559921,GSM6559922,GSM6559923,GSM6559924,GSM6559925,GSM6559926,GSM6559927,GSM6559928,GSM6559929,GSM6559930,GSM6559931,GSM6559932,GSM6559933,GSM6559934,GSM6559935,GSM6559936,GSM6559937,GSM6559938,GSM6559939,GSM6559940,GSM6559941,GSM6559942,GSM6559943,GSM6559944,GSM6559945,GSM6559946,GSM6559947,GSM6559948,GSM6559949,GSM6559950,GSM6559951,GSM6559952,GSM6559953,GSM6559954,GSM6559955,GSM6559956,GSM6559957,GSM6559958,GSM6559959,GSM6559960,GSM6559961,GSM6559962,GSM6559963,GSM6559964,GSM6559965,GSM6559966,GSM6559967,GSM6559968,GSM6559969,GSM6559970,GSM6559971,GSM6559972,GSM6559973,GSM6559974,GSM6559975,GSM6559976,GSM6559977,GSM6559978,GSM6559979,GSM6559980,GSM6559981,GSM6559982,GSM6559983,GSM6559984,GSM6559985,GSM6559986,GSM6559987,GSM6559988,GSM6559989,GSM6559990,GSM6559991,GSM6559992
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,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,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
p1/preprocess/COVID-19/clinical_data/GSE212866.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ GSM6559856,GSM6559857,GSM6559858,GSM6559859,GSM6559860,GSM6559861,GSM6559862,GSM6559863,GSM6559864,GSM6559865,GSM6559866,GSM6559867,GSM6559868,GSM6559869,GSM6559870,GSM6559871,GSM6559872,GSM6559873,GSM6559874,GSM6559875,GSM6559876,GSM6559877,GSM6559878,GSM6559879,GSM6559880,GSM6559881,GSM6559882,GSM6559883,GSM6559884,GSM6559885,GSM6559886,GSM6559887,GSM6559888,GSM6559889,GSM6559890,GSM6559891,GSM6559892,GSM6559893,GSM6559894,GSM6559895,GSM6559896,GSM6559897,GSM6559898,GSM6559899,GSM6559900,GSM6559901,GSM6559902,GSM6559903,GSM6559904,GSM6559905,GSM6559906,GSM6559907,GSM6559908,GSM6559909,GSM6559910,GSM6559911,GSM6559912,GSM6559913,GSM6559914,GSM6559915,GSM6559916,GSM6559917,GSM6559918,GSM6559919,GSM6559920,GSM6559921,GSM6559922,GSM6559923,GSM6559924,GSM6559925,GSM6559926,GSM6559927,GSM6559928,GSM6559929,GSM6559930,GSM6559931,GSM6559932,GSM6559933,GSM6559934,GSM6559935,GSM6559936,GSM6559937,GSM6559938,GSM6559939,GSM6559940,GSM6559941,GSM6559942,GSM6559943,GSM6559944,GSM6559945,GSM6559946,GSM6559947,GSM6559948,GSM6559949,GSM6559950,GSM6559951,GSM6559952,GSM6559953,GSM6559954,GSM6559955,GSM6559956,GSM6559957,GSM6559958,GSM6559959,GSM6559960,GSM6559961,GSM6559962,GSM6559963,GSM6559964,GSM6559965,GSM6559966,GSM6559967,GSM6559968,GSM6559969,GSM6559970,GSM6559971,GSM6559972,GSM6559973,GSM6559974,GSM6559975,GSM6559976,GSM6559977,GSM6559978,GSM6559979,GSM6559980,GSM6559981,GSM6559982,GSM6559983,GSM6559984,GSM6559985,GSM6559986,GSM6559987,GSM6559988,GSM6559989,GSM6559990,GSM6559991,GSM6559992
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,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,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
p1/preprocess/COVID-19/clinical_data/GSE213313.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM6578718,GSM6578719,GSM6578720,GSM6578721,GSM6578722,GSM6578723,GSM6578724,GSM6578725,GSM6578726,GSM6578727,GSM6578728,GSM6578729,GSM6578730,GSM6578731,GSM6578732,GSM6578733,GSM6578734,GSM6578735,GSM6578736,GSM6578737,GSM6578738,GSM6578739,GSM6578740,GSM6578741,GSM6578742,GSM6578743,GSM6578744,GSM6578745,GSM6578746,GSM6578747,GSM6578748,GSM6578749,GSM6578750,GSM6578751,GSM6578752,GSM6578753,GSM6578754,GSM6578755,GSM6578756,GSM6578757,GSM6578758,GSM6578759,GSM6578760,GSM6578761,GSM6578762,GSM6578763,GSM6578764,GSM6578765,GSM6578766,GSM6578767,GSM6578768,GSM6578769,GSM6578770,GSM6578771,GSM6578772,GSM6578773,GSM6578774,GSM6578775,GSM6578776,GSM6578777,GSM6578778,GSM6578779,GSM6578780,GSM6578781,GSM6578782,GSM6578783,GSM6578784,GSM6578785,GSM6578786,GSM6578787,GSM6578788,GSM6578789,GSM6578790,GSM6578791,GSM6578792,GSM6578793,GSM6578794,GSM6578795,GSM6578796,GSM6578797,GSM6578798,GSM6578799,GSM6578800,GSM6578801,GSM6578802,GSM6578803,GSM6578804,GSM6578805,GSM6578806,GSM6578807,GSM6578808,GSM6578809,GSM6578810,GSM6578811
2
+ COVID-19,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0
p1/preprocess/COVID-19/clinical_data/GSE227080.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ GSM7091202,GSM7091203,GSM7091204,GSM7091205,GSM7091206,GSM7091207,GSM7091208,GSM7091209,GSM7091210,GSM7091211,GSM7091212,GSM7091213,GSM7091214,GSM7091215,GSM7091216,GSM7091217,GSM7091218,GSM7091219,GSM7091220,GSM7091221,GSM7091222,GSM7091223,GSM7091224,GSM7091225,GSM7091226,GSM7091227,GSM7091228,GSM7091229,GSM7091230,GSM7091231,GSM7091232,GSM7091233,GSM7091234,GSM7091235,GSM7091236,GSM7091237,GSM7091238,GSM7091239,GSM7091240,GSM7091241,GSM7091242,GSM7091243,GSM7091244,GSM7091245,GSM7091246,GSM7091247,GSM7091248,GSM7091249,GSM7091250,GSM7091251,GSM7091252,GSM7091253,GSM7091254,GSM7091255,GSM7091256,GSM7091257,GSM7091258,GSM7091259,GSM7091260,GSM7091261,GSM7091262,GSM7091263,GSM7091264,GSM7091265,GSM7091266,GSM7091267,GSM7091268,GSM7091269,GSM7091270,GSM7091271,GSM7091272,GSM7091273,GSM7091274,GSM7091275,GSM7091276,GSM7091277,GSM7091278,GSM7091279,GSM7091280,GSM7091281,GSM7091282,GSM7091283,GSM7091284,GSM7091285,GSM7091286,GSM7091287,GSM7091288,GSM7091289,GSM7091290,GSM7091291,GSM7091292,GSM7091293,GSM7091294,GSM7091295,GSM7091296,GSM7091297,GSM7091298,GSM7091299,GSM7091300,GSM7091301,GSM7091302,GSM7091303,GSM7091304,GSM7091305,GSM7091306,GSM7091307,GSM7091308,GSM7091309,GSM7091310,GSM7091311,GSM7091312,GSM7091313,GSM7091314,GSM7091315,GSM7091316,GSM7091317,GSM7091318,GSM7091319,GSM7091320
2
+ 1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.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,0.0,0.0,0.0,0.0,0.0,0.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,0.0,0.0,0.0,0.0,0.0,0.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,0.0,0.0,0.0,0.0,0.0,0.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,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0
3
+ 38.0,66.0,21.0,29.0,73.0,35.0,48.0,70.0,69.0,31.0,72.0,41.0,85.0,85.0,85.0,69.0,48.0,79.0,46.0,57.0,87.0,52.0,36.0,69.0,77.0,82.0,89.0,94.0,54.0,77.0,23.0,61.0,82.0,75.0,85.0,25.0,43.0,69.0,24.0,55.0,76.0,94.0,86.0,71.0,73.0,85.0,23.0,28.0,54.0,61.0,88.0,67.0,42.0,55.0,47.0,80.0,80.0,56.0,41.0,70.0,60.0,45.0,63.0,68.0,88.0,93.0,26.0,67.0,45.0,64.0,73.0,53.0,66.0,52.0,81.0,77.0,63.0,41.0,58.0,75.0,40.0,49.0,35.0,70.0,64.0,69.0,58.0,47.0,89.0,23.0,74.0,87.0,89.0,60.0,67.0,51.0,90.0,59.0,50.0,64.0,92.0,72.0,49.0,48.0,45.0,61.0,39.0,30.0,58.0,91.0,61.0,43.0,66.0,75.0,24.0,56.0,66.0,45.0,50.0
4
+ 0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.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,0.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.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,0.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.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,0.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0
p1/preprocess/COVID-19/clinical_data/GSE243348.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ GSM7783810,GSM7783811,GSM7783812,GSM7783813,GSM7783814,GSM7783815,GSM7783816,GSM7783817,GSM7783818,GSM7783819,GSM7783820,GSM7783821,GSM7783822,GSM7783823,GSM7783824,GSM7783825,GSM7783826,GSM7783827,GSM7783828,GSM7783829,GSM7783830,GSM7783831,GSM7783832,GSM7783833,GSM7783834,GSM7783835,GSM7783836,GSM7783837,GSM7783838,GSM7783839,GSM7783840,GSM7783841,GSM7783842,GSM7783843,GSM7783844,GSM7783845,GSM7783846,GSM7783847,GSM7783848,GSM7783849,GSM7783850,GSM7783851,GSM7783852,GSM7783853,GSM7783854,GSM7783855,GSM7783856,GSM7783857,GSM7783858,GSM7783859,GSM7783860,GSM7783861,GSM7783862,GSM7783863,GSM7783864,GSM7783865,GSM7783866,GSM7783867,GSM7783868,GSM7783869,GSM7783870,GSM7783871,GSM7783872,GSM7783873,GSM7783874,GSM7783875,GSM7783876,GSM7783877,GSM7783878,GSM7783879,GSM7783880,GSM7783881,GSM7783882,GSM7783883,GSM7783884,GSM7783885,GSM7783886,GSM7783887,GSM7783888,GSM7783889,GSM7783890,GSM7783891,GSM7783892,GSM7783893,GSM7783894,GSM7783895,GSM7783896,GSM7783897,GSM7783898,GSM7783899,GSM7783900,GSM7783901,GSM7783902,GSM7783903,GSM7783904,GSM7783905,GSM7783906,GSM7783907,GSM7783908,GSM7783909,GSM7783910,GSM7783911,GSM7783912,GSM7783913,GSM7783914,GSM7783915,GSM7783916,GSM7783917,GSM7783918,GSM7783919,GSM7783920,GSM7783921,GSM7783922,GSM7783923,GSM7783924,GSM7783925,GSM7783926,GSM7783927,GSM7783928,GSM7783929,GSM7783930,GSM7783931,GSM7783932,GSM7783933,GSM7783934,GSM7783935,GSM7783936,GSM7783937,GSM7783938,GSM7783939,GSM7783940,GSM7783941,GSM7783942,GSM7783943,GSM7783944,GSM7783945,GSM7783946,GSM7783947,GSM7783948,GSM7783949,GSM7783950,GSM7783951,GSM7783952,GSM7783953,GSM7783954,GSM7783955,GSM7783956,GSM7783957,GSM7783958,GSM7783959,GSM7783960,GSM7783961,GSM7783962,GSM7783963,GSM7783964,GSM7783965,GSM7783966,GSM7783967,GSM7783968,GSM7783969,GSM7783970,GSM7783971,GSM7783972,GSM7783973,GSM7783974,GSM7783975,GSM7783976,GSM7783977,GSM7783978,GSM7783979,GSM7783980,GSM7783981,GSM7783982,GSM7783983,GSM7783984,GSM7783985,GSM7783986,GSM7783987,GSM7783988,GSM7783989,GSM7783990,GSM7783991,GSM7783992,GSM7783993,GSM7783994,GSM7783995,GSM7783996,GSM7783997,GSM7783998,GSM7783999,GSM7784000,GSM7784001,GSM7784002,GSM7784003,GSM7784004,GSM7784005,GSM7784006,GSM7784007,GSM7784008,GSM7784009,GSM7784010,GSM7784011,GSM7784012,GSM7784013,GSM7784014,GSM7784015,GSM7784016,GSM7784017,GSM7784018,GSM7784019,GSM7784020,GSM7784021,GSM7784022,GSM7784023,GSM7784024,GSM7784025,GSM7784026,GSM7784027,GSM7784028,GSM7784029,GSM7784030,GSM7784031,GSM7784032,GSM7784033,GSM7784034,GSM7784035,GSM7784036,GSM7784037,GSM7784038,GSM7784039,GSM7784040,GSM7784041,GSM7784042,GSM7784043,GSM7784044,GSM7784045,GSM7784046
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,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,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
3
+ 44.0,44.0,44.0,44.0,44.0,44.0,44.0,29.0,29.0,29.0,29.0,29.0,29.0,51.0,51.0,51.0,51.0,51.0,51.0,51.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,32.0,29.0,29.0,29.0,29.0,29.0,29.0,29.0,27.0,27.0,27.0,27.0,27.0,27.0,27.0,30.0,30.0,30.0,30.0,30.0,30.0,30.0,27.0,27.0,27.0,27.0,27.0,27.0,27.0,30.0,30.0,30.0,30.0,30.0,30.0,30.0,41.0,41.0,41.0,41.0,41.0,41.0,41.0,43.0,43.0,43.0,43.0,43.0,43.0,43.0,34.0,34.0,34.0,34.0,34.0,34.0,34.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,30.0,30.0,30.0,30.0,30.0,60.0,60.0,60.0,60.0,60.0,60.0,24.0,24.0,24.0,24.0,24.0,24.0,30.0,30.0,30.0,30.0,30.0,30.0,30.0,36.0,36.0,36.0,36.0,36.0,34.0,34.0,34.0,34.0,34.0,34.0,34.0,33.0,33.0,33.0,33.0,33.0,33.0,33.0,24.0,24.0,24.0,24.0,24.0,24.0,24.0,53.0,53.0,53.0,53.0,53.0,53.0,53.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,59.0,59.0,59.0,59.0,59.0,59.0,59.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,65.0,65.0,65.0,65.0,37.0,37.0,37.0,37.0,37.0,37.0,37.0,39.0,39.0,39.0,39.0,39.0,39.0,39.0,58.0,58.0,58.0,58.0,58.0,58.0,58.0,51.0,51.0,51.0,51.0,51.0,39.0,39.0,39.0,39.0,39.0,39.0,39.0,42.0,42.0,42.0,42.0,42.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,36.0,24.0,28.0,36.0,27.0,38.0
4
+ 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,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,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,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.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,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,1.0,0.0,0.0,0.0,1.0,1.0
p1/preprocess/COVID-19/clinical_data/GSE275334.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ GSM8475033,GSM8475034,GSM8475035,GSM8475036,GSM8475037,GSM8475038,GSM8475039,GSM8475040,GSM8475041,GSM8475042,GSM8475043,GSM8475044,GSM8475045,GSM8475046,GSM8475047,GSM8475048,GSM8475049,GSM8475050,GSM8475051,GSM8475052,GSM8475053,GSM8475054,GSM8475055,GSM8475056,GSM8475057,GSM8475058,GSM8475059,GSM8475060,GSM8475061,GSM8475062,GSM8475063,GSM8475064,GSM8475065,GSM8475066,GSM8475067,GSM8475068,GSM8475069,GSM8475070,GSM8475071,GSM8475072,GSM8475073,GSM8475074,GSM8475075,GSM8475076,GSM8475077,GSM8475078,GSM8475079
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,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
3
+ 24.0,46.0,50.0,37.0,19.0,40.0,46.0,63.0,54.0,46.0,48.0,34.0,22.0,59.0,39.0,27.0,61.0,38.0,44.0,41.0,49.0,19.0,38.0,43.0,62.0,30.0,59.0,40.0,61.0,47.0,59.0,37.0,53.0,30.0,29.0,48.0,32.0,55.0,51.0,48.0,31.0,60.0,24.0,47.0,20.0,42.0,41.0
4
+ 0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.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,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
p1/preprocess/COVID-19/code/GSE185658.py ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE185658"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE185658"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE185658.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE185658.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE185658.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1) Determine if gene expression data is available
47
+ is_gene_available = True # From the background info (Affymetrix microarrays)
48
+
49
+ # 2) Identify data availability for trait, age, and gender.
50
+ # Based on the sample characteristics dictionary, none of these variables (COVID-19 status, age, gender)
51
+ # appear to be present, so we set row indices to None.
52
+ trait_row = None
53
+ age_row = None
54
+ gender_row = None
55
+
56
+ # 2) Define the conversion functions.
57
+ # Although we don't have actual data for these variables, these stubs must still be defined.
58
+ # The typical pattern is to parse the text after a colon (':') and return the processed value
59
+ # or None if there's no valid matching pattern.
60
+
61
+ def convert_trait(value: str):
62
+ # No COVID-19 data is present, so we simply return None.
63
+ return None
64
+
65
+ def convert_age(value: str):
66
+ # No age data is present, so return None.
67
+ return None
68
+
69
+ def convert_gender(value: str):
70
+ # No gender data is present, so return None.
71
+ return None
72
+
73
+ # 3) Conduct initial filtering with validate_and_save_cohort_info
74
+ # Trait data availability depends on trait_row; here trait_row is None => trait data not available.
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) Since trait_row is None, we skip clinical feature extraction.
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
+ print("Based on the given gene identifiers, they appear to be numeric platform IDs, not standard human gene symbols.")
93
+ print("requires_gene_mapping = True")
94
+ # STEP5
95
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
96
+ gene_annotation = get_gene_annotation(soft_file)
97
+
98
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
99
+ print("Gene annotation preview:")
100
+ print(preview_df(gene_annotation))
101
+ # STEP: Gene Identifier Mapping
102
+
103
+ # 1. Identify columns in 'gene_annotation' for mapping:
104
+ # - The probe identifier column matches the numeric IDs in 'gene_data' ("ID").
105
+ # - The gene symbol information is contained in "gene_assignment".
106
+ mapping_df = get_gene_mapping(
107
+ annotation=gene_annotation,
108
+ prob_col='ID',
109
+ gene_col='gene_assignment'
110
+ )
111
+
112
+ # 2. Convert probe-level measurements to gene-level by applying the mapping.
113
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
114
+
115
+ # For verification, print a brief preview of the resulting mapped gene data.
116
+ print("Mapped gene_data shape:", gene_data.shape)
117
+ print(gene_data.head(5))
118
+ import os
119
+ import pandas as pd
120
+
121
+ # STEP7: Data Normalization and Linking
122
+
123
+ # 1) Normalize the gene symbols in the previously obtained gene_data
124
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
125
+ normalized_gene_data.to_csv(out_gene_data_file)
126
+
127
+ # 2) Load clinical data only if it exists and is non-empty
128
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
129
+ # Read the file
130
+ clinical_temp = pd.read_csv(out_clinical_data_file)
131
+
132
+ # Adjust row index to label the trait, age, and gender properly
133
+ if clinical_temp.shape[0] == 3:
134
+ clinical_temp.index = [trait, "Age", "Gender"]
135
+ elif clinical_temp.shape[0] == 2:
136
+ clinical_temp.index = [trait, "Gender"]
137
+ elif clinical_temp.shape[0] == 1:
138
+ clinical_temp.index = [trait]
139
+
140
+ # 2) Link the clinical and normalized genetic data
141
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
142
+
143
+ # 3) Handle missing values
144
+ linked_data = handle_missing_values(linked_data, trait)
145
+
146
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
147
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
148
+
149
+ # 5) Final quality validation and save metadata
150
+ is_usable = validate_and_save_cohort_info(
151
+ is_final=True,
152
+ cohort=cohort,
153
+ info_path=json_path,
154
+ is_gene_available=True,
155
+ is_trait_available=True,
156
+ is_biased=trait_biased,
157
+ df=linked_data,
158
+ note=f"Final check on {cohort} with {trait}."
159
+ )
160
+
161
+ # 6) If the linked data is usable, save it
162
+ if is_usable:
163
+ linked_data.to_csv(out_data_file)
164
+ else:
165
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
166
+ is_usable = validate_and_save_cohort_info(
167
+ is_final=True,
168
+ cohort=cohort,
169
+ info_path=json_path,
170
+ is_gene_available=True,
171
+ is_trait_available=False,
172
+ is_biased=True, # Force a fallback so that it's flagged as unusable
173
+ df=pd.DataFrame(),
174
+ note=f"No trait data found for {cohort}, final metadata recorded."
175
+ )
176
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE211378.py ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE211378"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE211378"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE211378.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE211378.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE211378.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1. Decide if the dataset likely has gene expression data
47
+ # Based on background info about using nCounter technology and "Whole Blood profiling",
48
+ # it is likely to be gene expression. Set is_gene_available to True.
49
+ is_gene_available = True
50
+
51
+ # 2. Determine availability for trait, age, and gender, and define conversion functions.
52
+ # From the sample characteristics dictionary, there is no obvious row containing
53
+ # COVID vs Healthy status, no age, and no gender information. Hence, these rows are None.
54
+
55
+ trait_row = None
56
+ age_row = None
57
+ gender_row = None
58
+
59
+ def convert_trait(value: str) -> Optional[float]:
60
+ """
61
+ Convert trait value (COVID or Healthy) to binary:
62
+ - 1 for COVID
63
+ - 0 for Healthy
64
+ - None if unknown
65
+ """
66
+ # This dataset lacks explicit trait data; implement a placeholder logic.
67
+ # If we had the row, we would parse it here.
68
+ return None
69
+
70
+ def convert_age(value: str) -> Optional[float]:
71
+ """
72
+ Convert age-like value to float
73
+ - None if unknown
74
+ """
75
+ return None
76
+
77
+ def convert_gender(value: str) -> Optional[int]:
78
+ """
79
+ Convert gender to binary:
80
+ - 0 for female
81
+ - 1 for male
82
+ - None if unknown
83
+ """
84
+ return None
85
+
86
+ # 3. Conduct initial filtering and save dataset metadata
87
+ # Trait data is considered available if trait_row is not None.
88
+ is_trait_available = (trait_row is not None)
89
+
90
+ validate_and_save_cohort_info(
91
+ is_final=False,
92
+ cohort=cohort,
93
+ info_path=json_path,
94
+ is_gene_available=is_gene_available,
95
+ is_trait_available=is_trait_available
96
+ )
97
+
98
+ # 4. Because trait_row is None, we skip clinical feature extraction.
99
+ # No further steps.
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
+ print("requires_gene_mapping = False")
107
+ import os
108
+ import pandas as pd
109
+
110
+ # STEP7: Data Normalization and Linking
111
+
112
+ # 1) Normalize the gene symbols in the previously obtained gene_data
113
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
114
+ normalized_gene_data.to_csv(out_gene_data_file)
115
+
116
+ # 2) Load clinical data only if it exists and is non-empty
117
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
118
+ # Read the file
119
+ clinical_temp = pd.read_csv(out_clinical_data_file)
120
+
121
+ # Adjust row index to label the trait, age, and gender properly
122
+ if clinical_temp.shape[0] == 3:
123
+ clinical_temp.index = [trait, "Age", "Gender"]
124
+ elif clinical_temp.shape[0] == 2:
125
+ clinical_temp.index = [trait, "Gender"]
126
+ elif clinical_temp.shape[0] == 1:
127
+ clinical_temp.index = [trait]
128
+
129
+ # 2) Link the clinical and normalized genetic data
130
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
131
+
132
+ # 3) Handle missing values
133
+ linked_data = handle_missing_values(linked_data, trait)
134
+
135
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
136
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
137
+
138
+ # 5) Final quality validation and save metadata
139
+ is_usable = validate_and_save_cohort_info(
140
+ is_final=True,
141
+ cohort=cohort,
142
+ info_path=json_path,
143
+ is_gene_available=True,
144
+ is_trait_available=True,
145
+ is_biased=trait_biased,
146
+ df=linked_data,
147
+ note=f"Final check on {cohort} with {trait}."
148
+ )
149
+
150
+ # 6) If the linked data is usable, save it
151
+ if is_usable:
152
+ linked_data.to_csv(out_data_file)
153
+ else:
154
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
155
+ is_usable = validate_and_save_cohort_info(
156
+ is_final=True,
157
+ cohort=cohort,
158
+ info_path=json_path,
159
+ is_gene_available=True,
160
+ is_trait_available=False,
161
+ is_biased=True, # Force a fallback so that it's flagged as unusable
162
+ df=pd.DataFrame(),
163
+ note=f"No trait data found for {cohort}, final metadata recorded."
164
+ )
165
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE212865.py ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE212865"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE212865"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE212865.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE212865.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE212865.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1) Determine gene expression availability
47
+ is_gene_available = True # Based on the background info (transcriptomic profile).
48
+
49
+ # 2) Identify data availability for 'trait', 'age', and 'gender'
50
+ # and create conversion functions.
51
+
52
+ # The dictionary indicates row 0 has 'disease state' with multiple unique values.
53
+ # We interpret this as the 'COVID-19' trait availability.
54
+ trait_row = 0
55
+ age_row = None
56
+ gender_row = None
57
+
58
+ def convert_trait(x: str):
59
+ # Extract the portion after the colon
60
+ parts = x.split(':')
61
+ val = parts[-1].strip() if len(parts) > 1 else None
62
+ if val is None:
63
+ return None
64
+ # Map "Control" -> 0, "Covid19"/"Covid19_SDRA" -> 1, otherwise None
65
+ if val.lower() == 'control':
66
+ return 0
67
+ elif 'covid19' in val.lower():
68
+ return 1
69
+ else:
70
+ return None
71
+
72
+ def convert_age(x: str):
73
+ # Not available, return None
74
+ return None
75
+
76
+ def convert_gender(x: str):
77
+ # Not available, return None
78
+ return None
79
+
80
+ # 3) Initial filtering and saving metadata
81
+ is_trait_available = (trait_row is not None)
82
+ is_usable = validate_and_save_cohort_info(
83
+ is_final=False,
84
+ cohort=cohort,
85
+ info_path=json_path,
86
+ is_gene_available=is_gene_available,
87
+ is_trait_available=is_trait_available
88
+ )
89
+
90
+ # 4) If trait data is available, extract clinical features, preview, and save
91
+ if trait_row is not None:
92
+ selected_clinical_df = geo_select_clinical_features(
93
+ clinical_data,
94
+ trait=trait,
95
+ trait_row=trait_row,
96
+ convert_trait=convert_trait,
97
+ age_row=age_row,
98
+ convert_age=convert_age,
99
+ gender_row=gender_row,
100
+ convert_gender=convert_gender
101
+ )
102
+ print(preview_df(selected_clinical_df, n=5))
103
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
104
+ # STEP3
105
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
106
+ gene_data = get_genetic_data(matrix_file)
107
+
108
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
109
+ print(gene_data.index[:20])
110
+ # The gene identifiers shown (e.g., '23064070', '23064071', ...) are numeric probe IDs,
111
+ # which are not standard human gene symbols.
112
+ # Therefore, we conclude that gene mapping is required.
113
+ print("requires_gene_mapping = True")
114
+ # STEP5
115
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
116
+ gene_annotation = get_gene_annotation(soft_file)
117
+
118
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
119
+ print("Gene annotation preview:")
120
+ print(preview_df(gene_annotation))
121
+ # STEP6 : Gene Identifier Mapping
122
+
123
+ # We reject the reviewer's recommendation and keep our original approach:
124
+ # We'll assume "ID" column in annotation matches the "ID" index in gene_data
125
+ # and "SPOT_ID.1" contains the gene symbol information.
126
+
127
+ prob_col = 'ID'
128
+ gene_col = 'SPOT_ID.1'
129
+
130
+ # 2. Get a gene mapping dataframe by extracting these two columns
131
+ mapping_df = get_gene_mapping(gene_annotation, prob_col=prob_col, gene_col=gene_col)
132
+
133
+ # 3. Convert probe-level measurements to gene-level data
134
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
135
+ import os
136
+ import pandas as pd
137
+
138
+ # STEP7: Data Normalization and Linking
139
+
140
+ # 1) Normalize the gene symbols in the previously obtained gene_data
141
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
142
+ normalized_gene_data.to_csv(out_gene_data_file)
143
+
144
+ # 2) Load clinical data only if it exists and is non-empty
145
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
146
+ # Read the file
147
+ clinical_temp = pd.read_csv(out_clinical_data_file)
148
+
149
+ # Adjust row index to label the trait, age, and gender properly
150
+ if clinical_temp.shape[0] == 3:
151
+ clinical_temp.index = [trait, "Age", "Gender"]
152
+ elif clinical_temp.shape[0] == 2:
153
+ clinical_temp.index = [trait, "Gender"]
154
+ elif clinical_temp.shape[0] == 1:
155
+ clinical_temp.index = [trait]
156
+
157
+ # 2) Link the clinical and normalized genetic data
158
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
159
+
160
+ # 3) Handle missing values
161
+ linked_data = handle_missing_values(linked_data, trait)
162
+
163
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
164
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
165
+
166
+ # 5) Final quality validation and save metadata
167
+ is_usable = validate_and_save_cohort_info(
168
+ is_final=True,
169
+ cohort=cohort,
170
+ info_path=json_path,
171
+ is_gene_available=True,
172
+ is_trait_available=True,
173
+ is_biased=trait_biased,
174
+ df=linked_data,
175
+ note=f"Final check on {cohort} with {trait}."
176
+ )
177
+
178
+ # 6) If the linked data is usable, save it
179
+ if is_usable:
180
+ linked_data.to_csv(out_data_file)
181
+ else:
182
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
183
+ is_usable = validate_and_save_cohort_info(
184
+ is_final=True,
185
+ cohort=cohort,
186
+ info_path=json_path,
187
+ is_gene_available=True,
188
+ is_trait_available=False,
189
+ is_biased=True, # Force a fallback so that it's flagged as unusable
190
+ df=pd.DataFrame(),
191
+ note=f"No trait data found for {cohort}, final metadata recorded."
192
+ )
193
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE212866.py ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE212866"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE212866"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE212866.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE212866.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE212866.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # Step 1: Determine gene expression data availability
47
+ is_gene_available = True # Based on the title and summary, this dataset likely has microarray gene expression data.
48
+
49
+ # Step 2: Identify rows for trait, age, and gender; define conversion functions
50
+ trait_row = 0 # "disease state: Control / Covid19 / Covid19_SDRA"
51
+ age_row = None # Not found
52
+ gender_row = None # Not found
53
+
54
+ def convert_trait(value: str):
55
+ parts = value.split(":")
56
+ if len(parts) > 1:
57
+ val = parts[1].strip().lower()
58
+ if val == "control":
59
+ return 0
60
+ elif val in ["covid19", "covid19_sdra"]:
61
+ return 1
62
+ return None
63
+
64
+ def convert_age(value: str):
65
+ return None # Not available in this dataset
66
+
67
+ def convert_gender(value: str):
68
+ return None # Not available in this dataset
69
+
70
+ # Step 3: Conduct initial filtering and save metadata
71
+ is_usable = validate_and_save_cohort_info(
72
+ is_final=False,
73
+ cohort=cohort,
74
+ info_path=json_path,
75
+ is_gene_available=is_gene_available,
76
+ is_trait_available=(trait_row is not None)
77
+ )
78
+
79
+ # Step 4: Extract clinical features if trait data is available
80
+ if trait_row is not None:
81
+ clinical_features_df = geo_select_clinical_features(
82
+ clinical_data,
83
+ trait=trait,
84
+ trait_row=trait_row,
85
+ convert_trait=convert_trait,
86
+ age_row=age_row,
87
+ convert_age=convert_age,
88
+ gender_row=gender_row,
89
+ convert_gender=convert_gender
90
+ )
91
+ preview = preview_df(clinical_features_df)
92
+ print(preview)
93
+ clinical_features_df.to_csv(out_clinical_data_file, index=False)
94
+ # STEP3
95
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
96
+ gene_data = get_genetic_data(matrix_file)
97
+
98
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
99
+ print(gene_data.index[:20])
100
+ # Observing the provided identifiers (e.g., '23064070', '23064071'), they are numeric accession-like IDs
101
+ # and not standard human gene symbols. Therefore, they require mapping to gene symbols.
102
+
103
+ requires_gene_mapping = True
104
+ # STEP5
105
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
106
+ gene_annotation = get_gene_annotation(soft_file)
107
+
108
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
109
+ print("Gene annotation preview:")
110
+ print(preview_df(gene_annotation))
111
+ # STEP 6: Gene Identifier Mapping
112
+
113
+ # After reviewing the annotation preview, it appears there is no direct column in the annotation
114
+ # matching the numeric IDs (e.g., "23064070") from the expression data. For demonstration,
115
+ # we will attempt to match "probeset_id" with these numeric IDs, acknowledging that this merge
116
+ # may end up producing an empty result due to the mismatch in formats.
117
+
118
+ prob_col = "probeset_id" # Column possibly representing probe IDs (though they look different from gene_data.index)
119
+ gene_col = "SPOT_ID.1" # Column possibly containing gene symbol or gene-related info
120
+
121
+ # 1. Create a gene mapping dataframe. We rename prob_col -> "ID" so the library function won't fail
122
+ # when calling .astype({'ID': 'str'}).
123
+ gene_mapping_df = gene_annotation.loc[:, [prob_col, gene_col]].dropna()
124
+ gene_mapping_df = gene_mapping_df.rename(columns={prob_col: 'ID', gene_col: 'Gene'}).astype({'ID': 'str'})
125
+
126
+ # 2. Convert probe-level measurements to gene expression data using the mapping
127
+ gene_data = apply_gene_mapping(gene_data, gene_mapping_df)
128
+ import os
129
+ import pandas as pd
130
+
131
+ # STEP7: Data Normalization and Linking
132
+
133
+ # 1) Normalize the gene symbols in the previously obtained gene_data
134
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
135
+ normalized_gene_data.to_csv(out_gene_data_file)
136
+
137
+ # 2) Load clinical data only if it exists and is non-empty
138
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
139
+ # Read the file
140
+ clinical_temp = pd.read_csv(out_clinical_data_file)
141
+
142
+ # Adjust row index to label the trait, age, and gender properly
143
+ if clinical_temp.shape[0] == 3:
144
+ clinical_temp.index = [trait, "Age", "Gender"]
145
+ elif clinical_temp.shape[0] == 2:
146
+ clinical_temp.index = [trait, "Gender"]
147
+ elif clinical_temp.shape[0] == 1:
148
+ clinical_temp.index = [trait]
149
+
150
+ # 2) Link the clinical and normalized genetic data
151
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
152
+
153
+ # 3) Handle missing values
154
+ linked_data = handle_missing_values(linked_data, trait)
155
+
156
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
157
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
158
+
159
+ # 5) Final quality validation and save metadata
160
+ is_usable = validate_and_save_cohort_info(
161
+ is_final=True,
162
+ cohort=cohort,
163
+ info_path=json_path,
164
+ is_gene_available=True,
165
+ is_trait_available=True,
166
+ is_biased=trait_biased,
167
+ df=linked_data,
168
+ note=f"Final check on {cohort} with {trait}."
169
+ )
170
+
171
+ # 6) If the linked data is usable, save it
172
+ if is_usable:
173
+ linked_data.to_csv(out_data_file)
174
+ else:
175
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
176
+ is_usable = validate_and_save_cohort_info(
177
+ is_final=True,
178
+ cohort=cohort,
179
+ info_path=json_path,
180
+ is_gene_available=True,
181
+ is_trait_available=False,
182
+ is_biased=True, # Force a fallback so that it's flagged as unusable
183
+ df=pd.DataFrame(),
184
+ note=f"No trait data found for {cohort}, final metadata recorded."
185
+ )
186
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE213313.py ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE213313"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE213313"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE213313.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE213313.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE213313.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1. Gene Expression Data Availability
47
+ is_gene_available = True # Based on the background, microarray gene expression data is likely available.
48
+
49
+ # 2. Variable Availability and Data Type Conversion
50
+ # From the sample characteristics dictionary, we observe the 'disease state' values at key=1
51
+ # ("COVID-19" vs "Healthy"), so we set trait_row=1.
52
+ # We do not see any rows containing age or gender information, so those are None.
53
+ trait_row = 1
54
+ age_row = None
55
+ gender_row = None
56
+
57
+ # Define conversion functions
58
+ def convert_trait(value: str):
59
+ parts = value.split(':', 1)
60
+ if len(parts) < 2:
61
+ return None
62
+ val = parts[1].strip().lower()
63
+ if val == 'covid-19':
64
+ return 1
65
+ elif val == 'healthy':
66
+ return 0
67
+ return None
68
+
69
+ def convert_age(value: str):
70
+ return None # No age data available
71
+
72
+ def convert_gender(value: str):
73
+ return None # No gender data available
74
+
75
+ # 3. Save Metadata (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. Clinical Feature Extraction (only if trait_row is not None)
86
+ if trait_row is not None:
87
+ selected_clinical_df = geo_select_clinical_features(
88
+ clinical_df=clinical_data,
89
+ trait=trait,
90
+ trait_row=trait_row,
91
+ convert_trait=convert_trait,
92
+ age_row=age_row,
93
+ convert_age=convert_age,
94
+ gender_row=gender_row,
95
+ convert_gender=convert_gender
96
+ )
97
+ preview = preview_df(selected_clinical_df, n=5, max_items=200)
98
+ print("Preview of selected clinical features:", preview)
99
+ selected_clinical_df.to_csv(out_clinical_data_file)
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
+ print("requires_gene_mapping = True")
107
+ # STEP5
108
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
109
+ gene_annotation = get_gene_annotation(soft_file)
110
+
111
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
112
+ print("Gene annotation preview:")
113
+ print(preview_df(gene_annotation))
114
+ # STEP 6: Gene Identifier Mapping
115
+
116
+ # 1. Identify the columns for probe IDs and gene symbols.
117
+ # - From the annotation preview, "ID" matches the probe IDs in the expression data,
118
+ # and "GENE_SYMBOL" holds the gene symbols.
119
+
120
+ # 2. Create a gene mapping dataframe using get_gene_mapping
121
+ mapping_df = get_gene_mapping(
122
+ annotation=gene_annotation,
123
+ prob_col="ID",
124
+ gene_col="GENE_SYMBOL"
125
+ )
126
+
127
+ # 3. Apply the mapping to convert probe-level measurements to gene-level expression
128
+ gene_data = apply_gene_mapping(expression_df=gene_data, mapping_df=mapping_df)
129
+ import os
130
+ import pandas as pd
131
+
132
+ # STEP7: Data Normalization and Linking
133
+
134
+ # 1) Normalize the gene symbols in the previously obtained gene_data
135
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
136
+ normalized_gene_data.to_csv(out_gene_data_file)
137
+
138
+ # 2) Load clinical data only if it exists and is non-empty
139
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
140
+ # Read the file
141
+ clinical_temp = pd.read_csv(out_clinical_data_file)
142
+
143
+ # Adjust row index to label the trait, age, and gender properly
144
+ if clinical_temp.shape[0] == 3:
145
+ clinical_temp.index = [trait, "Age", "Gender"]
146
+ elif clinical_temp.shape[0] == 2:
147
+ clinical_temp.index = [trait, "Gender"]
148
+ elif clinical_temp.shape[0] == 1:
149
+ clinical_temp.index = [trait]
150
+
151
+ # 2) Link the clinical and normalized genetic data
152
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
153
+
154
+ # 3) Handle missing values
155
+ linked_data = handle_missing_values(linked_data, trait)
156
+
157
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
158
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
159
+
160
+ # 5) Final quality validation and save metadata
161
+ is_usable = 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=True,
167
+ is_biased=trait_biased,
168
+ df=linked_data,
169
+ note=f"Final check on {cohort} with {trait}."
170
+ )
171
+
172
+ # 6) If the linked data is usable, save it
173
+ if is_usable:
174
+ linked_data.to_csv(out_data_file)
175
+ else:
176
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
177
+ is_usable = validate_and_save_cohort_info(
178
+ is_final=True,
179
+ cohort=cohort,
180
+ info_path=json_path,
181
+ is_gene_available=True,
182
+ is_trait_available=False,
183
+ is_biased=True, # Force a fallback so that it's flagged as unusable
184
+ df=pd.DataFrame(),
185
+ note=f"No trait data found for {cohort}, final metadata recorded."
186
+ )
187
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE216705.py ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE216705"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE216705"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE216705.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE216705.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE216705.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # Step 1: Determine if the dataset contains gene expression data
47
+ is_gene_available = True # Based on "metaData_microarrays.txt", this is likely microarray gene expression data
48
+
49
+ # Step 2: Identify availability of trait, age, and gender data
50
+ # Since the sample characteristics only have "strain" and "metadata info" with no variation or mention of these variables,
51
+ # treat them all as not available.
52
+ trait_row = None
53
+ age_row = None
54
+ gender_row = None
55
+
56
+ # Step 2.2: Define the data conversion functions (though they won't be used here because the rows are None)
57
+ def convert_trait(x: str):
58
+ # For demonstration, parse after colon; return 1 if "COVID-19" is found, else 0, else None.
59
+ parts = x.split(':', 1)
60
+ value = parts[1].strip() if len(parts) > 1 else x
61
+ if "COVID-19" in value.lower():
62
+ return 1
63
+ return None
64
+
65
+ def convert_age(x: str):
66
+ # Convert to continuous age. We do not have actual data, so return None.
67
+ return None
68
+
69
+ def convert_gender(x: str):
70
+ # Convert to binary: female -> 0, male -> 1. Return None by default here.
71
+ return None
72
+
73
+ # Step 3: Conduct initial filtering and save metadata
74
+ # Trait data is considered available only if trait_row is not None.
75
+ is_trait_available = (trait_row is not None)
76
+
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
+ # Step 4: Since trait_row is None, we skip clinical feature extraction.
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
+ # The given identifiers (e.g. "10338001", "10338002") are typically probe IDs from a microarray platform.
93
+ # They do not look like standard human gene symbols such as "TP53" or "ACTB".
94
+ # Therefore, gene mapping to standard symbols is required.
95
+
96
+ print("requires_gene_mapping = True")
97
+ # STEP5
98
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
99
+ gene_annotation = get_gene_annotation(soft_file)
100
+
101
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
102
+ print("Gene annotation preview:")
103
+ print(preview_df(gene_annotation))
104
+ # STEP: Gene Identifier Mapping
105
+
106
+ # 1. Identify the columns in the gene_annotation DataFrame where 'ID' matches the probe identifiers
107
+ # and 'gene_assignment' contains the gene symbols or descriptive info to be parsed.
108
+ prob_col = "ID"
109
+ gene_col = "gene_assignment"
110
+
111
+ # 2. Get a DataFrame mapping from probe IDs to gene symbols
112
+ mapping_df = get_gene_mapping(gene_annotation, prob_col, gene_col)
113
+
114
+ # 3. Convert probe-level measurements to gene-level expression
115
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
116
+ import os
117
+ import pandas as pd
118
+
119
+ # STEP7: Data Normalization and Linking
120
+
121
+ # 1) Normalize the gene symbols in the previously obtained gene_data
122
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
123
+ normalized_gene_data.to_csv(out_gene_data_file)
124
+
125
+ # 2) Load clinical data only if it exists and is non-empty
126
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
127
+ # Read the file
128
+ clinical_temp = pd.read_csv(out_clinical_data_file)
129
+
130
+ # Adjust row index to label the trait, age, and gender properly
131
+ if clinical_temp.shape[0] == 3:
132
+ clinical_temp.index = [trait, "Age", "Gender"]
133
+ elif clinical_temp.shape[0] == 2:
134
+ clinical_temp.index = [trait, "Gender"]
135
+ elif clinical_temp.shape[0] == 1:
136
+ clinical_temp.index = [trait]
137
+
138
+ # 2) Link the clinical and normalized genetic data
139
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
140
+
141
+ # 3) Handle missing values
142
+ linked_data = handle_missing_values(linked_data, trait)
143
+
144
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
145
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
146
+
147
+ # 5) Final quality validation and save metadata
148
+ is_usable = validate_and_save_cohort_info(
149
+ is_final=True,
150
+ cohort=cohort,
151
+ info_path=json_path,
152
+ is_gene_available=True,
153
+ is_trait_available=True,
154
+ is_biased=trait_biased,
155
+ df=linked_data,
156
+ note=f"Final check on {cohort} with {trait}."
157
+ )
158
+
159
+ # 6) If the linked data is usable, save it
160
+ if is_usable:
161
+ linked_data.to_csv(out_data_file)
162
+ else:
163
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
164
+ is_usable = validate_and_save_cohort_info(
165
+ is_final=True,
166
+ cohort=cohort,
167
+ info_path=json_path,
168
+ is_gene_available=True,
169
+ is_trait_available=False,
170
+ is_biased=True, # Force a fallback so that it's flagged as unusable
171
+ df=pd.DataFrame(),
172
+ note=f"No trait data found for {cohort}, final metadata recorded."
173
+ )
174
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE227080.py ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE227080"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE227080"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE227080.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE227080.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE227080.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1. Determine if gene expression data is available.
47
+ # Based on the background info, NanoString nCounter (Immunology panel) measures gene expression:
48
+ is_gene_available = True
49
+
50
+ # 2. Identify the row keys for trait, age, and gender from the sample characteristics dictionary:
51
+ trait_row = 2 # 'severity: MILD', 'severity: MOD_SEV', 'severity: NEG'
52
+ age_row = 1 # 'age: 38', 'age: 66', ...
53
+ gender_row = 0 # 'gender: F', 'gender: M'
54
+
55
+ # 2.1 Data Availability:
56
+ # These rows exist and contain multiple unique values, so they are considered available.
57
+ # If a row did not exist or had only one unique value, we would set it to None.
58
+
59
+ # 2.2 Create conversion functions for each variable:
60
+
61
+ def convert_trait(x: str):
62
+ """
63
+ Convert 'severity' info to a binary variable:
64
+ - 'severity: MILD' or 'severity: MOD_SEV' => 1
65
+ - 'severity: NEG' => 0
66
+ - Otherwise => None
67
+ """
68
+ parts = x.split(':', 1)
69
+ if len(parts) < 2:
70
+ return None
71
+ val = parts[1].strip().upper()
72
+
73
+ if val in ['MILD', 'MOD_SEV']:
74
+ return 1
75
+ elif val == 'NEG':
76
+ return 0
77
+ else:
78
+ return None
79
+
80
+ def convert_age(x: str):
81
+ """
82
+ Convert 'age: number' to integer.
83
+ If parsing fails, return None.
84
+ """
85
+ parts = x.split(':', 1)
86
+ if len(parts) < 2:
87
+ return None
88
+ val = parts[1].strip()
89
+ try:
90
+ return float(val)
91
+ except ValueError:
92
+ return None
93
+
94
+ def convert_gender(x: str):
95
+ """
96
+ Convert 'gender: F' => 0, 'gender: M' => 1.
97
+ Unknown => None
98
+ """
99
+ parts = x.split(':', 1)
100
+ if len(parts) < 2:
101
+ return None
102
+ val = parts[1].strip().upper()
103
+ if val == 'F':
104
+ return 0
105
+ elif val == 'M':
106
+ return 1
107
+ else:
108
+ return None
109
+
110
+ # 3. Save metadata with initial filtering
111
+ is_trait_available = (trait_row is not None)
112
+
113
+ is_usable = validate_and_save_cohort_info(
114
+ is_final=False,
115
+ cohort=cohort,
116
+ info_path=json_path,
117
+ is_gene_available=is_gene_available,
118
+ is_trait_available=is_trait_available
119
+ )
120
+
121
+ # 4. If trait_row is not None, extract clinical features, preview, and save.
122
+ if trait_row is not None:
123
+ # 'clinical_data' is assumed to be the DataFrame with sample characteristics.
124
+ df_clinical = geo_select_clinical_features(
125
+ clinical_df=clinical_data,
126
+ trait=trait,
127
+ trait_row=trait_row,
128
+ convert_trait=convert_trait,
129
+ age_row=age_row,
130
+ convert_age=convert_age,
131
+ gender_row=gender_row,
132
+ convert_gender=convert_gender
133
+ )
134
+ # Preview the resulting clinical DataFrame
135
+ preview = preview_df(df_clinical)
136
+ print("Preview of clinical features:\n", preview)
137
+
138
+ # Save the clinical DataFrame to CSV
139
+ df_clinical.to_csv(out_clinical_data_file, index=False)
140
+ # STEP3
141
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
142
+ gene_data = get_genetic_data(matrix_file)
143
+
144
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
145
+ print(gene_data.index[:20])
146
+ # Based on the gene identifiers, they appear to be official human gene symbols.
147
+ # Therefore, no further mapping is required.
148
+ requires_gene_mapping = False
149
+ import os
150
+ import pandas as pd
151
+
152
+ # STEP7: Data Normalization and Linking
153
+
154
+ # 1) Normalize the gene symbols in the previously obtained gene_data
155
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
156
+ normalized_gene_data.to_csv(out_gene_data_file)
157
+
158
+ # 2) Load clinical data only if it exists and is non-empty
159
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
160
+ # Read the file
161
+ clinical_temp = pd.read_csv(out_clinical_data_file)
162
+
163
+ # Adjust row index to label the trait, age, and gender properly
164
+ if clinical_temp.shape[0] == 3:
165
+ clinical_temp.index = [trait, "Age", "Gender"]
166
+ elif clinical_temp.shape[0] == 2:
167
+ clinical_temp.index = [trait, "Gender"]
168
+ elif clinical_temp.shape[0] == 1:
169
+ clinical_temp.index = [trait]
170
+
171
+ # 2) Link the clinical and normalized genetic data
172
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
173
+
174
+ # 3) Handle missing values
175
+ linked_data = handle_missing_values(linked_data, trait)
176
+
177
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
178
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
179
+
180
+ # 5) Final quality validation and save metadata
181
+ is_usable = validate_and_save_cohort_info(
182
+ is_final=True,
183
+ cohort=cohort,
184
+ info_path=json_path,
185
+ is_gene_available=True,
186
+ is_trait_available=True,
187
+ is_biased=trait_biased,
188
+ df=linked_data,
189
+ note=f"Final check on {cohort} with {trait}."
190
+ )
191
+
192
+ # 6) If the linked data is usable, save it
193
+ if is_usable:
194
+ linked_data.to_csv(out_data_file)
195
+ else:
196
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
197
+ is_usable = 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=True, # Force a fallback so that it's flagged as unusable
204
+ df=pd.DataFrame(),
205
+ note=f"No trait data found for {cohort}, final metadata recorded."
206
+ )
207
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE243348.py ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE243348"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE243348"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE243348.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE243348.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE243348.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1. Determine gene expression data availability
47
+ is_gene_available = True # Based on the presence of "host response genes" (mRNA profiling) in the series summary
48
+
49
+ # 2. Check variable availability and prepare conversion functions
50
+ # 2.1 Identify the rows where the trait, age, and gender data appear
51
+ trait_row = 0 # "disease status: COVID-19+" or "disease status: Healthy uninfected"
52
+ age_row = 3 # "age: XX"
53
+ gender_row = 2 # "Sex: female" or "Sex: male"
54
+
55
+ # 2.2 Create conversion functions
56
+
57
+ def convert_trait(raw_value: str):
58
+ """
59
+ Convert raw trait value to binary (COVID-19+ => 1, Healthy => 0).
60
+ """
61
+ if not isinstance(raw_value, str):
62
+ return None
63
+ parts = raw_value.split(":", 1)
64
+ if len(parts) < 2:
65
+ return None
66
+ val = parts[1].strip().lower()
67
+ if val == "covid-19+":
68
+ return 1
69
+ elif val == "healthy uninfected":
70
+ return 0
71
+ return None
72
+
73
+ def convert_age(raw_value: str):
74
+ """
75
+ Convert raw age value to a continuous variable.
76
+ """
77
+ if not isinstance(raw_value, str):
78
+ return None
79
+ parts = raw_value.split(":", 1)
80
+ if len(parts) < 2:
81
+ return None
82
+ val = parts[1].strip()
83
+ try:
84
+ return float(val)
85
+ except ValueError:
86
+ return None
87
+
88
+ def convert_gender(raw_value: str):
89
+ """
90
+ Convert raw gender value to binary (female => 0, male => 1).
91
+ """
92
+ if not isinstance(raw_value, str):
93
+ return None
94
+ parts = raw_value.split(":", 1)
95
+ if len(parts) < 2:
96
+ return None
97
+ val = parts[1].strip().lower()
98
+ if val == "female":
99
+ return 0
100
+ elif val == "male":
101
+ return 1
102
+ return None
103
+
104
+ # Assume trait data is available if trait_row is not None
105
+ is_trait_available = (trait_row is not None)
106
+
107
+ # 3. Conduct initial filtering and save metadata
108
+ _ = validate_and_save_cohort_info(
109
+ is_final=False,
110
+ cohort=cohort,
111
+ info_path=json_path,
112
+ is_gene_available=is_gene_available,
113
+ is_trait_available=is_trait_available
114
+ )
115
+
116
+ # 4. Clinical feature extraction only if trait_row is not None
117
+ if trait_row is not None:
118
+ # 'clinical_data' is assumed to be the DataFrame obtained from a previous step
119
+ selected_clinical_df = geo_select_clinical_features(
120
+ clinical_df=clinical_data,
121
+ trait=trait,
122
+ trait_row=trait_row,
123
+ convert_trait=convert_trait,
124
+ age_row=age_row,
125
+ convert_age=convert_age,
126
+ gender_row=gender_row,
127
+ convert_gender=convert_gender
128
+ )
129
+
130
+ # Preview and save
131
+ preview = preview_df(selected_clinical_df)
132
+ print("Preview of selected clinical features:", preview)
133
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
134
+ # STEP3
135
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
136
+ gene_data = get_genetic_data(matrix_file)
137
+
138
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
139
+ print(gene_data.index[:20])
140
+ # Based on biomedical knowledge, these identifiers (e.g., "ACE", "ACKR2", "ACSL1", "AKT1") are known human gene symbols.
141
+ print("They appear to be recognized human gene symbols.")
142
+ print("requires_gene_mapping = False")
143
+ import os
144
+ import pandas as pd
145
+
146
+ # STEP7: Data Normalization and Linking
147
+
148
+ # 1) Normalize the gene symbols in the previously obtained gene_data
149
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
150
+ normalized_gene_data.to_csv(out_gene_data_file)
151
+
152
+ # 2) Load clinical data only if it exists and is non-empty
153
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
154
+ # Read the file
155
+ clinical_temp = pd.read_csv(out_clinical_data_file)
156
+
157
+ # Adjust row index to label the trait, age, and gender properly
158
+ if clinical_temp.shape[0] == 3:
159
+ clinical_temp.index = [trait, "Age", "Gender"]
160
+ elif clinical_temp.shape[0] == 2:
161
+ clinical_temp.index = [trait, "Gender"]
162
+ elif clinical_temp.shape[0] == 1:
163
+ clinical_temp.index = [trait]
164
+
165
+ # 2) Link the clinical and normalized genetic data
166
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
167
+
168
+ # 3) Handle missing values
169
+ linked_data = handle_missing_values(linked_data, trait)
170
+
171
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
172
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
173
+
174
+ # 5) Final quality validation and save metadata
175
+ is_usable = validate_and_save_cohort_info(
176
+ is_final=True,
177
+ cohort=cohort,
178
+ info_path=json_path,
179
+ is_gene_available=True,
180
+ is_trait_available=True,
181
+ is_biased=trait_biased,
182
+ df=linked_data,
183
+ note=f"Final check on {cohort} with {trait}."
184
+ )
185
+
186
+ # 6) If the linked data is usable, save it
187
+ if is_usable:
188
+ linked_data.to_csv(out_data_file)
189
+ else:
190
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
191
+ is_usable = validate_and_save_cohort_info(
192
+ is_final=True,
193
+ cohort=cohort,
194
+ info_path=json_path,
195
+ is_gene_available=True,
196
+ is_trait_available=False,
197
+ is_biased=True, # Force a fallback so that it's flagged as unusable
198
+ df=pd.DataFrame(),
199
+ note=f"No trait data found for {cohort}, final metadata recorded."
200
+ )
201
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE273225.py ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE273225"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE273225"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE273225.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE273225.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE273225.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1. Gene Expression Data Availability
47
+ is_gene_available = True # Since the dataset clearly involves transcriptome profiling
48
+
49
+ # 2.1 Variable Availability
50
+ # There is no row containing data about "COVID-19" status, so trait data is not available.
51
+ trait_row = None
52
+
53
+ # Donor age is found in row 3 (with multiple unique values)
54
+ age_row = 3
55
+
56
+ # Donor gender is found in row 4
57
+ gender_row = 4
58
+
59
+ # 2.2 Data Type Conversion
60
+ def convert_trait(value: str):
61
+ # Trait data is not available for this dataset, so return None
62
+ return None
63
+
64
+ def convert_age(value: str):
65
+ """
66
+ Convert donor age to float.
67
+ Example input: "donor age (y): 51"
68
+ """
69
+ parts = value.split(":")
70
+ if len(parts) < 2:
71
+ return None
72
+ try:
73
+ return float(parts[1].strip())
74
+ except ValueError:
75
+ return None
76
+
77
+ def convert_gender(value: str):
78
+ """
79
+ Convert donor sex to binary.
80
+ female -> 0
81
+ male -> 1
82
+ Example input: "donor sex: female"
83
+ """
84
+ parts = value.split(":")
85
+ if len(parts) < 2:
86
+ return None
87
+ gender_str = parts[1].strip().lower()
88
+ if gender_str == "female":
89
+ return 0
90
+ elif gender_str == "male":
91
+ return 1
92
+ else:
93
+ return None
94
+
95
+ # 3. Save Metadata (initial filtering)
96
+ is_trait_available = (trait_row is not None)
97
+ is_usable = validate_and_save_cohort_info(
98
+ is_final=False,
99
+ cohort=cohort,
100
+ info_path=json_path,
101
+ is_gene_available=is_gene_available,
102
+ is_trait_available=is_trait_available
103
+ )
104
+
105
+ # 4. Since trait_row is None, skip clinical feature extraction.
106
+ # STEP3
107
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
108
+ gene_data = get_genetic_data(matrix_file)
109
+
110
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
111
+ print(gene_data.index[:20])
112
+ # Based on inspection, these identifiers appear to be human gene symbols (HGNC).
113
+ # They do not require additional mapping to standard gene symbols.
114
+ requires_gene_mapping = False
115
+ import os
116
+ import pandas as pd
117
+
118
+ # STEP7: Data Normalization and Linking
119
+
120
+ # 1) Normalize the gene symbols in the previously obtained gene_data
121
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
122
+ normalized_gene_data.to_csv(out_gene_data_file)
123
+
124
+ # 2) Load clinical data only if it exists and is non-empty
125
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
126
+ # Read the file
127
+ clinical_temp = pd.read_csv(out_clinical_data_file)
128
+
129
+ # Adjust row index to label the trait, age, and gender properly
130
+ if clinical_temp.shape[0] == 3:
131
+ clinical_temp.index = [trait, "Age", "Gender"]
132
+ elif clinical_temp.shape[0] == 2:
133
+ clinical_temp.index = [trait, "Gender"]
134
+ elif clinical_temp.shape[0] == 1:
135
+ clinical_temp.index = [trait]
136
+
137
+ # 2) Link the clinical and normalized genetic data
138
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
139
+
140
+ # 3) Handle missing values
141
+ linked_data = handle_missing_values(linked_data, trait)
142
+
143
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
144
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
145
+
146
+ # 5) Final quality validation and save metadata
147
+ is_usable = validate_and_save_cohort_info(
148
+ is_final=True,
149
+ cohort=cohort,
150
+ info_path=json_path,
151
+ is_gene_available=True,
152
+ is_trait_available=True,
153
+ is_biased=trait_biased,
154
+ df=linked_data,
155
+ note=f"Final check on {cohort} with {trait}."
156
+ )
157
+
158
+ # 6) If the linked data is usable, save it
159
+ if is_usable:
160
+ linked_data.to_csv(out_data_file)
161
+ else:
162
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
163
+ is_usable = validate_and_save_cohort_info(
164
+ is_final=True,
165
+ cohort=cohort,
166
+ info_path=json_path,
167
+ is_gene_available=True,
168
+ is_trait_available=False,
169
+ is_biased=True, # Force a fallback so that it's flagged as unusable
170
+ df=pd.DataFrame(),
171
+ note=f"No trait data found for {cohort}, final metadata recorded."
172
+ )
173
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/GSE275334.py ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+ cohort = "GSE275334"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/COVID-19"
10
+ in_cohort_dir = "../DATA/GEO/COVID-19/GSE275334"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/COVID-19/GSE275334.csv"
14
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/GSE275334.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/GSE275334.csv"
16
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
17
+
18
+ # STEP1
19
+ from tools.preprocess import *
20
+
21
+ # 1. Attempt to identify the paths to the SOFT file and the matrix file
22
+ try:
23
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
24
+ except AssertionError:
25
+ print("[WARNING] Could not find the expected '.soft' or '.matrix' files in the directory.")
26
+ soft_file, matrix_file = None, None
27
+
28
+ if soft_file is None or matrix_file is None:
29
+ print("[ERROR] Required GEO files are missing. Please check file names in the cohort directory.")
30
+ else:
31
+ # 2. Read the matrix file to obtain background information and sample characteristics data
32
+ background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
33
+ clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
34
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file,
35
+ background_prefixes,
36
+ clinical_prefixes)
37
+
38
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
39
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
40
+
41
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
42
+ print("Background Information:")
43
+ print(background_info)
44
+ print("\nSample Characteristics Dictionary:")
45
+ print(sample_characteristics_dict)
46
+ # 1. Decide if gene expression data is available
47
+ is_gene_available = True # from the background info: NanoString Immune Exhaustion gene expression panel is used
48
+
49
+ # 2. Identify availability and conversion for trait, age, and gender
50
+ trait_row = 3 # "disease: Healthy control", "disease: Long COVID", "disease: ME/CFS"
51
+ age_row = 1 # "age (years): 24", "age (years): 46", ...
52
+ gender_row = 2 # "Sex: Female", "Sex: Male"
53
+
54
+ # Define data type conversion functions
55
+ def convert_trait(raw_val: str):
56
+ """
57
+ Convert the disease field to a binary indicator for COVID-19:
58
+ 1 if 'Long COVID', 0 if 'Healthy control' or 'ME/CFS'.
59
+ """
60
+ parts = raw_val.split(':', 1)
61
+ if len(parts) > 1:
62
+ value = parts[1].strip().lower()
63
+ if value == "long covid":
64
+ return 1
65
+ elif value in ["healthy control", "me/cfs"]:
66
+ return 0
67
+ return None
68
+
69
+ def convert_age(raw_val: str):
70
+ """
71
+ Convert the age field to a float.
72
+ """
73
+ parts = raw_val.split(':', 1)
74
+ if len(parts) > 1:
75
+ value = parts[1].strip()
76
+ try:
77
+ return float(value)
78
+ except ValueError:
79
+ return None
80
+ return None
81
+
82
+ def convert_gender(raw_val: str):
83
+ """
84
+ Convert gender to 0 for female and 1 for male.
85
+ """
86
+ parts = raw_val.split(':', 1)
87
+ if len(parts) > 1:
88
+ value = parts[1].strip().lower()
89
+ if value == "female":
90
+ return 0
91
+ elif value == "male":
92
+ return 1
93
+ return None
94
+
95
+ # 3. Conduct initial filtering on the dataset
96
+ is_trait_available = (trait_row is not None)
97
+ validate_and_save_cohort_info(
98
+ is_final=False,
99
+ cohort=cohort,
100
+ info_path=json_path,
101
+ is_gene_available=is_gene_available,
102
+ is_trait_available=is_trait_available
103
+ )
104
+
105
+ # 4. Clinical Feature Extraction (only if trait data is available)
106
+ if is_trait_available:
107
+ selected_clinical_df = geo_select_clinical_features(
108
+ 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
+
118
+ # Inspect a preview of the extracted clinical features
119
+ print(preview_df(selected_clinical_df))
120
+
121
+ # Save the clinical data
122
+ selected_clinical_df.to_csv(out_clinical_data_file, index=False)
123
+ # STEP3
124
+ # 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
125
+ gene_data = get_genetic_data(matrix_file)
126
+
127
+ # 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
128
+ print(gene_data.index[:20])
129
+ # These identifiers (e.g., ACACA, ACADVL, ACAT2, ACSL3, etc.) are recognized human gene symbols.
130
+ # Therefore, no additional mapping is needed.
131
+ print("requires_gene_mapping = False")
132
+ import os
133
+ import pandas as pd
134
+
135
+ # STEP7: Data Normalization and Linking
136
+
137
+ # 1) Normalize the gene symbols in the previously obtained gene_data
138
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
139
+ normalized_gene_data.to_csv(out_gene_data_file)
140
+
141
+ # 2) Load clinical data only if it exists and is non-empty
142
+ if os.path.exists(out_clinical_data_file) and os.path.getsize(out_clinical_data_file) > 0:
143
+ # Read the file
144
+ clinical_temp = pd.read_csv(out_clinical_data_file)
145
+
146
+ # Adjust row index to label the trait, age, and gender properly
147
+ if clinical_temp.shape[0] == 3:
148
+ clinical_temp.index = [trait, "Age", "Gender"]
149
+ elif clinical_temp.shape[0] == 2:
150
+ clinical_temp.index = [trait, "Gender"]
151
+ elif clinical_temp.shape[0] == 1:
152
+ clinical_temp.index = [trait]
153
+
154
+ # 2) Link the clinical and normalized genetic data
155
+ linked_data = geo_link_clinical_genetic_data(clinical_temp, normalized_gene_data)
156
+
157
+ # 3) Handle missing values
158
+ linked_data = handle_missing_values(linked_data, trait)
159
+
160
+ # 4) Check for severe bias in the trait; remove biased demographic features if present
161
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
162
+
163
+ # 5) Final quality validation and save metadata
164
+ is_usable = validate_and_save_cohort_info(
165
+ is_final=True,
166
+ cohort=cohort,
167
+ info_path=json_path,
168
+ is_gene_available=True,
169
+ is_trait_available=True,
170
+ is_biased=trait_biased,
171
+ df=linked_data,
172
+ note=f"Final check on {cohort} with {trait}."
173
+ )
174
+
175
+ # 6) If the linked data is usable, save it
176
+ if is_usable:
177
+ linked_data.to_csv(out_data_file)
178
+ else:
179
+ # If no valid clinical data file is found, finalize metadata indicating trait unavailability
180
+ is_usable = 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=True, # Force a fallback so that it's flagged as unusable
187
+ df=pd.DataFrame(),
188
+ note=f"No trait data found for {cohort}, final metadata recorded."
189
+ )
190
+ # Per instructions, do not save a final linked data file when trait data is absent.
p1/preprocess/COVID-19/code/TCGA.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "COVID-19"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/1/COVID-19/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/1/COVID-19/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/1/COVID-19/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/1/COVID-19/cohort_info.json"
15
+
16
+ import os
17
+ import pandas as pd
18
+
19
+ # Step 1: Check directories in tcga_root_dir for anything relevant to "COVID-19"
20
+ search_terms = ["covid", "covid-19"]
21
+ dir_list = os.listdir(tcga_root_dir)
22
+ matching_dir = None
23
+
24
+ for d in dir_list:
25
+ d_lower = d.lower()
26
+ if any(term in d_lower for term in search_terms):
27
+ matching_dir = d
28
+ break
29
+
30
+ if matching_dir is None:
31
+ # No matching directory found. Mark the dataset as skipped for COVID-19.
32
+ validate_and_save_cohort_info(
33
+ is_final=False,
34
+ cohort="TCGA_COVID-19",
35
+ info_path=json_path,
36
+ is_gene_available=False,
37
+ is_trait_available=False
38
+ )
39
+ else:
40
+ # 2. Identify the clinicalMatrix and PANCAN files
41
+ cohort_dir = os.path.join(tcga_root_dir, matching_dir)
42
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
43
+
44
+ # 3. Load both data files
45
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
46
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
47
+
48
+ # 4. Print the column names of the clinical data
49
+ print("Clinical Data Columns:")
50
+ print(clinical_df.columns.tolist())
p1/preprocess/COVID-19/cohort_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"GSE275334": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": true, "has_gender": true, "sample_size": 47, "note": "Final check on GSE275334 with COVID-19."}, "GSE273225": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": "No trait data found for GSE273225, final metadata recorded."}, "GSE243348": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": true, "has_gender": true, "sample_size": 237, "note": "Final check on GSE243348 with COVID-19."}, "GSE227080": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": true, "has_gender": true, "sample_size": 119, "note": "Final check on GSE227080 with COVID-19."}, "GSE216705": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": "No trait data found for GSE216705, final metadata recorded."}, "GSE213313": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": false, "has_gender": false, "sample_size": 94, "note": "Final check on GSE213313 with COVID-19."}, "GSE212866": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": false, "has_gender": false, "sample_size": 137, "note": "Final check on GSE212866 with COVID-19."}, "GSE212865": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": false, "has_gender": false, "sample_size": 137, "note": "Final check on GSE212865 with COVID-19."}, "GSE211378": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": "No trait data found for GSE211378, final metadata recorded."}, "GSE185658": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": "No trait data found for GSE185658, final metadata recorded."}, "TCGA_Brugada_Syndrome": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": null}, "TCGA_COVID-19": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": null}}
p1/preprocess/COVID-19/gene_data/GSE185658.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3b064b4ff46319ff3299b7070c722d1dc8c5d18ccd250e48a01a23b881a5478
3
+ size 18243051
p1/preprocess/COVID-19/gene_data/GSE211378.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/gene_data/GSE213313.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:638012639eb8e474e19b69c9e4e2876e15a1df4c6641cf139107f8d877d11224
3
+ size 16890760
p1/preprocess/COVID-19/gene_data/GSE216705.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/gene_data/GSE227080.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/gene_data/GSE243348.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/gene_data/GSE273225.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/COVID-19/gene_data/GSE275334.csv ADDED
The diff for this file is too large to render. See raw diff
 
p1/preprocess/Cervical_Cancer/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1aed702adaa4b3040456eb9839bf7e1c3d919fbadc044c16076aaf11fe5ed8e
3
+ size 92575525
p1/preprocess/Chronic_Fatigue_Syndrome/gene_data/GSE67311.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdc80550137956d622d2ec9a5baefec581baacd4c28f983c456b9d007fbd70b7
3
+ size 33088822
p1/preprocess/Chronic_kidney_disease/gene_data/GSE104954.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc3a9f0687529d57f9d8a3f651c165f08f173b4bef010a0eb2b694d1dc0ac4c9
3
+ size 19283622
p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE46517.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd2d2b79a80f8697246aa18788edbad15d2ffe2ff4ba9c089dcb12af3f727919
3
+ size 21209767
p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE46862.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d79a8fdf66ba6462fed4b5a14927eb32e1f172afcf7c6323e258df0e28ddf6cd
3
+ size 26190142
p1/preprocess/Colon_and_Rectal_Cancer/gene_data/GSE56699.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1f8f30109dd1597ae686f6be87aa396216172b113188439c14dd85858ad336b
3
+ size 17572338
p1/preprocess/Congestive_heart_failure/gene_data/GSE182600.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ab10642973a2c6ae075b4608278a038bc9bf2ff5fa8d444a21b081ea4467056
3
+ size 26035031
p1/preprocess/Coronary_artery_disease/code/GSE59867.py ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Coronary_artery_disease"
6
+ cohort = "GSE59867"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Coronary_artery_disease"
10
+ in_cohort_dir = "../DATA/GEO/Coronary_artery_disease/GSE59867"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Coronary_artery_disease/GSE59867.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Coronary_artery_disease/gene_data/GSE59867.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Coronary_artery_disease/clinical_data/GSE59867.csv"
16
+ json_path = "./output/preprocess/1/Coronary_artery_disease/cohort_info.json"
17
+
18
+ # STEP 1: Initial Data Loading
19
+
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(
27
+ matrix_file,
28
+ prefixes_a=background_prefixes,
29
+ prefixes_b=clinical_prefixes
30
+ )
31
+
32
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
33
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
34
+
35
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
36
+ print("Background Information:")
37
+ print(background_info)
38
+ print("\nSample Characteristics Dictionary:")
39
+ print(sample_characteristics_dict)
40
+ # 1) Gene Expression Data Availability
41
+ is_gene_available = True # The dataset uses Affymetrix HuGene 1.0 ST arrays, which is gene expression data.
42
+
43
+ # 2) Variable Availability and Data Type Conversion
44
+
45
+ # After examining the sample characteristics, it appears that:
46
+ # - The trait "Coronary_artery_disease" is constant in this dataset (all subjects either have CAD or STEMI).
47
+ # Hence there is no variation, so we treat it as not available.
48
+ # - No explicit 'age' or 'gender' data are found.
49
+ trait_row = None
50
+ age_row = None
51
+ gender_row = None
52
+
53
+ # Define data conversion functions (they will mostly return None if the row is not available).
54
+ def convert_trait(value: str):
55
+ return None # Not available or no variation in the dataset.
56
+
57
+ def convert_age(value: str):
58
+ return None # Age data is not available.
59
+
60
+ def convert_gender(value: str):
61
+ return None # Gender data is not available.
62
+
63
+ # 3) Save Metadata (initial filtering)
64
+ is_trait_available = (trait_row is not None)
65
+ is_usable = validate_and_save_cohort_info(
66
+ is_final=False,
67
+ cohort=cohort,
68
+ info_path=json_path,
69
+ is_gene_available=is_gene_available,
70
+ is_trait_available=is_trait_available
71
+ )
72
+
73
+ # 4) Clinical Feature Extraction
74
+ # The instructions say if trait_row is None, skip the substep.
75
+ if trait_row is not None:
76
+ selected_clinical_df = geo_select_clinical_features(
77
+ clinical_df=clinical_data, # assume clinical_data is already in scope
78
+ trait=trait,
79
+ trait_row=trait_row,
80
+ convert_trait=convert_trait,
81
+ age_row=age_row,
82
+ convert_age=convert_age,
83
+ gender_row=gender_row,
84
+ convert_gender=convert_gender
85
+ )
86
+ # Observe a preview
87
+ preview_output = preview_df(selected_clinical_df)
88
+ print("Preview of clinical features extracted:", preview_output)
89
+ # Save to CSV
90
+ selected_clinical_df.to_csv(out_clinical_data_file)
91
+ # STEP 3: Gene Data Extraction
92
+
93
+ # In some single-cell GEO datasets, the standard marker "!series_matrix_table_begin" may not exist.
94
+ # We'll first try to parse using the default get_genetic_data approach. If that fails (marker not found),
95
+ # we'll do a fallback parse by skipping lines that start with "^", "!", and "#" and see if that yields any data.
96
+
97
+ try:
98
+ gene_data = get_genetic_data(matrix_file, marker="!series_matrix_table_begin")
99
+ except ValueError:
100
+ print("Marker '!series_matrix_table_begin' not found. Attempting fallback parsing...")
101
+
102
+ # Fallback: filter out lines starting with '^', '!', or '#', then parse as tab-delimited.
103
+ # This may or may not yield correct gene data, depending on file structure.
104
+ filtered_df, _ = filter_content_by_prefix(
105
+ matrix_file,
106
+ prefixes_a=["^", "!", "#"],
107
+ unselect=True,
108
+ source_type='file',
109
+ return_df_a=True,
110
+ return_df_b=False
111
+ )
112
+
113
+ # If a column named 'ID_REF' or 'ID' is present, rename to 'ID' and set as index
114
+ for possible_id_col in ["ID_REF", "ID"]:
115
+ if possible_id_col in filtered_df.columns:
116
+ filtered_df = filtered_df.rename(columns={possible_id_col: "ID"}).set_index("ID")
117
+ break
118
+
119
+ gene_data = filtered_df
120
+
121
+ # Print the first 20 row IDs (index) to verify the data structure
122
+ print("First 20 row IDs in the gene expression data:")
123
+ print(gene_data.index[:20])
124
+ # Observing the provided row IDs, they appear to be probe IDs (numeric) rather than direct gene symbols.
125
+ # Therefore, they likely need to be mapped to standard human gene symbols.
126
+
127
+ print("requires_gene_mapping = True")
128
+ # STEP5
129
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
130
+ gene_annotation = get_gene_annotation(soft_file)
131
+
132
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
133
+ print("Gene annotation preview:")
134
+ print(preview_df(gene_annotation))
135
+ # STEP: Gene Identifier Mapping
136
+
137
+ # 1. From observation, the 'ID' column in the annotation corresponds to the probe IDs in the gene expression data.
138
+ # The column 'gene_assignment' in the annotation appears to contain gene symbol information.
139
+ probe_col_name = "ID"
140
+ gene_symbol_col_name = "gene_assignment"
141
+
142
+ # 2. Build a mapping dataframe with the relevant columns for ID and gene symbols.
143
+ mapping_df = get_gene_mapping(
144
+ annotation=gene_annotation,
145
+ prob_col=probe_col_name,
146
+ gene_col=gene_symbol_col_name
147
+ )
148
+
149
+ # 3. Apply the mapping to convert from probe-level measurements to gene-level expression values.
150
+ gene_data = apply_gene_mapping(expression_df=gene_data, mapping_df=mapping_df)
151
+
152
+ # Just to verify, print a small part of the resulting gene_data
153
+ print("Mapped gene expression data (first 5 rows):")
154
+ print(gene_data.head(5))
155
+ import os
156
+ import pandas as pd
157
+
158
+ # STEP 7
159
+
160
+ # 1. Normalize the gene expression data to standard gene symbols.
161
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
162
+ normalized_gene_data.to_csv(out_gene_data_file)
163
+ print("Normalized gene expression data saved to:", out_gene_data_file)
164
+
165
+ # Check if clinical data exists before linking
166
+ if not os.path.exists(out_clinical_data_file):
167
+ # Without clinical data, we cannot do trait-based analysis
168
+ dummy_df = pd.DataFrame()
169
+ trait_biased = True # Mark as unusable because we lack trait information
170
+ is_usable = validate_and_save_cohort_info(
171
+ is_final=True,
172
+ cohort=cohort,
173
+ info_path=json_path,
174
+ is_gene_available=True,
175
+ is_trait_available=False,
176
+ is_biased=trait_biased,
177
+ df=dummy_df,
178
+ note="No trait data found. This dataset is not usable for final analysis."
179
+ )
180
+ print("Clinical data file not found. Skipping linking and final data export.")
181
+ else:
182
+ # 2. Link the clinical and genetic data
183
+ # Since in an earlier step we used 'index=False' when saving clinical data (which lost row labels),
184
+ # we read it normally, then reassign the row index for the features.
185
+ # By design, geo_select_clinical_features returned [trait, Age, Gender] as rows, so we expect up to 3 rows here.
186
+ raw_clinical = pd.read_csv(out_clinical_data_file, header=0) # shape ~ (# features, # samples)
187
+ row_count = raw_clinical.shape[0]
188
+
189
+ # Reassign row index if we have up to 3 rows
190
+ # (trait is always the first, Age second, Gender third if present)
191
+ if row_count == 3:
192
+ raw_clinical.index = [trait, "Age", "Gender"]
193
+ elif row_count == 2:
194
+ raw_clinical.index = [trait, "Age"]
195
+ elif row_count == 1:
196
+ raw_clinical.index = [trait]
197
+ # else unexpected shape, but proceed anyway
198
+
199
+ selected_clinical_df = raw_clinical
200
+
201
+ # Now link with gene data
202
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
203
+
204
+ # 3. Handle missing values
205
+ df = handle_missing_values(linked_data, trait)
206
+
207
+ # 4. Determine whether the trait or demographic features are biased
208
+ trait_biased, df = judge_and_remove_biased_features(df, trait)
209
+
210
+ # 5. Perform final validation
211
+ is_usable = validate_and_save_cohort_info(
212
+ is_final=True,
213
+ cohort=cohort,
214
+ info_path=json_path,
215
+ is_gene_available=True,
216
+ is_trait_available=True,
217
+ is_biased=trait_biased,
218
+ df=df,
219
+ note="Final step with linking, missing-value handling, and bias checks."
220
+ )
221
+
222
+ # 6. If the data is usable, save the final linked data
223
+ if is_usable:
224
+ df.to_csv(out_data_file)
225
+ print(f"Final linked data saved to: {out_data_file}")
226
+ else:
227
+ print("Dataset is not usable or severely biased. No final data saved.")
p1/preprocess/Coronary_artery_disease/code/GSE64554.py ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Coronary_artery_disease"
6
+ cohort = "GSE64554"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Coronary_artery_disease"
10
+ in_cohort_dir = "../DATA/GEO/Coronary_artery_disease/GSE64554"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Coronary_artery_disease/GSE64554.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Coronary_artery_disease/gene_data/GSE64554.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Coronary_artery_disease/clinical_data/GSE64554.csv"
16
+ json_path = "./output/preprocess/1/Coronary_artery_disease/cohort_info.json"
17
+
18
+ # STEP 1: Initial Data Loading
19
+
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(
27
+ matrix_file,
28
+ prefixes_a=background_prefixes,
29
+ prefixes_b=clinical_prefixes
30
+ )
31
+
32
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
33
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
34
+
35
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
36
+ print("Background Information:")
37
+ print(background_info)
38
+ print("\nSample Characteristics Dictionary:")
39
+ print(sample_characteristics_dict)
40
+ # Step 1: Determine if this dataset likely contains gene expression data
41
+ is_gene_available = True # Based on "PART 1 - Genes" in the series title
42
+
43
+ # Step 2: Identify data availability for trait, age, and gender
44
+ trait_row = 2 # "disease state: control" or "disease state: coronary artery disease"
45
+ age_row = 0 # "age: 76", "age: 71", etc.
46
+ gender_row = None # No mention of gender in the dictionary
47
+
48
+ # Step 2.2: Define conversion functions
49
+ def convert_trait(x: str):
50
+ # Example input: "disease state: control" or "disease state: coronary artery disease"
51
+ parts = x.split(":")
52
+ val = parts[-1].strip().lower() if len(parts) > 1 else None
53
+ if val == "control":
54
+ return 0
55
+ elif val == "coronary artery disease":
56
+ return 1
57
+ else:
58
+ return None
59
+
60
+ def convert_age(x: str):
61
+ # Example input: "age: 76"
62
+ parts = x.split(":")
63
+ val = parts[-1].strip() if len(parts) > 1 else None
64
+ try:
65
+ return float(val)
66
+ except:
67
+ return None
68
+
69
+ def convert_gender(x: str):
70
+ # Not used here, but define anyway
71
+ return None
72
+
73
+ # Step 3: Conduct initial filtering and save metadata
74
+ is_trait_available = (trait_row is not None)
75
+ _ = validate_and_save_cohort_info(
76
+ is_final=False,
77
+ cohort=cohort,
78
+ info_path=json_path,
79
+ is_gene_available=is_gene_available,
80
+ is_trait_available=is_trait_available
81
+ )
82
+
83
+ # Step 4: If trait data is available, extract and save clinical features
84
+ if trait_row is not None:
85
+ extracted_clinical_df = geo_select_clinical_features(
86
+ clinical_data, # assumed to be available in the environment
87
+ trait,
88
+ trait_row,
89
+ convert_trait,
90
+ age_row,
91
+ convert_age,
92
+ gender_row,
93
+ convert_gender
94
+ )
95
+ preview = preview_df(extracted_clinical_df)
96
+ print("Preview of extracted clinical features:", preview)
97
+ extracted_clinical_df.to_csv(out_clinical_data_file, index=False)
98
+ # STEP 3: Gene Data Extraction
99
+
100
+ # In some single-cell GEO datasets, the standard marker "!series_matrix_table_begin" may not exist.
101
+ # We'll first try to parse using the default get_genetic_data approach. If that fails (marker not found),
102
+ # we'll do a fallback parse by skipping lines that start with "^", "!", and "#" and see if that yields any data.
103
+
104
+ try:
105
+ gene_data = get_genetic_data(matrix_file, marker="!series_matrix_table_begin")
106
+ except ValueError:
107
+ print("Marker '!series_matrix_table_begin' not found. Attempting fallback parsing...")
108
+
109
+ # Fallback: filter out lines starting with '^', '!', or '#', then parse as tab-delimited.
110
+ # This may or may not yield correct gene data, depending on file structure.
111
+ filtered_df, _ = filter_content_by_prefix(
112
+ matrix_file,
113
+ prefixes_a=["^", "!", "#"],
114
+ unselect=True,
115
+ source_type='file',
116
+ return_df_a=True,
117
+ return_df_b=False
118
+ )
119
+
120
+ # If a column named 'ID_REF' or 'ID' is present, rename to 'ID' and set as index
121
+ for possible_id_col in ["ID_REF", "ID"]:
122
+ if possible_id_col in filtered_df.columns:
123
+ filtered_df = filtered_df.rename(columns={possible_id_col: "ID"}).set_index("ID")
124
+ break
125
+
126
+ gene_data = filtered_df
127
+
128
+ # Print the first 20 row IDs (index) to verify the data structure
129
+ print("First 20 row IDs in the gene expression data:")
130
+ print(gene_data.index[:20])
131
+ # Based on the provided row IDs (ILMN_...), these are Illumina probe identifiers, not standard gene symbols.
132
+ # They require mapping to standard gene symbols.
133
+ print("\nrequires_gene_mapping = True")
134
+ # STEP5
135
+ # 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.
136
+ gene_annotation = get_gene_annotation(soft_file)
137
+
138
+ # 2. Use the 'preview_df' function from the library to preview the data and print out the results.
139
+ print("Gene annotation preview:")
140
+ print(preview_df(gene_annotation))
141
+ # STEP: Gene Identifier Mapping
142
+
143
+ # 1. Identify matching columns in the gene annotation dataframe:
144
+ # - The gene expression data index is "ILMN_...", which corresponds to the "ID" column in the annotation.
145
+ # - The gene symbols are in the "Symbol" column of the annotation dataframe.
146
+
147
+ # 2. Create a dataframe that maps probe IDs to gene symbols using the get_gene_mapping function.
148
+ mapping_df = get_gene_mapping(gene_annotation, prob_col="ID", gene_col="Symbol")
149
+
150
+ # 3. Convert probe-level measurements to gene expression data by applying the mapping.
151
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
152
+
153
+ # Print the shape of the mapped gene_data to verify
154
+ print("Mapped gene expression data shape:", gene_data.shape)
155
+ import os
156
+ import pandas as pd
157
+
158
+ # STEP 7
159
+
160
+ # 1. Normalize the gene expression data to standard gene symbols.
161
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
162
+ normalized_gene_data.to_csv(out_gene_data_file)
163
+ print("Normalized gene expression data saved to:", out_gene_data_file)
164
+
165
+ # Check if clinical data exists before linking
166
+ if not os.path.exists(out_clinical_data_file):
167
+ # Without clinical data, we cannot do trait-based analysis
168
+ dummy_df = pd.DataFrame()
169
+ trait_biased = True # Mark as unusable because we lack trait information
170
+ is_usable = validate_and_save_cohort_info(
171
+ is_final=True,
172
+ cohort=cohort,
173
+ info_path=json_path,
174
+ is_gene_available=True,
175
+ is_trait_available=False,
176
+ is_biased=trait_biased,
177
+ df=dummy_df,
178
+ note="No trait data found. This dataset is not usable for final analysis."
179
+ )
180
+ print("Clinical data file not found. Skipping linking and final data export.")
181
+ else:
182
+ # 2. Link the clinical and genetic data
183
+ # Since in an earlier step we used 'index=False' when saving clinical data (which lost row labels),
184
+ # we read it normally, then reassign the row index for the features.
185
+ # By design, geo_select_clinical_features returned [trait, Age, Gender] as rows, so we expect up to 3 rows here.
186
+ raw_clinical = pd.read_csv(out_clinical_data_file, header=0) # shape ~ (# features, # samples)
187
+ row_count = raw_clinical.shape[0]
188
+
189
+ # Reassign row index if we have up to 3 rows
190
+ # (trait is always the first, Age second, Gender third if present)
191
+ if row_count == 3:
192
+ raw_clinical.index = [trait, "Age", "Gender"]
193
+ elif row_count == 2:
194
+ raw_clinical.index = [trait, "Age"]
195
+ elif row_count == 1:
196
+ raw_clinical.index = [trait]
197
+ # else unexpected shape, but proceed anyway
198
+
199
+ selected_clinical_df = raw_clinical
200
+
201
+ # Now link with gene data
202
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
203
+
204
+ # 3. Handle missing values
205
+ df = handle_missing_values(linked_data, trait)
206
+
207
+ # 4. Determine whether the trait or demographic features are biased
208
+ trait_biased, df = judge_and_remove_biased_features(df, trait)
209
+
210
+ # 5. Perform final validation
211
+ is_usable = validate_and_save_cohort_info(
212
+ is_final=True,
213
+ cohort=cohort,
214
+ info_path=json_path,
215
+ is_gene_available=True,
216
+ is_trait_available=True,
217
+ is_biased=trait_biased,
218
+ df=df,
219
+ note="Final step with linking, missing-value handling, and bias checks."
220
+ )
221
+
222
+ # 6. If the data is usable, save the final linked data
223
+ if is_usable:
224
+ df.to_csv(out_data_file)
225
+ print(f"Final linked data saved to: {out_data_file}")
226
+ else:
227
+ print("Dataset is not usable or severely biased. No final data saved.")
p1/preprocess/Coronary_artery_disease/code/GSE86216.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Coronary_artery_disease"
6
+ cohort = "GSE86216"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Coronary_artery_disease"
10
+ in_cohort_dir = "../DATA/GEO/Coronary_artery_disease/GSE86216"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/1/Coronary_artery_disease/GSE86216.csv"
14
+ out_gene_data_file = "./output/preprocess/1/Coronary_artery_disease/gene_data/GSE86216.csv"
15
+ out_clinical_data_file = "./output/preprocess/1/Coronary_artery_disease/clinical_data/GSE86216.csv"
16
+ json_path = "./output/preprocess/1/Coronary_artery_disease/cohort_info.json"
17
+
18
+ # STEP 1: Initial Data Loading
19
+
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(
27
+ matrix_file,
28
+ prefixes_a=background_prefixes,
29
+ prefixes_b=clinical_prefixes
30
+ )
31
+
32
+ # 3. Obtain the sample characteristics dictionary from the clinical dataframe
33
+ sample_characteristics_dict = get_unique_values_by_row(clinical_data)
34
+
35
+ # 4. Explicitly print out all the background information and the sample characteristics dictionary
36
+ print("Background Information:")
37
+ print(background_info)
38
+ print("\nSample Characteristics Dictionary:")
39
+ print(sample_characteristics_dict)
40
+ # 1) Gene Expression Data Availability
41
+ # Based on the background information, this dataset involves transcriptomic profiling in PBMC.
42
+ is_gene_available = True
43
+
44
+ # 2) Variable Availability and Type Conversion
45
+ # From the sample characteristics dictionary, there is no row keyed to age, gender, or the trait "Coronary_artery_disease".
46
+ # Moreover, the entire cohort comprises patients with coronary artery disease (no variation), so trait is effectively constant.
47
+ trait_row = None
48
+ age_row = None
49
+ gender_row = None
50
+
51
+ # Define data conversion functions (although they won't be used here as trait_row, age_row, and gender_row are None).
52
+ def convert_trait(value: str):
53
+ # For this cohort, the trait is not actually present in the data.
54
+ # Return None indicating no usable conversion.
55
+ return None
56
+
57
+ def convert_age(value: str):
58
+ # Age data not available, return None
59
+ return None
60
+
61
+ def convert_gender(value: str):
62
+ # Gender data not available, return None
63
+ return None
64
+
65
+ # 3) Save Metadata
66
+ # We do an initial filtering. Trait is not available, so is_trait_available is False.
67
+ is_trait_available = False
68
+ is_usable = validate_and_save_cohort_info(
69
+ is_final=False,
70
+ cohort=cohort,
71
+ info_path=json_path,
72
+ is_gene_available=is_gene_available,
73
+ is_trait_available=is_trait_available
74
+ )
75
+
76
+ # 4) Clinical Feature Extraction
77
+ # Since 'trait_row' is None, we skip the substep of extracting clinical features.
p1/preprocess/Coronary_artery_disease/code/TCGA.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Coronary_artery_disease"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/1/Coronary_artery_disease/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/1/Coronary_artery_disease/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/1/Coronary_artery_disease/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/1/Coronary_artery_disease/cohort_info.json"
15
+
16
+ import os
17
+
18
+ # Step 1: Identify subdirectory that might relate to our trait "Coronary_artery_disease"
19
+ subdirs = [
20
+ 'CrawlData.ipynb', '.DS_Store', 'TCGA_lower_grade_glioma_and_glioblastoma_(GBMLGG)',
21
+ 'TCGA_Uterine_Carcinosarcoma_(UCS)', 'TCGA_Thyroid_Cancer_(THCA)', 'TCGA_Thymoma_(THYM)',
22
+ 'TCGA_Testicular_Cancer_(TGCT)', 'TCGA_Stomach_Cancer_(STAD)', 'TCGA_Sarcoma_(SARC)',
23
+ 'TCGA_Rectal_Cancer_(READ)', 'TCGA_Prostate_Cancer_(PRAD)', 'TCGA_Pheochromocytoma_Paraganglioma_(PCPG)',
24
+ 'TCGA_Pancreatic_Cancer_(PAAD)', 'TCGA_Ovarian_Cancer_(OV)', 'TCGA_Ocular_melanomas_(UVM)',
25
+ 'TCGA_Mesothelioma_(MESO)', 'TCGA_Melanoma_(SKCM)', 'TCGA_Lung_Squamous_Cell_Carcinoma_(LUSC)',
26
+ 'TCGA_Lung_Cancer_(LUNG)', 'TCGA_Lung_Adenocarcinoma_(LUAD)', 'TCGA_Lower_Grade_Glioma_(LGG)',
27
+ 'TCGA_Liver_Cancer_(LIHC)', 'TCGA_Large_Bcell_Lymphoma_(DLBC)', 'TCGA_Kidney_Papillary_Cell_Carcinoma_(KIRP)',
28
+ 'TCGA_Kidney_Clear_Cell_Carcinoma_(KIRC)', 'TCGA_Kidney_Chromophobe_(KICH)', 'TCGA_Head_and_Neck_Cancer_(HNSC)',
29
+ 'TCGA_Glioblastoma_(GBM)', 'TCGA_Esophageal_Cancer_(ESCA)', 'TCGA_Endometrioid_Cancer_(UCEC)',
30
+ 'TCGA_Colon_and_Rectal_Cancer_(COADREAD)', 'TCGA_Colon_Cancer_(COAD)', 'TCGA_Cervical_Cancer_(CESC)',
31
+ 'TCGA_Breast_Cancer_(BRCA)', 'TCGA_Bladder_Cancer_(BLCA)', 'TCGA_Bile_Duct_Cancer_(CHOL)',
32
+ 'TCGA_Adrenocortical_Cancer_(ACC)', 'TCGA_Acute_Myeloid_Leukemia_(LAML)'
33
+ ]
34
+
35
+ # We attempt to find subdirectories that match synonyms for "Coronary_artery_disease"
36
+ synonyms = ["coronary", "artery", "cardio", "heart"]
37
+
38
+ suitable_subdir = None
39
+ for sd in subdirs:
40
+ if any(term in sd.lower() for term in synonyms):
41
+ suitable_subdir = sd
42
+ break
43
+
44
+ if not suitable_subdir:
45
+ print(f"No suitable subdirectory found for trait '{trait}'. Skipping this trait.")
46
+ validate_and_save_cohort_info(
47
+ is_final=False,
48
+ cohort="TCGA",
49
+ info_path=json_path,
50
+ is_gene_available=False,
51
+ is_trait_available=False
52
+ )
53
+ else:
54
+ # Step 2: Identify clinical and genetic file paths
55
+ subdir_path = os.path.join(tcga_root_dir, suitable_subdir)
56
+ clinical_path, genetic_path = tcga_get_relevant_filepaths(subdir_path)
57
+
58
+ # Step 3: Load data into dataframes
59
+ clinical_df = pd.read_csv(clinical_path, index_col=0, sep='\t')
60
+ genetic_df = pd.read_csv(genetic_path, index_col=0, sep='\t')
61
+
62
+ # Step 4: Print clinical data columns
63
+ print("Clinical Data Columns:", clinical_df.columns.tolist())
p1/preprocess/Coronary_artery_disease/gene_data/GSE109048.csv ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Gene,GSM2928447,GSM2928448,GSM2928449,GSM2928450,GSM2928451,GSM2928452,GSM2928453,GSM2928454,GSM2928455,GSM2928456,GSM2928457,GSM2928458,GSM2928459,GSM2928460,GSM2928461,GSM2928462,GSM2928463,GSM2928464,GSM2928465,GSM2928466,GSM2928467,GSM2928468,GSM2928469,GSM2928470,GSM2928471,GSM2928472,GSM2928473,GSM2928474,GSM2928475,GSM2928476,GSM2928477,GSM2928478,GSM2928479,GSM2928480,GSM2928481,GSM2928482,GSM2928483,GSM2928484,GSM2928485,GSM2928486,GSM2928487,GSM2928488,GSM2928489,GSM2928490,GSM2928491,GSM2928492,GSM2928493,GSM2928494,GSM2928495,GSM2928496,GSM2928497,GSM2928498,GSM2928499,GSM2928500,GSM2928501,GSM2928502,GSM2928503
2
+ OR4F16,2.9743094,2.5420604,2.4884850000000003,4.3142904,3.6649840000000005,2.7035954,2.5767966,2.6242086,2.6959218,2.771231,2.7009044,3.306057,2.6292988,2.757701,2.4774882000000003,2.3687974,3.0569956000000005,2.5827929999999997,2.6457842,2.8135651999999998,3.168524,2.7513798,2.5093813999999997,2.4695346,3.3407572,2.6126698,2.6948912,2.9736062,2.9090552,2.9485638,3.309335,2.6824026,2.5460307999999996,2.6424936,2.752814,3.290865,2.5296848,3.0717722,3.113311,3.4363840000000003,4.5301925999999995,2.6978723999999996,2.6916752,2.493736,2.6510559999999996,2.8423382000000004,2.7169974,3.3428152,2.6144125999999996,2.4906658,2.6306766,2.564085,2.6168648,2.6084864,2.7091269999999996,2.6708324,2.867071
3
+ OR4F17,3.56224725,3.65479775,3.27546875,5.825601499999999,5.07030375,3.4557615000000004,3.383338,3.1713899999999997,3.5346985,3.4166965,3.66845175,3.341109,3.29447275,3.4095959999999996,3.3347825,3.28110825,3.4918975,3.5923557500000003,3.23555975,3.439068,4.2946884999999995,3.25981775,3.3532319999999998,3.33809325,3.4241485000000003,3.48046525,3.5117607499999997,4.59117625,3.2860292499999995,3.152998,3.5573942499999998,3.26352475,3.3428645,3.2651335,4.32833475,3.5935732500000004,3.26786575,3.2239020000000003,4.519833,4.74429125,5.1355830000000005,3.5155227499999997,3.4039415,3.35090175,3.011616,3.7048982500000003,3.3571549999999997,3.88471425,3.3958907499999995,3.1648735,3.4328640000000004,3.28346875,4.048498,3.31749575,3.6807687500000004,3.4197455,3.36906
4
+ OR4F21,2.1497145,2.231649,2.0615325,3.3020445,2.9357545,2.093821,2.039704,1.8293115,2.067562,1.943375,2.095118,2.232502,1.880212,2.1980815,1.8689905,1.80633,2.324901,2.0716685,1.942506,2.3132095,2.262299,2.0615325,1.991198,1.9151765,2.3500865,1.841398,1.934662,2.5516425,2.278318,2.222638,2.575608,1.950054,1.858947,1.9674515,2.108439,2.1767895,2.056688,2.281916,2.5075515,2.5109465,3.446703,1.882676,1.7044375,1.8744285,1.7931265,2.0016285,1.9909035,2.5397905,1.9478135,2.037298,1.984265,1.695501,1.985344,2.0490825,2.035695,1.9485745,2.3101085
5
+ OR4F29,2.9743094,2.5420604,2.4884850000000003,4.3142904,3.6649840000000005,2.7035954,2.5767966,2.6242086,2.6959218,2.771231,2.7009044,3.306057,2.6292988,2.757701,2.4774882000000003,2.3687974,3.0569956000000005,2.5827929999999997,2.6457842,2.8135651999999998,3.168524,2.7513798,2.5093813999999997,2.4695346,3.3407572,2.6126698,2.6948912,2.9736062,2.9090552,2.9485638,3.309335,2.6824026,2.5460307999999996,2.6424936,2.752814,3.290865,2.5296848,3.0717722,3.113311,3.4363840000000003,4.5301925999999995,2.6978723999999996,2.6916752,2.493736,2.6510559999999996,2.8423382000000004,2.7169974,3.3428152,2.6144125999999996,2.4906658,2.6306766,2.564085,2.6168648,2.6084864,2.7091269999999996,2.6708324,2.867071
6
+ OR4F2P,5.080413,4.758553,4.9502,9.321156,6.566074,4.396016,4.225586,4.673549,4.997999,4.648803,4.818265,5.393229,4.6119,5.195738,4.148212,4.141176,4.521327,4.787729,3.952442,5.251666,5.773007,4.86418,4.365879,4.468233,5.94066,4.181142,4.18371,6.062913,5.894261,5.296056,6.093548,4.186232,5.176661,5.057247,5.536383,5.303023,4.89301,5.394821,6.327871,6.398536,8.535204,4.687723,4.368939,4.752713,4.212369,4.573951,4.463247,6.470191,4.54277,4.85036,4.598246,4.118382,4.607283,4.495167,5.192202,5.204194,4.768052
7
+ OR4F3,2.9743094,2.5420604,2.4884850000000003,4.3142904,3.6649840000000005,2.7035954,2.5767966,2.6242086,2.6959218,2.771231,2.7009044,3.306057,2.6292988,2.757701,2.4774882000000003,2.3687974,3.0569956000000005,2.5827929999999997,2.6457842,2.8135651999999998,3.168524,2.7513798,2.5093813999999997,2.4695346,3.3407572,2.6126698,2.6948912,2.9736062,2.9090552,2.9485638,3.309335,2.6824026,2.5460307999999996,2.6424936,2.752814,3.290865,2.5296848,3.0717722,3.113311,3.4363840000000003,4.5301925999999995,2.6978723999999996,2.6916752,2.493736,2.6510559999999996,2.8423382000000004,2.7169974,3.3428152,2.6144125999999996,2.4906658,2.6306766,2.564085,2.6168648,2.6084864,2.7091269999999996,2.6708324,2.867071
8
+ OR4F4,1.27695275,1.38304675,1.20231025,2.120111,2.01954975,1.321109,1.218445,1.17363,1.2968385,1.2629695,1.39708575,1.26369,1.18038225,1.257182,1.194427,1.17288925,1.3071585,1.32365525,1.19855525,1.303069,1.62915,1.13342775,1.249809,1.18056675,1.2671235,1.23700425,1.20138725,1.67318075,1.22066825,1.152967,1.24119575,1.24022125,1.2761825,1.181065,1.69500975,1.28921525,1.17821475,1.0443655,1.6767395,1.79011025,1.9191305,1.22435725,1.270769,1.22174425,1.0122205,1.27551175,1.200808,1.41222475,1.23197275,1.1035075,1.2184025,1.14281325,1.4650995,1.18534625,1.34093775,1.1358935,1.181737
9
+ OR4F5,1.97288,2.2798885,2.0982985,4.1088135,3.4257805,2.2786165,1.996304,2.0012975,2.323042,1.894126,2.1543515,2.0387285,2.054807,2.1537735,1.9374215,1.891764,2.130644,2.124767,2.135245,1.9293785,2.7884615,2.0955745,1.997777,1.9506505,2.354982,1.9456,2.2128505,2.5474205,1.953684,1.9991375,2.3456995,1.956644,2.093103,1.9348415,2.6648425,2.4097135,2.053762,2.2254245,3.1057465,3.007653,3.9471825,2.51739,1.936295,1.8578505,1.8678855,2.51694,1.972249,2.1082285,1.900837,1.9252805,1.894601,1.9206615,2.2667855,2.0172355,2.3269145,2.357783,2.1676035
10
+ PCMTD2,0.84254025,0.810600625,0.81653775,0.685753375,0.662289625,0.726929125,0.82775175,0.879793125,0.831703375,0.765487,0.813898875,0.98346925,0.8274695,0.766849375,0.746335375,0.753330875,1.009245875,0.759927125,0.907258625,0.745672375,0.813817375,0.7726135,0.81468775,0.711847375,0.834132375,0.890139125,0.813817375,0.781132375,0.9179525,0.870419625,0.86659075,0.90947,0.736467625,0.786284125,0.847237375,0.836028625,0.791918875,0.748545125,0.80189475,0.742974,0.789322875,1.10600525,0.798266625,0.757701375,1.116016875,0.82425225,0.828520625,0.868575125,0.801149625,0.831748375,0.90378275,0.72030175,0.6958105,0.691177,0.813817375,0.820799375,0.79238225
11
+ SEPT14,2.001906,2.17855,2.162189,2.8326535,2.492945,2.245447,2.248301,2.0694535,2.2097125,2.1018975,2.1716845,2.184913,2.134051,2.1716845,2.121092,2.232192,2.1715735,2.2004,2.060387,2.2972555,2.1391435,2.067177,2.0609845,2.099157,2.1261395,2.1816385,2.0825065,2.292387,2.060557,2.230037,2.329013,2.206893,2.191881,2.098356,2.252621,2.3272935,2.1489915,2.081123,2.3888375,2.1884905,2.671726,1.997512,2.1001165,2.1136565,1.9728775,2.247512,2.301859,2.3252815,2.0400895,2.0955045,2.0555765,2.238452,2.1656145,2.1241635,2.1716845,2.1716845,2.126671
p1/preprocess/Coronary_artery_disease/gene_data/GSE120774.csv ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Gene,GSM3415000,GSM3415001,GSM3415002,GSM3415003,GSM3415004,GSM3415005,GSM3415006,GSM3415007,GSM3415008,GSM3415009,GSM3415010,GSM3415011,GSM3415012,GSM3415013,GSM3415014,GSM3415015,GSM3415016,GSM3415017,GSM3415018,GSM3415019,GSM3415020,GSM3415021,GSM3415022,GSM3415023,GSM3415024,GSM3415025,GSM3415026,GSM3415027,GSM3415028,GSM3415029,GSM3415030,GSM3415031,GSM3415032,GSM3415033,GSM3415034,GSM3415035
2
+ OR4F16,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
3
+ OR4F17,2.8232957142857145,2.8802485714285715,3.2763557142857147,3.0328285714285714,3.512485714285715,3.2109042857142853,3.5208728571428574,2.700707142857143,3.062665714285714,3.1797685714285713,3.0288814285714283,3.1629899999999997,2.9281457142857144,2.635937142857143,3.012642857142857,2.39568,2.247192857142857,3.20031,2.8850314285714287,2.57667,3.09936,3.271161428571429,3.7798285714285713,3.8346342857142854,3.4328700000000003,2.378777142857143,3.011477142857143,2.87472,3.0959914285714287,2.600378571428571,2.8463914285714287,2.850364285714286,2.7672171428571426,2.5841314285714283,2.3590585714285717,1.9082057142857147
4
+ OR4F1P,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
5
+ OR4F21,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
6
+ OR4F28P,5.434594545454545,5.3569379545454545,5.8140054545454545,5.3396502272727275,6.178160681818182,5.761591136363636,6.2902629545454545,5.380517045454545,5.61926590909091,5.763147727272727,5.611477045454546,5.9461461363636365,5.444944772727273,5.009495,5.873540681818182,4.863159772727273,4.867306136363636,5.719557727272727,5.376497727272727,5.173348636363636,5.72800840909091,6.087106818181818,6.905022954545455,6.862955,6.537850681818182,5.05351,5.565162727272727,5.193076136363636,5.758824090909091,5.228705909090909,5.37365,5.552819318181818,5.397147045454545,5.106555227272727,5.037040681818182,4.6801525
7
+ OR4F29,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
8
+ OR4F2P,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
9
+ OR4F3,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
10
+ OR4F4,2.8232957142857145,2.8802485714285715,3.2763557142857147,3.0328285714285714,3.512485714285715,3.2109042857142853,3.5208728571428574,2.700707142857143,3.062665714285714,3.1797685714285713,3.0288814285714283,3.1629899999999997,2.9281457142857144,2.635937142857143,3.012642857142857,2.39568,2.247192857142857,3.20031,2.8850314285714287,2.57667,3.09936,3.271161428571429,3.7798285714285713,3.8346342857142854,3.4328700000000003,2.378777142857143,3.011477142857143,2.87472,3.0959914285714287,2.600378571428571,2.8463914285714287,2.850364285714286,2.7672171428571426,2.5841314285714283,2.3590585714285717,1.9082057142857147
11
+ OR4F5,2.8232957142857145,2.8802485714285715,3.2763557142857147,3.0328285714285714,3.512485714285715,3.2109042857142853,3.5208728571428574,2.700707142857143,3.062665714285714,3.1797685714285713,3.0288814285714283,3.1629899999999997,2.9281457142857144,2.635937142857143,3.012642857142857,2.39568,2.247192857142857,3.20031,2.8850314285714287,2.57667,3.09936,3.271161428571429,3.7798285714285713,3.8346342857142854,3.4328700000000003,2.378777142857143,3.011477142857143,2.87472,3.0959914285714287,2.600378571428571,2.8463914285714287,2.850364285714286,2.7672171428571426,2.5841314285714283,2.3590585714285717,1.9082057142857147
12
+ OR4F7P,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
13
+ OR4F8P,2.7904445454545455,2.6316354545454548,3.010235454545455,2.6722327272727275,3.250788181818182,2.9898736363636367,3.2826754545454544,2.7487045454545456,2.864560909090909,2.9554627272727276,2.8787045454545455,3.0028336363636363,2.8370172727272727,2.50674,3.0421081818181817,2.4485972727272727,2.4303136363636364,2.888482727272727,2.690342727272727,2.5883736363636363,2.9093709090909092,3.144581818181818,3.5071954545454544,3.46869,3.369968181818182,2.56913,2.9041227272727275,2.7047336363636365,2.931919090909091,2.710940909090909,2.79384,2.8504318181818182,2.8052345454545455,2.5379427272727275,2.528848181818182,2.3818
14
+ OR4G11P,6.050096666666667,6.040303333333333,6.553813333333333,5.955486666666666,7.466906666666667,6.728756666666667,7.782236666666667,6.103573333333333,7.008456666666666,6.8762566666666665,6.245583333333333,6.1702900000000005,6.130046666666667,5.723003333333334,6.996146666666666,5.014356666666667,5.0445,6.3299900000000004,5.8924900000000004,5.463636666666666,6.221896666666667,6.938546666666666,7.92445,8.939186666666666,7.8144100000000005,5.33611,6.837923333333333,5.663173333333333,6.35744,5.252483333333333,6.215463333333334,5.7867033333333335,6.33791,5.661716666666667,5.095316666666667,4.4682933333333335
15
+ OR4G1P,6.050096666666667,6.040303333333333,6.553813333333333,5.955486666666666,7.466906666666667,6.728756666666667,7.782236666666667,6.103573333333333,7.008456666666666,6.8762566666666665,6.245583333333333,6.1702900000000005,6.130046666666667,5.723003333333334,6.996146666666666,5.014356666666667,5.0445,6.3299900000000004,5.8924900000000004,5.463636666666666,6.221896666666667,6.938546666666666,7.92445,8.939186666666666,7.8144100000000005,5.33611,6.837923333333333,5.663173333333333,6.35744,5.252483333333333,6.215463333333334,5.7867033333333335,6.33791,5.661716666666667,5.095316666666667,4.4682933333333335
16
+ OR4G2P,6.050096666666667,6.040303333333333,6.553813333333333,5.955486666666666,7.466906666666667,6.728756666666667,7.782236666666667,6.103573333333333,7.008456666666666,6.8762566666666665,6.245583333333333,6.1702900000000005,6.130046666666667,5.723003333333334,6.996146666666666,5.014356666666667,5.0445,6.3299900000000004,5.8924900000000004,5.463636666666666,6.221896666666667,6.938546666666666,7.92445,8.939186666666666,7.8144100000000005,5.33611,6.837923333333333,5.663173333333333,6.35744,5.252483333333333,6.215463333333334,5.7867033333333335,6.33791,5.661716666666667,5.095316666666667,4.4682933333333335
17
+ PCMTD2,11.954778592657341,11.941938723776223,12.502974353146854,11.841850034965034,13.387771083916084,13.286129195804197,13.373973994755245,12.654465332167833,12.8289993006993,11.841845472027972,12.099538575174824,12.319394685314686,11.269329125874126,12.61571673076923,12.995971756993008,12.535777928321679,12.716636861888112,12.17857867132867,12.187021433566434,11.859662255244755,12.485847307692307,12.781406337412587,14.230922666083917,13.418801363636364,12.827725332167832,12.852568776223777,12.701675017482517,11.858057027972029,12.399721276223776,12.23880763986014,11.94788354020979,12.087062972027972,12.753888050699302,12.772012482517482,12.76449465034965,12.55515347027972
18
+ SEPT14,8.016869615384614,8.08624576923077,8.447362307692309,7.763642307692308,9.071396538461538,8.763796923076923,9.096681153846154,8.361421923076923,8.741898846153846,8.037231153846154,8.125028461538461,8.213884230769231,7.590822307692307,8.23370423076923,8.69336346153846,8.14929076923077,8.139425384615386,8.239857307692308,8.141864615384616,7.851088846153846,8.458737307692306,8.52741076923077,9.71157346153846,9.304085,8.865341923076922,8.46744423076923,8.365381153846153,8.041998846153847,8.199429230769232,8.16491923076923,7.880811153846153,8.131606153846153,8.461318846153846,8.388183846153847,8.250611923076923,8.233411538461539
p1/preprocess/Coronary_artery_disease/gene_data/GSE234398.csv ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ Gene,GSM7466724,GSM7466725,GSM7466726,GSM7466727,GSM7466728,GSM7466729,GSM7466730,GSM7466731,GSM7466732,GSM7466733,GSM7466734,GSM7466735,GSM7466736,GSM7466737,GSM7466738,GSM7466739,GSM7466740,GSM7466741,GSM7466742,GSM7466743,GSM7466744,GSM7466745,GSM7466746,GSM7466747,GSM7466748,GSM7466749,GSM7466750,GSM7466751,GSM7466752,GSM7466753,GSM7466754,GSM7466755,GSM7466756,GSM7466757,GSM7466758,GSM7466759,GSM7466760,GSM7466761,GSM7466762,GSM7466763,GSM7466764,GSM7466765,GSM7466766,GSM7466767,GSM7466768,GSM7466769,GSM7466770,GSM7466771,GSM7466772,GSM7466773
2
+ OR4F16,7.19214649,6.576562922,6.545799991,6.436323954,6.413077432,6.287916616,6.280782204,6.30447081,6.357414428,6.268509572,6.281266895,6.151752253,6.255746823,6.340998064,6.38559587,6.23471729,6.317008022,6.278677015,6.109307704,6.190352261,6.236224183,6.281667576,7.556710674,6.169749396,6.296524912,6.178247628,6.352048596,7.132781518,6.742861672,7.29946814,6.463818756,6.223180893,6.329499474,6.629614764,7.119909383,6.32611203,6.452185843,6.362527539,6.195375635,7.356249466,6.443506355,6.357643627,6.271310888,6.341671549,6.271291722,6.345101588,6.311109504,6.437559724,6.292672674,6.288120785
3
+ OR4F17,6.718178322,6.224044646,6.435445744,6.490503767,6.595534968,6.323837555,6.35984804,6.653774883,6.426571746,6.365386638,6.37529394,6.435114449,6.351319266,6.388024298,6.480037703,6.443494165,6.477826541,6.369023879,6.386197998,6.246819271,6.353996043,6.502622534,7.749888202,7.044470762,6.505622874,7.648512431,6.713791968,7.871695241,6.722160578,7.29946814,6.512763807,6.365746491,6.395279192,6.641002304,7.987464189,6.447788584,6.534663217,6.416691949,6.940939186,6.899416384,6.256888609,6.373967809,6.359991305,6.335630956,6.355202547,6.372037269,6.39921953,6.514568707,6.63457348,6.415886968
4
+ OR4F21,12.94175976,12.38025835,12.828603267,12.479690141999999,12.979823272,12.804021396,12.501795923,13.366779796,12.396176543,12.376095792,12.524393906,12.553220011,12.518336115,12.629654798,12.692659003,12.740417286,12.589588216,12.551878543,12.528386909,12.631713528999999,12.542939342,12.448093575,13.772386217000001,12.501381472999999,12.612392846999999,13.835287927,12.709352557999999,14.20106019,12.742233418000001,13.480614852,12.81871651,12.901412268,12.624950163000001,12.983532556,14.917946292,12.830312234,12.706245275,12.636176821,13.148853004,13.503012263,12.670990053,12.75812537,12.618186238,12.753158964,12.741971060000001,12.742828517,12.726996302,13.111639089,13.006736959,12.842939105
5
+ OR4F29,6.206088049,6.316459767,6.26733858,6.42999054,6.258279226,6.227367004,6.378062866,6.411066826,6.248948,6.324711801,6.397625792,6.335795128,6.351319266,6.3668584,6.334382883,6.36557099,6.342773416,6.335266747,6.590527296,6.37074988,6.275673415,6.40115259,6.188845846,6.404775766,6.403128996,6.682352825,6.443397139,6.138784844,6.763296019,7.29946814,6.233437779,6.35464482,6.194338722,6.282393982,6.2631066,6.354688429,6.225215323,6.193597162,6.234313418,6.240295235,6.281204711,6.30292116,6.262456341,6.214963767,6.220445662,6.299451146,6.327369191,6.281382323,6.318738192,6.328517763
6
+ OR4F3,6.209929485,6.179052129,6.376757187,6.32224937,6.344475571,6.172516586,6.217274363,6.312676964,6.085256784,6.174174611,6.33801137,6.266543135,6.165037729,6.139139022,6.344201174,6.379474602,6.289127117,6.331282078,6.181611482,6.315056729,6.313269524,6.292286952,7.154842586,6.316761927,6.395353642,6.926691088,6.436380513,6.132068554,6.238649321,6.332013877,6.403147061,6.236348624,6.433467374,6.29533327,6.119455869,6.423622485,6.543911008,6.299102444,6.175255705,6.178978484,6.331156556,6.25683737,6.233396043,6.355437703,6.216703451,6.439904497,6.352481308,6.278444172,6.484112772,6.335027655
7
+ OR4F4,14.390449732,12.884393109000001,12.930186599999999,12.879121138,13.53872248,12.740438011,12.833988013999999,13.576808031,12.969049005999999,12.70351805,12.793494853,12.834802917000001,12.719685883,12.736303620000001,13.180973678,12.771784428,12.970246676999999,12.737106679,12.720166041999999,12.978709432,12.709540021,13.85137767,13.856248126,13.703376916,12.772200206,15.367356142999999,13.822670762,15.968506774,13.928309882,14.59893628,13.384636469,13.315010164,12.802180065,13.100068132,14.168817139,12.967550877,13.194715355,13.043801942,14.94285247,15.003042802,12.936412471,12.933864301,12.863687243000001,12.751224396,12.923448606000001,12.990284540000001,13.56899267,13.149001716,12.958869241999999,13.342468972
8
+ OR4F5,12.351128662,12.565935366,12.693185071,12.627548417,12.825669687,12.689666931,12.615502987,13.149022172999999,12.682804245,12.564098722,12.553069982,12.863744679,12.337937294,12.725155854,12.847036963,12.437512328,12.63557862,12.806534826,12.725138335,12.789657002,12.44178015,12.829775197,15.531182531999999,12.549479023,12.354940614,13.890541332,13.218594592999999,13.614277088,13.393670023,14.556915839,12.893067329,12.820857249,13.125816965,13.115305192000001,13.781450746,12.491213538,12.973490021,12.761648862,12.935172833,13.349404804,12.624652157,12.738013727,12.603015755,12.683419803,12.689251538,12.741096245,12.996042763,12.66603731,12.677565046,13.100301872
9
+ PCMTD2,7.556499488,6.903402857,7.591533657,7.06650667,7.107523705,6.922675531,6.945779381,6.873561739,6.950645893,6.915836398,7.018920104,7.489466858,7.135449197,6.88763474,6.974376455,7.342231312,7.093722803,6.932443801,7.012428117,7.479939524,6.980206603,6.971641919,6.198809392,6.916452879,7.068483244,6.204293133,7.122573314,7.290921676,7.18544821,7.134993798,7.536795745,7.514265932,6.994860371,7.356721607,6.069828637,7.117280519,7.22682509,7.503657516,7.237725273,7.492262286,7.089594085,7.340059425,6.949553064,7.310311468,6.969380669,6.834429698,7.027944865,6.842833584,6.856283248,7.281597482
p1/preprocess/Coronary_artery_disease/gene_data/GSE250283.csv ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ Gene,GSM7976778,GSM7976779,GSM7976780,GSM7976781,GSM7976782,GSM7976783,GSM7976784,GSM7976785,GSM7976786,GSM7976787,GSM7976788,GSM7976789,GSM7976790,GSM7976791,GSM7976792,GSM7976793,GSM7976794,GSM7976795,GSM7976796,GSM7976797,GSM7976798,GSM7976799,GSM7976800,GSM7976801,GSM7976802,GSM7976803,GSM7976804,GSM7976805,GSM7976806,GSM7976807,GSM7976808,GSM7976809,GSM7976810,GSM7976811,GSM7976812,GSM7976813,GSM7976814,GSM7976815,GSM7976816,GSM7976817,GSM7976818,GSM7976819,GSM7976820,GSM7976821,GSM7976822,GSM7976823,GSM7976824,GSM7976825,GSM7976826,GSM7976827,GSM7976828,GSM7976829,GSM7976830,GSM7976831,GSM7976832,GSM7976833
2
+ OR4F17,8.39917776,7.498310514,7.899438113,7.815489905,7.550307954999999,7.666707473,7.893634912,7.292910327,7.985210411,7.736345372000001,8.509218864000001,7.648883922,8.017898747,7.874075572,7.924772132,7.110337379000001,7.863007744000001,7.938964467,8.150110731,7.504477208,7.807657566,8.493593227,8.07750946,7.931726373,8.197002236,7.941317479,7.201088479,7.696785097999999,7.878561315999999,7.886128048,8.704765111,7.419797052,7.342928273,8.423377414,8.242833529,7.716481954999999,8.020970155,7.856958779,7.917633944,8.440434531000001,7.392164848,7.999484065,8.338463021,8.064370899,7.893526102000001,8.633023761,8.790930376999999,7.638804283,7.722898926,8.162657877,7.901459923000001,8.334940186,7.832381409,8.207968805,8.177672592,7.78778576
3
+ OR4F21,3.394002825,5.043670556,3.676379115,3.924938371,3.852048722,4.166875748,3.990201258,3.846634602,4.12350742,3.979240708,4.076449456,4.412181431,4.214326031,3.782470698,4.275263645,4.052711906,4.236640378,4.11497141,3.71840677,3.808710928,3.940280616,4.376369289,4.483926942,3.920706673,3.899219826,4.290758808,3.796620186,3.871290836,4.358579562,4.181752022,4.586174442,3.990604791,4.189434895,4.020626871,4.254679438,4.312600995,4.147358501,4.08258432,4.787908788,4.374221218,3.73095145,3.973678034,4.060025065,3.957571434,4.548184411,4.427592236,3.860902315,3.74013543,4.022831082,4.079974852,4.611315806,3.795307888,4.495840967,3.948484457,3.999697318,4.006724483
4
+ OR4F29,7.7886183970000005,7.417494797,7.566575321,7.544447363,7.8857377369999995,7.711859042,7.781277341,7.039641261,8.063991534,7.841526752,7.79841899,7.498316504,7.664310723,8.242086325,7.849328432,7.443963274,8.284737744000001,7.833461089,8.337756038,8.16802122,7.347433734,8.256433068,8.445854873,7.707094659,7.276017124,8.101923006,8.174688896,8.00721901,8.140185129999999,7.994397728999999,7.709316277000001,7.415969333,7.693755585,8.309921519,7.936968983,8.021027633,7.699777452,7.967144725,7.786491628,7.987273609000001,7.627464819,7.487327467,7.863223871000001,7.5130719710000005,7.982648761,7.743094506,7.308197694,7.611470803,8.04948271,7.935216535,7.936253218,7.699653658,7.804376288,8.322397672,7.713331171,8.075227215
5
+ OR4F5,3.983861157,3.686079131,4.216821089,3.816671959,3.988664727,3.851116172,4.124736288,4.534871462,3.844338116,3.658782135,4.305969868,3.562816092,4.016619831,4.24735238,3.955370719,4.055344375,3.951431802,3.89627819,4.109398648,3.772707198,3.485495078,3.820071837,4.588196926,3.615142566,3.907920417,3.433968697,3.83882854,3.225284918,4.157332188,4.249596846,3.037691154,4.270882531,3.447336509,3.69406267,4.132685453,3.389244264,4.016770365,3.775786015,4.094758107,4.077078595,3.943935884,3.862661857,3.683417252,4.324686805,3.827792798,3.711024611,4.452498118,3.749399154,3.924785771,4.440980893,3.842421336,3.771794677,3.272647354,4.744383895,3.557263001,4.386810719
6
+ PCMTD2,7.296763319,7.617113959,6.762966033,7.30481409,7.049162323,6.859773863,7.050210226,7.286461877,7.471057359,6.810382051,7.366965944,7.23930192,6.840907182,6.487296305,7.861704323,7.284120163,7.362850368,7.175481678,7.446235933,7.243569171,7.4781623,7.086958572,7.867278023,6.181004713,6.911886466,6.50472716,6.719022561,7.143765691,7.043154203,7.395895413,6.899160489,8.016959344,7.004233941,7.41877036,7.459305374,7.62198626,7.016424778,7.334538578,7.628606616,5.873754115,8.351937789,6.859773761,7.129887085,7.563641858,7.438846456,6.965239902,7.944058154,6.852059066,6.536778594,6.562138741,7.115322242,7.164950891,6.517679133,7.555497783,6.979425536,7.240646691
p1/preprocess/Coronary_artery_disease/gene_data/GSE54975.csv ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ Gene,GSM1321503,GSM1321504,GSM1321505,GSM1321506,GSM1321507,GSM1321508,GSM1321509,GSM1321510,GSM1321511,GSM1321512,GSM1321513,GSM1321514
2
+ OR4F16,7.374616789,7.199276385,6.985321506,7.171290095,7.136865772,7.17885712,7.142918855,7.153983695,7.156164563,7.041056903,7.034679832,7.172339452
3
+ OR4F17,7.280257516,7.225102408,7.183950717,7.130053943,7.183138843,7.170493446,7.321703968,7.116205267,7.232896792,7.209766505,7.165193423,7.209739682
4
+ OR4F21,14.550516229,14.497875473,14.32944266,14.319000297999999,14.367461016,14.253881504999999,14.374922727000001,14.468511653,14.445716111,14.548755915000001,14.385871068,14.429175842
5
+ OR4F29,7.08104095,7.206312522,7.047931458,7.133563625,7.140943412,6.99856766,7.079927868,7.125469619,7.170464049,7.293756235,7.207122479,7.122898085
6
+ OR4F3,7.51904889,7.387278871,7.589143605,7.49293646,7.446873762,7.373198012,7.415690889,7.422384958,7.446853935,7.370044016,7.479556642,7.389340302
7
+ OR4F4,14.283950559,14.315509491,14.347006786,14.158915668,14.250732722999999,14.274860873,14.278251019999999,14.188342589000001,14.231755042,14.1712016,14.504046959,14.306680199999999
8
+ OR4F5,14.197337723,14.218020871,14.332120434,14.290842293,14.205955298,14.787889491000001,14.081341457,14.183063271,14.199791667,14.413206806,14.375656110000001,14.294718974
9
+ PCMTD2,9.14436055,9.177249863,9.308431275,9.55038195,9.277780772,9.532500647,8.985663072,8.920603848,9.07076241,9.025090121,8.852786965,9.267848452