Liu-Hy commited on
Commit
dd19378
·
verified ·
1 Parent(s): 4144951

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 +26 -0
  2. p3/preprocess/Acute_Myeloid_Leukemia/GSE222124.csv +3 -0
  3. p3/preprocess/Acute_Myeloid_Leukemia/GSE249638.csv +3 -0
  4. p3/preprocess/Acute_Myeloid_Leukemia/GSE98578.csv +3 -0
  5. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE121291.csv +2 -0
  6. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE121431.csv +2 -0
  7. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE161532.csv +4 -0
  8. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE222124.csv +2 -0
  9. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE222169.csv +2 -0
  10. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE235070.csv +2 -0
  11. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE249638.csv +2 -0
  12. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE98578.csv +2 -0
  13. p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE99612.csv +4 -0
  14. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE121291.py +127 -0
  15. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE121431.py +139 -0
  16. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE161532.py +156 -0
  17. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE222124.py +137 -0
  18. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE222169.py +177 -0
  19. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE222616.py +120 -0
  20. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE235070.py +85 -0
  21. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE249638.py +142 -0
  22. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE98578.py +144 -0
  23. p3/preprocess/Acute_Myeloid_Leukemia/code/GSE99612.py +110 -0
  24. p3/preprocess/Acute_Myeloid_Leukemia/code/TCGA.py +147 -0
  25. p3/preprocess/Acute_Myeloid_Leukemia/cohort_info.json +1 -0
  26. p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE121291.csv +0 -0
  27. p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE121431.csv +0 -0
  28. p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE222169.csv +1 -0
  29. p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE222616.csv +1 -0
  30. p3/preprocess/Adrenocortical_Cancer/GSE75415.csv +0 -0
  31. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE108088.csv +2 -0
  32. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE143383.csv +3 -0
  33. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE19776.csv +4 -0
  34. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE49278.csv +4 -0
  35. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE68606.csv +4 -0
  36. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE68950.csv +2 -0
  37. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE75415.csv +3 -0
  38. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE76019.csv +2 -0
  39. p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE90713.csv +2 -0
  40. p3/preprocess/Adrenocortical_Cancer/clinical_data/TCGA.csv +93 -0
  41. p3/preprocess/Adrenocortical_Cancer/code/GSE108088.py +179 -0
  42. p3/preprocess/Adrenocortical_Cancer/code/GSE143383.py +205 -0
  43. p3/preprocess/Adrenocortical_Cancer/code/GSE19776.py +194 -0
  44. p3/preprocess/Adrenocortical_Cancer/code/GSE49278.py +166 -0
  45. p3/preprocess/Adrenocortical_Cancer/code/GSE67766.py +199 -0
  46. p3/preprocess/Adrenocortical_Cancer/code/GSE75415.py +177 -0
  47. p3/preprocess/Adrenocortical_Cancer/cohort_info.json +1 -0
  48. p3/preprocess/Stomach_Cancer/gene_data/TCGA.csv +3 -0
  49. p3/preprocess/Type_1_Diabetes/gene_data/TCGA.csv +3 -0
  50. p3/preprocess/Underweight/gene_data/TCGA.csv +3 -0
.gitattributes CHANGED
@@ -1390,3 +1390,29 @@ p3/preprocess/Underweight/gene_data/GSE84954.csv filter=lfs diff=lfs merge=lfs -
1390
  p3/preprocess/Type_2_Diabetes/gene_data/GSE182121.csv filter=lfs diff=lfs merge=lfs -text
1391
  p3/preprocess/Underweight/gene_data/GSE57802.csv filter=lfs diff=lfs merge=lfs -text
1392
  p3/preprocess/Stomach_Cancer/TCGA.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1390
  p3/preprocess/Type_2_Diabetes/gene_data/GSE182121.csv filter=lfs diff=lfs merge=lfs -text
1391
  p3/preprocess/Underweight/gene_data/GSE57802.csv filter=lfs diff=lfs merge=lfs -text
1392
  p3/preprocess/Stomach_Cancer/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1393
+ p3/preprocess/Uterine_Carcinosarcoma/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1394
+ p3/preprocess/Vitamin_D_Levels/GSE123993.csv filter=lfs diff=lfs merge=lfs -text
1395
+ p3/preprocess/Type_1_Diabetes/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1396
+ p3/preprocess/Vitamin_D_Levels/gene_data/GSE123993.csv filter=lfs diff=lfs merge=lfs -text
1397
+ p3/preprocess/Stomach_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1398
+ p3/preprocess/Vitamin_D_Levels/gene_data/GSE34450.csv filter=lfs diff=lfs merge=lfs -text
1399
+ p3/preprocess/Werner_Syndrome/GSE48761.csv filter=lfs diff=lfs merge=lfs -text
1400
+ p3/preprocess/Vitamin_D_Levels/gene_data/GSE76324.csv filter=lfs diff=lfs merge=lfs -text
1401
+ p3/preprocess/Werner_Syndrome/gene_data/GSE48761.csv filter=lfs diff=lfs merge=lfs -text
1402
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/GSE180393.csv filter=lfs diff=lfs merge=lfs -text
1403
+ p3/preprocess/Vitamin_D_Levels/GSE129604.csv filter=lfs diff=lfs merge=lfs -text
1404
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/GSE156309.csv filter=lfs diff=lfs merge=lfs -text
1405
+ p3/preprocess/Underweight/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1406
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/gene_data/GSE222124.csv filter=lfs diff=lfs merge=lfs -text
1407
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/GSE239832.csv filter=lfs diff=lfs merge=lfs -text
1408
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/gene_data/GSE156309.csv filter=lfs diff=lfs merge=lfs -text
1409
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/gene_data/GSE180393.csv filter=lfs diff=lfs merge=lfs -text
1410
+ p3/preprocess/Vitamin_D_Levels/gene_data/GSE129604.csv filter=lfs diff=lfs merge=lfs -text
1411
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/gene_data/GSE190042.csv filter=lfs diff=lfs merge=lfs -text
1412
+ p3/preprocess/Uterine_Corpus_Endometrial_Carcinoma/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1413
+ p3/preprocess/Uterine_Carcinosarcoma/gene_data/GSE68950.csv filter=lfs diff=lfs merge=lfs -text
1414
+ p3/preprocess/Uterine_Corpus_Endometrial_Carcinoma/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1415
+ p3/preprocess/Acute_Myeloid_Leukemia/GSE249638.csv filter=lfs diff=lfs merge=lfs -text
1416
+ p3/preprocess/Acute_Myeloid_Leukemia/GSE98578.csv filter=lfs diff=lfs merge=lfs -text
1417
+ p3/preprocess/Acute_Myeloid_Leukemia/GSE222124.csv filter=lfs diff=lfs merge=lfs -text
1418
+ p3/preprocess/X-Linked_Lymphoproliferative_Syndrome/gene_data/GSE239832.csv filter=lfs diff=lfs merge=lfs -text
p3/preprocess/Acute_Myeloid_Leukemia/GSE222124.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f205ba0aa1ab83409ba3a8672017b0ae7f27631c1f7b34841e549550220df9f
3
+ size 13765210
p3/preprocess/Acute_Myeloid_Leukemia/GSE249638.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a361b229a4d45e13416428a8743199dfa9a755341d7d9d2e6c63a80d79461c12
3
+ size 11134453
p3/preprocess/Acute_Myeloid_Leukemia/GSE98578.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da3b1805cb6773c07c1a969f1250e134efdda7b55efaa7af30b4e466935db099
3
+ size 12728570
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE121291.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,0
2
+ Acute_Myeloid_Leukemia,1.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE121431.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM3430924,GSM3430925,GSM3430926,GSM3430927,GSM3430928,GSM3430929,GSM3430930,GSM3430931,GSM3430932,GSM3430933,GSM3430934,GSM3430935,GSM3430936,GSM3430937,GSM3430938,GSM3430939,GSM3430940,GSM3430941,GSM3430942,GSM3430943,GSM3430944,GSM3430945,GSM3430946,GSM3430947,GSM3430948,GSM3430949,GSM3430950,GSM3430951,GSM3430952,GSM3430953
2
+ Acute_Myeloid_Leukemia,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE161532.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM4909492,GSM4909493,GSM4909494,GSM4909495,GSM4909496,GSM4909497,GSM4909498,GSM4909499,GSM4909500,GSM4909501,GSM4909502,GSM4909503,GSM4909504,GSM4909505,GSM4909506,GSM4909507,GSM4909508,GSM4909509,GSM4909510,GSM4909511,GSM4909512,GSM4909513,GSM4909514,GSM4909515,GSM4909516,GSM4909517,GSM4909518,GSM4909519,GSM4909520,GSM4909521,GSM4909522,GSM4909523,GSM4909524,GSM4909525,GSM4909526,GSM4909527,GSM4909528,GSM4909529,GSM4909530,GSM4909531,GSM4909532,GSM4909533,GSM4909534,GSM4909535,GSM4909536,GSM4909537,GSM4909538,GSM4909539,GSM4909540,GSM4909541,GSM4909542,GSM4909543,GSM4909544,GSM4909545,GSM4909546,GSM4909547,GSM4909548,GSM4909549,GSM4909550,GSM4909551,GSM4909552
2
+ Acute_Myeloid_Leukemia,0.0,1.0,0.0,0.0,,0.0,0.0,0.0,,1.0,0.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,1.0,0.0,0.0,0.0,,,1.0,0.0,0.0,,0.0,1.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,0.0,0.0,1.0,1.0,0.0,,0.0,1.0,0.0,0.0,0.0
3
+ Age,54.0,66.0,65.0,38.0,,51.0,82.0,70.0,,69.0,72.0,59.0,47.0,67.0,63.0,42.0,71.0,64.0,57.0,70.0,62.0,66.0,60.0,67.0,66.0,76.0,31.0,67.0,52.0,69.0,,62.0,62.0,50.0,76.0,60.0,62.0,66.0,72.0,62.0,67.0,68.0,68.0,34.0,61.0,71.0,42.0,57.0,,39.0,64.0,77.0,66.0,66.0,39.0,,73.0,74.0,42.0,64.0,45.0
4
+ Gender,0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.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,0.0,1.0,1.0,1.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE222124.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM6915207,GSM6915208,GSM6915209,GSM6915210,GSM6915211,GSM6915212,GSM6915213,GSM6915214,GSM6915215,GSM6915216,GSM6915217,GSM6915218,GSM6915219,GSM6915220,GSM6915221,GSM6915222,GSM6915223,GSM6915224,GSM6915225,GSM6915226,GSM6915227,GSM6915228,GSM6915229,GSM6915230,GSM6915231,GSM6915232,GSM6915233,GSM6915234,GSM6915235,GSM6915236,GSM6915237,GSM6915238,GSM6915239,GSM6915240,GSM6915241,GSM6915242,GSM6915243,GSM6915244,GSM6915245,GSM6915246,GSM6915247,GSM6915248,GSM6915249,GSM6915250,GSM6915251,GSM6915252,GSM6915253,GSM6915254,GSM6915255,GSM6915256,GSM6915257,GSM6915258,GSM6915259,GSM6915260,GSM6915261,GSM6915262,GSM6915263,GSM6915264,GSM6915265,GSM6915266,GSM6915267,GSM6915268,GSM6915269,GSM6915270,GSM6915271,GSM6915272,GSM6915273,GSM6915274,GSM6915275,GSM6915276
2
+ Acute_Myeloid_Leukemia,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE222169.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM6916956,GSM6916957,GSM6916958,GSM6916959,GSM6916960,GSM6916961,GSM6916962,GSM6916963,GSM6916964,GSM6916965,GSM6916966,GSM6916967,GSM6916968,GSM6916969,GSM6916970,GSM6916971,GSM6916972,GSM6916973,GSM6916974,GSM6916975,GSM6916976,GSM6916977,GSM6916978,GSM6916979,GSM6916980,GSM6916981,GSM6916982,GSM6916983,GSM6916984,GSM6916985,GSM6916986,GSM6916987,GSM6916988,GSM6916989,GSM6916990,GSM6916991,GSM6916992,GSM6916993,GSM6916994,GSM6916995,GSM6916996,GSM6916997
2
+ Acute_Myeloid_Leukemia,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE235070.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM7494217,GSM7494218,GSM7494219,GSM7494220,GSM7494221,GSM7494222,GSM7494223,GSM7494224,GSM7494249,GSM7494250,GSM7494251,GSM7494252,GSM7494253,GSM7494254,GSM7494255,GSM7494256,GSM7494509,GSM7494510,GSM7494511,GSM7494512,GSM7494513,GSM7494514,GSM7494515,GSM7494516,GSM7494517,GSM7494518,GSM7494519,GSM7494520,GSM7494521,GSM7494522,GSM7494523,GSM7494524
2
+ Acute_Myeloid_Leukemia,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE249638.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM7956652,GSM7956653,GSM7956654,GSM7956655,GSM7956656,GSM7956657,GSM7956658,GSM7956659,GSM7956660,GSM7956661,GSM7956662,GSM7956663,GSM7956664,GSM7956665,GSM7956666,GSM7956667,GSM7956668,GSM7956669,GSM7956670,GSM7956671,GSM7956672,GSM7956673,GSM7956674,GSM7956675,GSM7956676,GSM7956677,GSM7956678,GSM7956679,GSM7956680,GSM7956681,GSM7956682,GSM7956683,GSM7956684,GSM7956685,GSM7956686,GSM7956687,GSM7956688
2
+ Acute_Myeloid_Leukemia,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE98578.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM2601197,GSM2601198,GSM2601199,GSM2601200,GSM2601201,GSM2601202,GSM2601203,GSM2601204,GSM2601205,GSM2601206,GSM2601207,GSM2601208,GSM2601209,GSM2601210,GSM2601211,GSM2601212,GSM2601213,GSM2601214,GSM2601215,GSM2601216,GSM2601217,GSM2601218,GSM2601219,GSM2601220,GSM2601221,GSM2601222,GSM2601223,GSM2601224,GSM2601225,GSM2601226,GSM2601227,GSM2601228,GSM2601229,GSM2601230,GSM2601231,GSM2601232,GSM2601233,GSM2601234,GSM2601235,GSM2601236,GSM2601237,GSM2601238,GSM2601239,GSM2601240,GSM2601241,GSM2601242,GSM2601243,GSM2601244
2
+ Acute_Myeloid_Leukemia,1.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,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,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0
p3/preprocess/Acute_Myeloid_Leukemia/clinical_data/GSE99612.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM2648543,GSM2648544,GSM2648545,GSM2648546,GSM2648547,GSM2648548,GSM2648549,GSM2648550,GSM2648551,GSM2648552,GSM2648553,GSM2648554,GSM2648555,GSM2648556,GSM2648557,GSM2648558,GSM2648559,GSM2648560,GSM2648561,GSM2648562,GSM2648563,GSM2648564,GSM2648565,GSM2648566,GSM2648567,GSM2648568,GSM2648569,GSM2648570,GSM2648571,GSM2648572,GSM2648573,GSM2648574,GSM2648575,GSM2648576,GSM2648577,GSM2648578,GSM2648579,GSM2648580,GSM2648581,GSM2648582,GSM2648583,GSM2648584,GSM2648585,GSM2648586,GSM2648587,GSM2648588,GSM2648589,GSM2648590
2
+ Acute_Myeloid_Leukemia,,,,,,,,,,,,,,,,,,,,,,,,,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
3
+ Age,,,,,,,,,,,,,,,,,,,,,,,,,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
4
+ Gender,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,,,,,,,,,,,,,,,,,,,,,,,,
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE121291.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE121291"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE121291"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE121291.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE121291.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE121291.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes - the dataset contains microarray mRNA data according to series title
38
+ is_gene_available = True
39
+
40
+ # 2. Variable Availability and Data Type Conversion
41
+ # All samples are AML cell line - constant trait value
42
+ trait_row = None
43
+
44
+ # No age data available
45
+ age_row = None
46
+
47
+ # No gender data available since this is cell line data
48
+ gender_row = None
49
+
50
+ def convert_trait(x):
51
+ # Convert AML status to binary
52
+ # If contains "Acute Myeloid Leukemia", return 1
53
+ if isinstance(x, str) and "Acute Myeloid Leukemia" in x:
54
+ return 1
55
+ return None
56
+
57
+ def convert_age(x):
58
+ pass
59
+
60
+ def convert_gender(x):
61
+ pass
62
+
63
+ # 3. Save metadata
64
+ validate_and_save_cohort_info(
65
+ is_final=False,
66
+ cohort=cohort,
67
+ info_path=json_path,
68
+ is_gene_available=is_gene_available,
69
+ is_trait_available=trait_row is not None
70
+ )
71
+
72
+ # 4. Skip clinical feature extraction since trait_row is None
73
+ # Extract gene expression data from matrix file
74
+ gene_data = get_genetic_data(matrix_file)
75
+
76
+ # Print first 20 row IDs
77
+ print("First 20 gene/probe identifiers:")
78
+ print(gene_data.index[:20])
79
+ # The gene identifiers look like Affymetrix probe IDs (format: digit+_at/s_at/x_at)
80
+ # These need to be mapped to gene symbols for analysis
81
+ requires_gene_mapping = True
82
+ # Extract gene annotation from SOFT file
83
+ gene_annotation = get_gene_annotation(soft_file)
84
+
85
+ # Preview gene annotation data
86
+ print("Gene annotation columns and example values:")
87
+ print(preview_df(gene_annotation))
88
+ # 1. Observe columns - 'ID' for probe identifiers matching gene expression data, 'Gene Symbol' for gene symbols
89
+ prob_col = 'ID'
90
+ gene_col = 'Gene Symbol'
91
+
92
+ # 2. Get mapping between probe IDs and gene symbols
93
+ mapping = get_gene_mapping(gene_annotation, prob_col, gene_col)
94
+
95
+ # 3. Apply mapping to convert probe expression to gene expression
96
+ gene_data = apply_gene_mapping(gene_data, mapping)
97
+
98
+ # Preview the first few gene IDs to verify the mapping worked
99
+ print("First 20 mapped gene symbols:")
100
+ print(gene_data.index[:20])
101
+ # 1. Normalize gene symbols and save normalized gene data
102
+ gene_data = normalize_gene_symbols_in_index(gene_data)
103
+ gene_data.to_csv(out_gene_data_file)
104
+
105
+ # Create minimal linked data with just gene expression data
106
+ linked_data = gene_data.T
107
+
108
+ # Add trait column initialized to None
109
+ linked_data[trait] = None
110
+
111
+ # Handle missing values systematically
112
+ linked_data = handle_missing_values(linked_data, trait)
113
+
114
+ # Check for biased features
115
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
116
+
117
+ # Validate data quality and save metadata
118
+ is_usable = validate_and_save_cohort_info(
119
+ is_final=True,
120
+ cohort=cohort,
121
+ info_path=json_path,
122
+ is_gene_available=True,
123
+ is_trait_available=False,
124
+ is_biased=is_biased,
125
+ df=linked_data,
126
+ note="Dataset contains gene expression data from cell lines but lacks AML trait information needed for analysis."
127
+ )
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE121431.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE121431"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE121431"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE121431.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE121431.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE121431.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ is_gene_available = True # Based on the background info, this appears to be gene expression data of AML cell lines
38
+
39
+ # 2. Variable Availability and Data Type Conversion
40
+ # For trait: Can infer from Feature 0 (disease state)
41
+ trait_row = 0
42
+
43
+ def convert_trait(value):
44
+ if not isinstance(value, str):
45
+ return None
46
+ value = value.lower().split(': ')[-1]
47
+ if 'acute myeloid leukemia' in value or 'aml' in value:
48
+ return 1
49
+ return None
50
+
51
+ # For age: Not available as this is cell line data
52
+ age_row = None
53
+
54
+ def convert_age(value):
55
+ return None
56
+
57
+ # For gender: Not available as this is cell line data
58
+ gender_row = None
59
+
60
+ def convert_gender(value):
61
+ return None
62
+
63
+ # 3. Save Metadata
64
+ validate_and_save_cohort_info(
65
+ is_final=False,
66
+ cohort=cohort,
67
+ info_path=json_path,
68
+ is_gene_available=is_gene_available,
69
+ is_trait_available=(trait_row is not None)
70
+ )
71
+
72
+ # 4. Clinical Feature Extraction
73
+ clinical_df = geo_select_clinical_features(
74
+ clinical_data,
75
+ trait=trait,
76
+ trait_row=trait_row,
77
+ convert_trait=convert_trait,
78
+ age_row=age_row,
79
+ convert_age=convert_age,
80
+ gender_row=gender_row,
81
+ convert_gender=convert_gender
82
+ )
83
+ preview_result = preview_df(clinical_df)
84
+ print("Preview of clinical data:", preview_result)
85
+
86
+ # Save clinical data
87
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
88
+ clinical_df.to_csv(out_clinical_data_file)
89
+ # Extract gene expression data from matrix file
90
+ gene_data = get_genetic_data(matrix_file)
91
+
92
+ # Print first 20 row IDs
93
+ print("First 20 gene/probe identifiers:")
94
+ print(gene_data.index[:20])
95
+ # These are probe IDs from Affymetrix arrays that need to be mapped to gene symbols
96
+ requires_gene_mapping = True
97
+ # Extract gene annotation from SOFT file
98
+ gene_annotation = get_gene_annotation(soft_file)
99
+
100
+ # Preview gene annotation data
101
+ print("Gene annotation columns and example values:")
102
+ print(preview_df(gene_annotation))
103
+ # 1. & 2. Extract gene mapping from annotation
104
+ # ID column matches probe identifiers in gene expression data
105
+ # Gene Symbol column contains the corresponding gene symbols
106
+ mapping_data = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
107
+
108
+ # 3. Apply gene mapping to convert probe-level data to gene-level data
109
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
110
+ # 1. Normalize gene symbols and save normalized gene data
111
+ gene_data = normalize_gene_symbols_in_index(gene_data)
112
+ gene_data.to_csv(out_gene_data_file)
113
+
114
+ # 2. Link clinical and genetic data
115
+ linked_data = geo_link_clinical_genetic_data(clinical_df, gene_data)
116
+
117
+ # 3. Handle missing values systematically
118
+ linked_data = handle_missing_values(linked_data, trait)
119
+
120
+ # 4. Check for biased features and remove them if needed
121
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
122
+
123
+ # 5. Validate data quality and save metadata
124
+ # Note: Dataset contains gene expression data from AML cell lines. The trait "Acute_Myeloid_Leukemia" is defined
125
+ # based on cell subtypes (AMKL vs non-AMKL).
126
+ is_usable = validate_and_save_cohort_info(
127
+ is_final=True,
128
+ cohort=cohort,
129
+ info_path=json_path,
130
+ is_gene_available=True,
131
+ is_trait_available=True,
132
+ is_biased=is_biased,
133
+ df=linked_data,
134
+ note="Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."
135
+ )
136
+
137
+ # 6. Save linked data if usable
138
+ if is_usable:
139
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE161532.py ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE161532"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE161532"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE161532.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE161532.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE161532.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes - uses Affymetrix Human Transcriptome Array 2.0 for gene expression profiling
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability
41
+ # trait - disease state from feature 4 contains AML status
42
+ trait_row = 4
43
+ # age - age data available in feature 1
44
+ age_row = 1
45
+ # gender - gender data available in feature 2
46
+ gender_row = 2
47
+
48
+ # 2.2 Data Type Conversion Functions
49
+ def convert_trait(x):
50
+ if not isinstance(x, str):
51
+ return None
52
+ # All samples have AML, but we can distinguish primary vs secondary
53
+ if "de novo" in x.lower():
54
+ return 0 # Primary AML
55
+ elif any(t in x.lower() for t in ["secondary", "t-aml"]):
56
+ return 1 # Secondary AML
57
+ elif "aml" in x.lower():
58
+ return None # AML but type unknown
59
+ return None
60
+
61
+ def convert_age(x):
62
+ if not isinstance(x, str):
63
+ return None
64
+ try:
65
+ age = float(x.split(":")[1].strip())
66
+ return age
67
+ except:
68
+ return None
69
+
70
+ def convert_gender(x):
71
+ if not isinstance(x, str):
72
+ return None
73
+ x = x.lower()
74
+ if "female" in x:
75
+ return 0
76
+ elif "male" in x:
77
+ return 1
78
+ return None
79
+
80
+ # 3. Save initial metadata
81
+ validate_and_save_cohort_info(is_final=False,
82
+ cohort=cohort,
83
+ info_path=json_path,
84
+ is_gene_available=is_gene_available,
85
+ is_trait_available=trait_row is not None)
86
+
87
+ # 4. Extract clinical features since trait_row is available
88
+ clinical_df = geo_select_clinical_features(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 the clinical data
98
+ print("Preview of clinical data:")
99
+ print(preview_df(clinical_df))
100
+
101
+ # Save clinical data
102
+ clinical_df.to_csv(out_clinical_data_file)
103
+ # Extract gene expression data from matrix file
104
+ gene_data = get_genetic_data(matrix_file)
105
+
106
+ # Print first 20 row IDs
107
+ print("First 20 gene/probe identifiers:")
108
+ print(gene_data.index[:20])
109
+ # These identifiers appear to be microarray probe IDs from Agilent platform ending in "_st"
110
+ # They are not standard human gene symbols and will need to be mapped
111
+ requires_gene_mapping = True
112
+ # Extract gene annotation from SOFT file
113
+ gene_annotation = get_gene_annotation(soft_file)
114
+
115
+ # Preview gene annotation data
116
+ print("Gene annotation columns and example values:")
117
+ print(preview_df(gene_annotation))
118
+ # Looking at the gene expression data from step 3, the IDs end with "_st"
119
+ # Looking at the annotation data, the gene_assignment column contains gene names/symbols
120
+ # However, we need to extract the symbols from the complex assignments
121
+
122
+ # Extract probe IDs and gene assignments, and get mapping dataframe
123
+ mapping_data = get_gene_mapping(gene_annotation, 'ID', 'gene_assignment')
124
+
125
+ # Apply mapping to get gene-level expression data
126
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
127
+ # 1. Normalize gene symbols and save normalized gene data
128
+ gene_data = normalize_gene_symbols_in_index(gene_data)
129
+ gene_data.to_csv(out_gene_data_file)
130
+
131
+ # 2. Link clinical and genetic data
132
+ linked_data = geo_link_clinical_genetic_data(clinical_df, gene_data)
133
+
134
+ # 3. Handle missing values systematically
135
+ linked_data = handle_missing_values(linked_data, trait)
136
+
137
+ # 4. Check for biased features and remove them if needed
138
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
139
+
140
+ # 5. Validate data quality and save metadata
141
+ # Note: Dataset contains gene expression data from AML cell lines. The trait "Acute_Myeloid_Leukemia" is defined
142
+ # based on cell subtypes (AMKL vs non-AMKL).
143
+ is_usable = validate_and_save_cohort_info(
144
+ is_final=True,
145
+ cohort=cohort,
146
+ info_path=json_path,
147
+ is_gene_available=True,
148
+ is_trait_available=True,
149
+ is_biased=is_biased,
150
+ df=linked_data,
151
+ note="Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."
152
+ )
153
+
154
+ # 6. Save linked data if usable
155
+ if is_usable:
156
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE222124.py ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE222124"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE222124"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE222124.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE222124.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE222124.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene expression data availability
37
+ is_gene_available = True # This is expression data from cell lines, not miRNA/methylation
38
+
39
+ # 2.1 Data availability
40
+ # Row 0 shows leukemia cell lines, can be used for trait
41
+ trait_row = 0
42
+
43
+ # Age and gender not provided for cell lines
44
+ age_row = None
45
+ gender_row = None
46
+
47
+ # 2.2 Data type conversion functions
48
+ def convert_trait(value):
49
+ if not value or ':' not in value:
50
+ return None
51
+ cell_type = value.split(': ')[1].lower()
52
+ if 'monocytic leukemia' in cell_type:
53
+ return 1 # Acute monocytic leukemia
54
+ elif 't cell leukemia' in cell_type:
55
+ return 0 # Other leukemia types
56
+ elif 'natural killer cell leukemia' in cell_type:
57
+ return 0
58
+ return None
59
+
60
+ def convert_age(value):
61
+ pass # Not used since age_row is None
62
+
63
+ def convert_gender(value):
64
+ pass # Not used since gender_row is None
65
+
66
+ # 3. Save metadata
67
+ validate_and_save_cohort_info(is_final=False,
68
+ cohort=cohort,
69
+ info_path=json_path,
70
+ is_gene_available=is_gene_available,
71
+ is_trait_available=trait_row is not None)
72
+
73
+ # 4. Clinical feature extraction
74
+ if trait_row is not None:
75
+ clinical_features = geo_select_clinical_features(
76
+ clinical_df=clinical_data,
77
+ trait=trait,
78
+ trait_row=trait_row,
79
+ convert_trait=convert_trait,
80
+ age_row=age_row,
81
+ convert_age=convert_age,
82
+ gender_row=gender_row,
83
+ convert_gender=convert_gender
84
+ )
85
+
86
+ print("Preview of extracted clinical features:")
87
+ print(preview_df(clinical_features))
88
+
89
+ clinical_features.to_csv(out_clinical_data_file)
90
+ # Extract gene expression data from matrix file
91
+ gene_data = get_genetic_data(matrix_file)
92
+
93
+ # Print first 20 row IDs
94
+ print("First 20 gene/probe identifiers:")
95
+ print(gene_data.index[:20])
96
+ requires_gene_mapping = True
97
+ # Extract gene annotation from SOFT file
98
+ gene_annotation = get_gene_annotation(soft_file)
99
+
100
+ # Preview gene annotation data
101
+ print("Gene annotation columns and example values:")
102
+ print(preview_df(gene_annotation))
103
+ # Extract probe-to-gene mapping from annotation
104
+ gene_mapping = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
105
+
106
+ # Apply mapping to convert probe-level data to gene-level data
107
+ gene_data = apply_gene_mapping(gene_data, gene_mapping)
108
+ # 1. Normalize gene symbols and save normalized gene data
109
+ gene_data = normalize_gene_symbols_in_index(gene_data)
110
+ gene_data.to_csv(out_gene_data_file)
111
+
112
+ # 2. Link clinical and genetic data
113
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
114
+
115
+ # 3. Handle missing values systematically
116
+ linked_data = handle_missing_values(linked_data, trait)
117
+
118
+ # 4. Check for biased features and remove them if needed
119
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
120
+
121
+ # 5. Validate data quality and save metadata
122
+ # Note: Dataset contains gene expression data from AML cell lines. The trait "Acute_Myeloid_Leukemia" is defined
123
+ # based on cell subtypes (AMKL vs non-AMKL).
124
+ is_usable = validate_and_save_cohort_info(
125
+ is_final=True,
126
+ cohort=cohort,
127
+ info_path=json_path,
128
+ is_gene_available=True,
129
+ is_trait_available=True,
130
+ is_biased=is_biased,
131
+ df=linked_data,
132
+ note="Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."
133
+ )
134
+
135
+ # 6. Save linked data if usable
136
+ if is_usable:
137
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE222169.py ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE222169"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE222169"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE222169.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE222169.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE222169.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ is_gene_available = True # Given information about leukemia cell lines suggests this is likely gene expression data
38
+
39
+ # 2. Variable Availability and Data Type Conversion
40
+ # 2.1 Row identification
41
+ trait_row = 0 # Contains AML information in 'cell line' and 'tissue source' fields
42
+ age_row = None # Age information not available
43
+ gender_row = None # Gender information not available
44
+
45
+ # 2.2 Conversion Functions
46
+ def convert_trait(value: str) -> int:
47
+ """Convert trait values to binary: 1 for AML cases"""
48
+ if pd.isna(value):
49
+ return None
50
+ value = value.split(': ')[-1].lower()
51
+ # Both cell lines and patient samples are AML cases
52
+ if 'aml' in value or 'molm-14' in value or 'oci-aml2' in value:
53
+ return 1
54
+ return None
55
+
56
+ def convert_age(value: str) -> float:
57
+ """Placeholder function - age data not available"""
58
+ return None
59
+
60
+ def convert_gender(value: str) -> int:
61
+ """Placeholder function - gender data not available"""
62
+ return None
63
+
64
+ # 3. Save metadata
65
+ _ = 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=(trait_row is not None)
71
+ )
72
+
73
+ # 4. Clinical Feature Extraction
74
+ if trait_row is not None:
75
+ selected_clinical = geo_select_clinical_features(
76
+ clinical_df=clinical_data,
77
+ trait=trait,
78
+ trait_row=trait_row,
79
+ convert_trait=convert_trait,
80
+ age_row=age_row,
81
+ convert_age=convert_age,
82
+ gender_row=gender_row,
83
+ convert_gender=convert_gender
84
+ )
85
+
86
+ # Preview the processed clinical data
87
+ print("Preview of processed clinical data:")
88
+ print(preview_df(selected_clinical))
89
+
90
+ # Save to CSV
91
+ selected_clinical.to_csv(out_clinical_data_file)
92
+ # Extract gene expression data from matrix file
93
+ gene_data = get_genetic_data(matrix_file)
94
+
95
+ # Print first 20 row IDs
96
+ print("First 20 gene/probe identifiers:")
97
+ print(gene_data.index[:20])
98
+ # The identifiers appear to be transcript cluster IDs from Affymetrix Clariom D arrays
99
+ # They need to be mapped to human gene symbols
100
+ requires_gene_mapping = True
101
+ # Extract gene annotation from SOFT file
102
+ gene_annotation = get_gene_annotation(soft_file)
103
+
104
+ # Preview gene annotation data
105
+ print("Gene annotation columns and example values:")
106
+ print(preview_df(gene_annotation))
107
+ # Looking at the example values in SPOT_ID.1, we can find gene symbols within parentheses
108
+ # followed by ']', like '(OR4F5)', '(SAMD11)', etc.
109
+ # Create a custom function to extract gene symbols from complex text descriptions
110
+ def extract_gene_symbols_from_desc(text):
111
+ """Extract gene symbols from complex annotation text that follows format:
112
+ ... (SYMBOL) [gene_biotype ...
113
+ """
114
+ if pd.isna(text):
115
+ return []
116
+ # Split on '//' to get separate entries and look for gene symbol pattern
117
+ # Gene symbols typically appear in parentheses before [gene_biotype
118
+ symbols = []
119
+ entries = text.split('//')
120
+ for entry in entries:
121
+ # Look for text in parentheses followed by [gene_biotype
122
+ match = re.search(r'\(([^)]+)\)\s*\[gene_biotype', entry)
123
+ if match:
124
+ symbol = match.group(1)
125
+ # Some entries have additional text like "(Drosophila)" - remove that
126
+ symbol = re.sub(r'\s*\([^)]+\)$', '', symbol)
127
+ symbols.append(symbol)
128
+ return list(set(symbols)) # Remove duplicates
129
+
130
+ # Add a column with extracted gene symbols
131
+ gene_annotation['Gene'] = gene_annotation['SPOT_ID.1'].apply(extract_gene_symbols_from_desc)
132
+
133
+ # Get mapping between IDs and gene symbols
134
+ mapping_data = get_gene_mapping(gene_annotation, 'ID', 'Gene')
135
+
136
+ # Apply gene mapping to convert probe-level data to gene-level expression data
137
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
138
+ # 1. Normalize gene symbols and save normalized gene data
139
+ gene_data = normalize_gene_symbols_in_index(gene_data)
140
+ gene_data.to_csv(out_gene_data_file)
141
+
142
+ # Get clinical data from previous step
143
+ selected_clinical = geo_select_clinical_features(
144
+ clinical_df=clinical_data,
145
+ trait=trait,
146
+ trait_row=0, # Using first row containing cell line info
147
+ convert_trait=convert_trait, # Using previously defined convert_trait function
148
+ age_row=None,
149
+ convert_age=None,
150
+ gender_row=None,
151
+ convert_gender=None
152
+ )
153
+
154
+ # 2. Link clinical and genetic data
155
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
156
+
157
+ # 3. Handle missing values systematically
158
+ linked_data = handle_missing_values(linked_data, trait)
159
+
160
+ # 4. Check for biased features and remove them if needed
161
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
162
+
163
+ # 5. Validate data quality 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=is_biased,
171
+ df=linked_data,
172
+ note="Gene expression data comparing different AML cell lines and treatments."
173
+ )
174
+
175
+ # 6. Save linked data if usable
176
+ if is_usable:
177
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE222616.py ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE222616"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE222616"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE222616.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE222616.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE222616.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes - it uses HuGene 1.0 ST Affymetrix arrays for gene expression profiling
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability
41
+ # trait (AML status) is constant since all samples are from HL-60 AML cell line
42
+ trait_row = None
43
+
44
+ # Age is not available for cell line data
45
+ age_row = None
46
+
47
+ # Gender is not available for cell line data
48
+ gender_row = None
49
+
50
+ # 2.2 Data Type Conversion Functions
51
+ def convert_trait(value):
52
+ # Not needed since trait data is not available
53
+ return None
54
+
55
+ def convert_age(value):
56
+ # Not needed since age data is not available
57
+ return None
58
+
59
+ def convert_gender(value):
60
+ # Not needed since gender data is not available
61
+ return None
62
+
63
+ # 3. Save metadata
64
+ validate_and_save_cohort_info(
65
+ is_final=False,
66
+ cohort=cohort,
67
+ info_path=json_path,
68
+ is_gene_available=is_gene_available,
69
+ is_trait_available=(trait_row is not None)
70
+ )
71
+
72
+ # 4. Clinical Feature Extraction
73
+ # Skip since trait_row is None (no clinical data available)
74
+ # Extract gene expression data from matrix file
75
+ gene_data = get_genetic_data(matrix_file)
76
+
77
+ # Print first 20 row IDs
78
+ print("First 20 gene/probe identifiers:")
79
+ print(gene_data.index[:20])
80
+ # Based on biomedical review: The identifiers appear to be numerical probe IDs from an array platform
81
+ # rather than standardized human gene symbols. These would need to be mapped to gene symbols.
82
+ requires_gene_mapping = True
83
+ # Extract gene annotation from SOFT file
84
+ gene_annotation = get_gene_annotation(soft_file)
85
+
86
+ # Preview gene annotation data
87
+ print("Gene annotation columns and example values:")
88
+ print(preview_df(gene_annotation))
89
+ # Extract gene mapping information
90
+ probe_col = "ID"
91
+ gene_col = "gene_assignment"
92
+ mapping_data = gene_annotation[[probe_col, gene_col]]
93
+ mapping_data = mapping_data.dropna()
94
+ mapping_data = mapping_data.rename(columns={probe_col: 'ID', gene_col: 'Gene'})
95
+ mapping_data['Gene'] = mapping_data['Gene'].apply(extract_human_gene_symbols)
96
+
97
+ # Convert probe-level data to gene-level expression data
98
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
99
+
100
+ # Normalize gene symbols to handle synonyms
101
+ gene_data = normalize_gene_symbols_in_index(gene_data)
102
+ # 1. Save normalized gene data
103
+ gene_data.to_csv(out_gene_data_file)
104
+
105
+ # Since no clinical data is available, use gene data as final dataset
106
+ # Set is_biased=False since we cannot assess bias without trait data
107
+ is_usable = validate_and_save_cohort_info(
108
+ is_final=True,
109
+ cohort=cohort,
110
+ info_path=json_path,
111
+ is_gene_available=True,
112
+ is_trait_available=False,
113
+ is_biased=False, # Cannot be biased without trait data
114
+ df=gene_data,
115
+ note="Only gene expression data available, no clinical information found"
116
+ )
117
+
118
+ # Save gene data as final data since no clinical data to link
119
+ if is_usable:
120
+ gene_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE235070.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE235070"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE235070"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE235070.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE235070.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE235070.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Based on the background info, this appears to be a SuperSeries about AML patients
38
+ # Cannot determine if it contains gene expression data based on limited info
39
+ is_gene_available = False
40
+
41
+ # 2.1 Data Availability
42
+ # From sample characteristics:
43
+ # Row 0 contains disease state info which indicates AML trait
44
+ trait_row = 0
45
+
46
+ # Age and gender info not available
47
+ age_row = None
48
+ gender_row = None
49
+
50
+ # 2.2. Data Type Conversion Functions
51
+ def convert_trait(x):
52
+ # Extract value after colon and convert to binary
53
+ # 'patient with AML' indicates positive case (1)
54
+ if pd.isna(x):
55
+ return None
56
+ value = x.split(': ')[-1].strip().lower()
57
+ if 'aml' in value:
58
+ return 1
59
+ return None
60
+
61
+ convert_age = None
62
+ convert_gender = None
63
+
64
+ # 3. Save metadata
65
+ is_trait_available = trait_row is not None
66
+ validate_and_save_cohort_info(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
+ # 4. Clinical Feature Extraction
73
+ # Since trait_row is not None, we extract clinical features
74
+ clinical_df = geo_select_clinical_features(clinical_data,
75
+ trait=trait,
76
+ trait_row=trait_row,
77
+ convert_trait=convert_trait,
78
+ age_row=age_row,
79
+ convert_age=convert_age,
80
+ gender_row=gender_row,
81
+ convert_gender=convert_gender)
82
+
83
+ # Preview and save clinical data
84
+ print(preview_df(clinical_df))
85
+ clinical_df.to_csv(out_clinical_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE249638.py ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE249638"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE249638"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE249638.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE249638.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE249638.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes - this is a transcriptomic profiling study of CD4+ T cells
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability & 2.2 Data Type Conversion
41
+ # Trait (AML status) is available in Feature 1, using binary type
42
+ trait_row = 1
43
+ def convert_trait(x):
44
+ if not x or ':' not in x:
45
+ return None
46
+ value = x.split(':')[1].strip().lower()
47
+ if 'acute myeloid leukemia' in value:
48
+ return 1
49
+ elif 'healthy control' in value:
50
+ return 0
51
+ return None
52
+
53
+ # Age not available
54
+ age_row = None
55
+ convert_age = None
56
+
57
+ # Gender not available
58
+ gender_row = None
59
+ convert_gender = None
60
+
61
+ # 3. Save Metadata
62
+ is_trait_available = trait_row is not None
63
+ validate_and_save_cohort_info(is_final=False,
64
+ cohort=cohort,
65
+ info_path=json_path,
66
+ is_gene_available=is_gene_available,
67
+ is_trait_available=is_trait_available)
68
+
69
+ # 4. Clinical Feature Extraction
70
+ if trait_row is not None:
71
+ clinical_features = geo_select_clinical_features(
72
+ clinical_df=clinical_data,
73
+ trait=trait,
74
+ trait_row=trait_row,
75
+ convert_trait=convert_trait,
76
+ age_row=age_row,
77
+ convert_age=convert_age,
78
+ gender_row=gender_row,
79
+ convert_gender=convert_gender
80
+ )
81
+
82
+ # Preview the extracted features
83
+ print("Preview of clinical features:")
84
+ print(preview_df(clinical_features))
85
+
86
+ # Save to CSV
87
+ clinical_features.to_csv(out_clinical_data_file)
88
+ # Extract gene expression data from matrix file
89
+ gene_data = get_genetic_data(matrix_file)
90
+
91
+ # Print first 20 row IDs
92
+ print("First 20 gene/probe identifiers:")
93
+ print(gene_data.index[:20])
94
+ # The identifiers like '2824546_st' are probe IDs from Affymetrix microarray platform, not human gene symbols
95
+ requires_gene_mapping = True
96
+ # Extract gene annotation from SOFT file
97
+ gene_annotation = get_gene_annotation(soft_file)
98
+
99
+ # Preview gene annotation data
100
+ print("Gene annotation columns and example values:")
101
+ print(preview_df(gene_annotation))
102
+ # 2. Get mapping between probe IDs and gene symbols
103
+ gene_annotation = gene_annotation.drop('ID', axis=1) # Drop the original ID column
104
+ gene_annotation = gene_annotation.rename(columns={'probeset_id': 'ID'})
105
+ mapping = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='gene_assignment')
106
+
107
+ # 3. Apply the mapping to convert probe-level measurements to gene expression data
108
+ gene_data = apply_gene_mapping(gene_data, mapping)
109
+
110
+ # Preview first few genes and their expression values
111
+ print("\nPreview of mapped gene expression data:")
112
+ print(preview_df(gene_data))
113
+ # 1. Normalize gene symbols and save normalized gene data
114
+ gene_data = normalize_gene_symbols_in_index(gene_data)
115
+ gene_data.to_csv(out_gene_data_file)
116
+
117
+ # 2. Link clinical and genetic data
118
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
119
+
120
+ # 3. Handle missing values systematically
121
+ linked_data = handle_missing_values(linked_data, trait)
122
+
123
+ # 4. Check for biased features and remove them if needed
124
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
125
+
126
+ # 5. Validate data quality and save metadata
127
+ # Note: Dataset contains gene expression data from AML cell lines. The trait "Acute_Myeloid_Leukemia" is defined
128
+ # based on cell subtypes (AMKL vs non-AMKL).
129
+ is_usable = validate_and_save_cohort_info(
130
+ is_final=True,
131
+ cohort=cohort,
132
+ info_path=json_path,
133
+ is_gene_available=True,
134
+ is_trait_available=True,
135
+ is_biased=is_biased,
136
+ df=linked_data,
137
+ note="Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."
138
+ )
139
+
140
+ # 6. Save linked data if usable
141
+ if is_usable:
142
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE98578.py ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE98578"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE98578"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE98578.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE98578.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE98578.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ is_gene_available = True # microarray gene expression data mentioned in summary
38
+
39
+ # 2.1 Data Availability
40
+ trait_row = 2 # cell subtype indicates AML type
41
+ age_row = None # no age data
42
+ gender_row = None # no gender data
43
+
44
+ # 2.2 Data Type Conversion Functions
45
+ def convert_trait(x):
46
+ if not isinstance(x, str):
47
+ return None
48
+ value = x.split(': ')[-1].strip()
49
+ # Convert to binary: AMKL=1, non-AMKL=0
50
+ if value == 'AMKL':
51
+ return 1
52
+ elif value == 'non-AMKL':
53
+ return 0
54
+ return None
55
+
56
+ # Age and gender conversion functions not needed since data unavailable
57
+ convert_age = None
58
+ convert_gender = None
59
+
60
+ # 3. Save metadata about data availability
61
+ is_initial = validate_and_save_cohort_info(
62
+ is_final=False,
63
+ cohort=cohort,
64
+ info_path=json_path,
65
+ is_gene_available=is_gene_available,
66
+ is_trait_available=trait_row is not None
67
+ )
68
+
69
+ # 4. Extract clinical features
70
+ if trait_row is not None:
71
+ clinical_features = geo_select_clinical_features(
72
+ clinical_df=clinical_data,
73
+ trait=trait,
74
+ trait_row=trait_row,
75
+ convert_trait=convert_trait,
76
+ age_row=age_row,
77
+ convert_age=convert_age,
78
+ gender_row=gender_row,
79
+ convert_gender=convert_gender
80
+ )
81
+
82
+ # Preview the extracted features
83
+ preview = preview_df(clinical_features)
84
+ print("Preview of clinical features:")
85
+ print(preview)
86
+
87
+ # Save to CSV
88
+ clinical_features.to_csv(out_clinical_data_file)
89
+ # Extract gene expression data from matrix file
90
+ gene_data = get_genetic_data(matrix_file)
91
+
92
+ # Print first 20 row IDs
93
+ print("First 20 gene/probe identifiers:")
94
+ print(gene_data.index[:20])
95
+ # These identifiers are from Affymetrix HG-U133 Plus 2.0 array probe IDs
96
+ # They need to be mapped to human gene symbols for analysis
97
+ requires_gene_mapping = True
98
+ # Extract gene annotation from SOFT file
99
+ gene_annotation = get_gene_annotation(soft_file)
100
+
101
+ # Preview gene annotation data
102
+ print("Gene annotation columns and example values:")
103
+ print(preview_df(gene_annotation))
104
+ # Get gene mapping from annotation data
105
+ # 'ID' column matches probe IDs in gene expression data
106
+ # 'Gene Symbol' column contains the target gene symbols
107
+ mapping_data = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
108
+
109
+ # Apply gene mapping to convert probe data to gene expression data
110
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
111
+
112
+ # Preview first few genes and samples
113
+ print("Preview of gene expression data after mapping:")
114
+ print(preview_df(gene_data))
115
+ # 1. Normalize gene symbols and save normalized gene data
116
+ gene_data = normalize_gene_symbols_in_index(gene_data)
117
+ gene_data.to_csv(out_gene_data_file)
118
+
119
+ # 2. Link clinical and genetic data
120
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
121
+
122
+ # 3. Handle missing values systematically
123
+ linked_data = handle_missing_values(linked_data, trait)
124
+
125
+ # 4. Check for biased features and remove them if needed
126
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
127
+
128
+ # 5. Validate data quality and save metadata
129
+ # Note: Dataset contains gene expression data from AML cell lines. The trait "Acute_Myeloid_Leukemia" is defined
130
+ # based on cell subtypes (AMKL vs non-AMKL).
131
+ is_usable = validate_and_save_cohort_info(
132
+ is_final=True,
133
+ cohort=cohort,
134
+ info_path=json_path,
135
+ is_gene_available=True,
136
+ is_trait_available=True,
137
+ is_biased=is_biased,
138
+ df=linked_data,
139
+ note="Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."
140
+ )
141
+
142
+ # 6. Save linked data if usable
143
+ if is_usable:
144
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/code/GSE99612.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+ cohort = "GSE99612"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Acute_Myeloid_Leukemia"
10
+ in_cohort_dir = "../DATA/GEO/Acute_Myeloid_Leukemia/GSE99612"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/GSE99612.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/GSE99612.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/GSE99612.csv"
16
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data - Not a miRNA or methylation study
37
+ is_gene_available = True
38
+
39
+ # 2. Variable Availability and Data Type Conversion
40
+ # This is cell line data, not human subject data
41
+ trait_row = None
42
+
43
+ def convert_trait(x):
44
+ return None
45
+
46
+ age_row = None
47
+ def convert_age(x):
48
+ return None
49
+
50
+ gender_row = None
51
+ def convert_gender(x):
52
+ return None
53
+
54
+ # 3. Save metadata
55
+ validate_and_save_cohort_info(
56
+ is_final=False,
57
+ cohort=cohort,
58
+ info_path=json_path,
59
+ is_gene_available=is_gene_available,
60
+ is_trait_available=(trait_row is not None)
61
+ )
62
+
63
+ # 4. Skip clinical feature extraction since trait_row is None
64
+ # Extract gene expression data from matrix file
65
+ gene_data = get_genetic_data(matrix_file)
66
+
67
+ # Print first 20 row IDs
68
+ print("First 20 gene/probe identifiers:")
69
+ print(gene_data.index[:20])
70
+ requires_gene_mapping = True
71
+ # Extract gene annotation from SOFT file
72
+ gene_annotation = get_gene_annotation(soft_file)
73
+
74
+ # Preview gene annotation data
75
+ print("Gene annotation columns and example values:")
76
+ print(preview_df(gene_annotation))
77
+ # 1. Identify relevant columns for gene mapping
78
+ # 'ID' in gene annotation matches identifiers in gene expression data
79
+ # 'gene_assignment' contains gene symbol information
80
+
81
+ # 2. Extract gene mapping dataframe
82
+ gene_mapping = get_gene_mapping(gene_annotation, 'ID', 'gene_assignment')
83
+
84
+ # 3. Apply gene mapping to convert probe data to gene expression data
85
+ gene_data = apply_gene_mapping(gene_data, gene_mapping)
86
+ # 1. Normalize gene symbols and save gene data
87
+ gene_data = normalize_gene_symbols_in_index(gene_data)
88
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
89
+ gene_data.to_csv(out_gene_data_file)
90
+
91
+ # 2. Create minimal linked data structure
92
+ linked_data = pd.DataFrame(index=gene_data.columns)
93
+
94
+ # 3-4. Skip missing value handling since data is not usable
95
+ # Mark as biased since we have no trait data
96
+ is_biased = True
97
+
98
+ # 5. Final validation and save metadata
99
+ validate_and_save_cohort_info(
100
+ is_final=True,
101
+ cohort=cohort,
102
+ info_path=json_path,
103
+ is_gene_available=True,
104
+ is_trait_available=False,
105
+ is_biased=is_biased,
106
+ df=linked_data,
107
+ note="This is a cell line experiment, not a human subject study. Contains no trait data."
108
+ )
109
+
110
+ # 6. Skip saving linked data since it's not usable
p3/preprocess/Acute_Myeloid_Leukemia/code/TCGA.py ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Acute_Myeloid_Leukemia"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/3/Acute_Myeloid_Leukemia/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/3/Acute_Myeloid_Leukemia/cohort_info.json"
15
+
16
+ # 1. Select the relevant subdirectory for acute myeloid leukemia
17
+ subdirectory = 'TCGA_Acute_Myeloid_Leukemia_(LAML)'
18
+ cohort_dir = os.path.join(tcga_root_dir, subdirectory)
19
+
20
+ # 2. Get the file paths
21
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
22
+
23
+ # 3. Load the data files
24
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
25
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
26
+
27
+ # 4. Print clinical data columns
28
+ print("Clinical data columns:")
29
+ print(clinical_df.columns.tolist())
30
+ # Identify candidate columns
31
+ candidate_age_cols = ['age_at_initial_pathologic_diagnosis', 'days_to_birth']
32
+ candidate_gender_cols = ['gender']
33
+
34
+ # Use TCGA project code LAML instead of full trait name
35
+ cohort_dir = os.path.join(tcga_root_dir, "LAML")
36
+ if not os.path.exists(cohort_dir):
37
+ print(f"Error: Directory not found: {cohort_dir}")
38
+ print("Please verify the data directory structure and path configuration.")
39
+ else:
40
+ clinical_file_path, _ = tcga_get_relevant_filepaths(cohort_dir)
41
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0)
42
+
43
+ # Preview age columns
44
+ age_preview = {}
45
+ for col in candidate_age_cols:
46
+ age_preview[col] = clinical_df[col].head(5).tolist()
47
+ print("Age columns preview:", age_preview)
48
+
49
+ # Preview gender columns
50
+ gender_preview = {}
51
+ for col in candidate_gender_cols:
52
+ gender_preview[col] = clinical_df[col].head(5).tolist()
53
+ print("\nGender columns preview:", gender_preview)
54
+ # Build the cohort directory path
55
+ cohort_dir = os.path.join(tcga_root_dir, "LAML")
56
+
57
+ # Get the clinical file path
58
+ clinical_file_path, _ = tcga_get_relevant_filepaths(cohort_dir)
59
+
60
+ # Read clinical data
61
+ clinical_df = pd.read_csv(clinical_file_path, sep='\t', index_col=0)
62
+
63
+ # Default to None
64
+ age_col = None
65
+ gender_col = None
66
+
67
+ # Search for age column - look for common patterns
68
+ age_candidates = [col for col in clinical_df.columns if 'age' in col.lower()]
69
+ if age_candidates:
70
+ # Preview first few values of each candidate
71
+ for col in age_candidates:
72
+ preview = clinical_df[col].head()
73
+ # Check if column has numeric age values after conversion
74
+ converted = preview.apply(tcga_convert_age)
75
+ if not converted.isna().all():
76
+ age_col = col
77
+ break
78
+
79
+ # Search for gender column - look for common patterns
80
+ gender_candidates = [col for col in clinical_df.columns if 'gender' in col.lower() or 'sex' in col.lower()]
81
+ if gender_candidates:
82
+ # Preview first few values of each candidate
83
+ for col in gender_candidates:
84
+ preview = clinical_df[col].head()
85
+ # Check if column has valid gender values after conversion
86
+ converted = preview.apply(tcga_convert_gender)
87
+ if not converted.isna().all():
88
+ gender_col = col
89
+ break
90
+
91
+ # Print chosen columns
92
+ print(f"Selected age column: {age_col}")
93
+ print(f"Selected gender column: {gender_col}")
94
+ # 1. Select the relevant subdirectory for acute myeloid leukemia
95
+ subdirectory = 'TCGA_Acute_Myeloid_Leukemia_(LAML)'
96
+ cohort_dir = os.path.join(tcga_root_dir, subdirectory)
97
+
98
+ # 2. Get the file paths
99
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
100
+
101
+ # 3. Load the data files
102
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
103
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
104
+
105
+ # 4. Print clinical data columns
106
+ print("Clinical data columns:")
107
+ print(clinical_df.columns.tolist())
108
+ # 1. Extract and standardize clinical features
109
+ # First create trait labels using sample IDs, then add demographics if available
110
+ clinical_features = tcga_select_clinical_features(
111
+ clinical_df,
112
+ trait=trait,
113
+ age_col='age_at_initial_pathologic_diagnosis',
114
+ gender_col='gender'
115
+ )
116
+
117
+ # 2. Normalize gene symbols and save
118
+ normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
119
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
120
+ normalized_gene_df.to_csv(out_gene_data_file)
121
+
122
+ # 3. Link clinical and genetic data
123
+ linked_data = pd.concat([clinical_features, normalized_gene_df.T], axis=1)
124
+
125
+ # 4. Handle missing values systematically
126
+ linked_data = handle_missing_values(linked_data, trait)
127
+
128
+ # 5. Check for bias in trait and demographic features
129
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
130
+
131
+ # 6. Validate data quality and save cohort info
132
+ note = "Contains molecular data from tumor and normal samples with patient demographics."
133
+ is_usable = validate_and_save_cohort_info(
134
+ is_final=True,
135
+ cohort="TCGA",
136
+ info_path=json_path,
137
+ is_gene_available=True,
138
+ is_trait_available=True,
139
+ is_biased=trait_biased,
140
+ df=linked_data,
141
+ note=note
142
+ )
143
+
144
+ # 7. Save linked data if usable
145
+ if is_usable:
146
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
147
+ linked_data.to_csv(out_data_file)
p3/preprocess/Acute_Myeloid_Leukemia/cohort_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"GSE99612": {"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": "This is a cell line experiment, not a human subject study. Contains no trait data."}, "GSE98578": {"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": 48, "note": "Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."}, "GSE249638": {"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": 37, "note": "Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."}, "GSE235070": {"is_usable": false, "is_gene_available": false, "is_trait_available": true, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": null}, "GSE222616": {"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": "Only gene expression data available, no clinical information found"}, "GSE222169": {"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": "Gene expression data comparing different AML cell lines and treatments."}, "GSE222124": {"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": 70, "note": "Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."}, "GSE161532": {"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": 53, "note": "Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."}, "GSE121431": {"is_usable": false, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": true, "has_age": false, "has_gender": false, "sample_size": 30, "note": "Gene expression data from AML cell lines. Trait defined as AMKL vs non-AMKL subtypes."}, "GSE121291": {"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": "Dataset contains gene expression data from cell lines but lacks AML trait information needed for analysis."}, "TCGA": {"is_usable": false, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": true, "has_age": true, "has_gender": true, "sample_size": 173, "note": "Contains molecular data from tumor and normal samples with patient demographics."}}
p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE121291.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE121431.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE222169.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ Gene,GSM6916956,GSM6916957,GSM6916958,GSM6916959,GSM6916960,GSM6916961,GSM6916962,GSM6916963,GSM6916964,GSM6916965,GSM6916966,GSM6916967,GSM6916968,GSM6916969,GSM6916970,GSM6916971,GSM6916972,GSM6916973,GSM6916974,GSM6916975,GSM6916976,GSM6916977,GSM6916978,GSM6916979,GSM6916980,GSM6916981,GSM6916982,GSM6916983,GSM6916984,GSM6916985,GSM6916986,GSM6916987,GSM6916988,GSM6916989,GSM6916990,GSM6916991,GSM6916992,GSM6916993,GSM6916994,GSM6916995,GSM6916996,GSM6916997
p3/preprocess/Acute_Myeloid_Leukemia/gene_data/GSE222616.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ Gene,GSM6927801,GSM6927802,GSM6927803,GSM6927804,GSM6927805,GSM6927806,GSM6927807,GSM6927808,GSM6927809,GSM6927810,GSM6927811,GSM6927812,GSM6927813,GSM6927814,GSM6927815,GSM6927816,GSM6927817,GSM6927818,GSM6927819,GSM6927820,GSM6927821,GSM6927822,GSM6927823,GSM6927824,GSM6927825,GSM6927826,GSM6927827,GSM6927828,GSM6927829,GSM6927830,GSM6927831,GSM6927832,GSM6927833,GSM6927834,GSM6927835,GSM6927836,GSM6927837,GSM6927838,GSM6927839,GSM6927840,GSM6927841,GSM6927842
p3/preprocess/Adrenocortical_Cancer/GSE75415.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE108088.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM2889381,GSM2889382,GSM2889383,GSM2889384,GSM2889385,GSM2889386,GSM2889387,GSM2889388,GSM2889389,GSM2889390,GSM2889391,GSM2889392,GSM2889393,GSM2889394,GSM2889395,GSM2889396,GSM2889397,GSM2889398,GSM2889399,GSM2889400,GSM2889401,GSM2889402,GSM2889403,GSM2889404,GSM2889405,GSM2889406,GSM2889407,GSM2889408,GSM2889409,GSM2889410,GSM2889411,GSM2889412,GSM2889413,GSM2889414,GSM2889415,GSM2889416,GSM2889417,GSM2889418,GSM2889419,GSM2889420,GSM2889421,GSM2889422,GSM2889423
2
+ Adrenocortical_Cancer,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE143383.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ,GSM4258059,GSM4258060,GSM4258061,GSM4258062,GSM4258063,GSM4258064,GSM4258065,GSM4258066,GSM4258067,GSM4258068,GSM4258069,GSM4258070,GSM4258071,GSM4258072,GSM4258073,GSM4258074,GSM4258075,GSM4258076,GSM4258077,GSM4258078,GSM4258079,GSM4258080,GSM4258081,GSM4258082,GSM4258083,GSM4258084,GSM4258085,GSM4258086,GSM4258087,GSM4258088,GSM4258089,GSM4258090,GSM4258091,GSM4258092,GSM4258093,GSM4258094,GSM4258095,GSM4258096,GSM4258097,GSM4258098,GSM4258099,GSM4258100,GSM4258101,GSM4258102,GSM4258103,GSM4258104,GSM4258105,GSM4258106,GSM4258107,GSM4258108,GSM4258109,GSM4258110,GSM4258111,GSM4258112,GSM4258113,GSM4258114,GSM4258115,GSM4258116,GSM4258117,GSM4258118,GSM4258119,GSM4258120,GSM4258121
2
+ Adrenocortical_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
3
+ Gender,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,,1.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE19776.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM493903,GSM493904,GSM493905,GSM493906,GSM493907,GSM493908,GSM493909,GSM493910,GSM493911,GSM493912,GSM493913,GSM493914,GSM493915,GSM493916,GSM493917
2
+ Adrenocortical_Cancer,0.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,,0.0,,,0.0
3
+ Age,67.8,72.1,26.7,36.9,,53.2,37.0,54.2,67.3,27.7,,58.0,42.0,46.0,38.0
4
+ Gender,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE49278.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM1196511,GSM1196512,GSM1196513,GSM1196514,GSM1196515,GSM1196516,GSM1196517,GSM1196518,GSM1196519,GSM1196520,GSM1196521,GSM1196522,GSM1196523,GSM1196524,GSM1196525,GSM1196526,GSM1196527,GSM1196528,GSM1196529,GSM1196530,GSM1196531,GSM1196532,GSM1196533,GSM1196534,GSM1196535,GSM1196536,GSM1196537,GSM1196538,GSM1196539,GSM1196540,GSM1196541,GSM1196542,GSM1196543,GSM1196544,GSM1196545,GSM1196546,GSM1196547,GSM1196548,GSM1196549,GSM1196550,GSM1196551,GSM1196552,GSM1196553,GSM1196554
2
+ Adrenocortical_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
3
+ Age,70.0,26.0,53.0,73.0,15.0,51.0,63.0,26.0,29.0,79.0,45.0,43.0,53.0,45.0,41.0,37.0,81.0,68.0,42.0,59.0,39.0,25.0,41.0,36.0,24.0,49.0,75.0,37.0,26.0,48.0,15.0,49.0,54.0,39.0,79.0,28.0,40.0,44.0,28.0,53.0,28.0,52.0,30.0,46.0
4
+ Gender,0.0,0.0,0.0,1.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,0.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,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE68606.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM1676864,GSM1676865,GSM1676866,GSM1676867,GSM1676868,GSM1676869,GSM1676870,GSM1676871,GSM1676872,GSM1676873,GSM1676874,GSM1676875,GSM1676876,GSM1676877,GSM1676878,GSM1676879,GSM1676880,GSM1676881,GSM1676882,GSM1676883,GSM1676884,GSM1676885,GSM1676886,GSM1676887,GSM1676888,GSM1676889,GSM1676890,GSM1676891,GSM1676892,GSM1676893,GSM1676894,GSM1676895,GSM1676896,GSM1676897,GSM1676898,GSM1676899,GSM1676900,GSM1676901,GSM1676902,GSM1676903,GSM1676904,GSM1676905,GSM1676906,GSM1676907,GSM1676908,GSM1676909,GSM1676910,GSM1676911,GSM1676912,GSM1676913,GSM1676914,GSM1676915,GSM1676916,GSM1676917,GSM1676918,GSM1676919,GSM1676920,GSM1676921,GSM1676922,GSM1676923,GSM1676924,GSM1676925,GSM1676926,GSM1676927,GSM1676928,GSM1676929,GSM1676930,GSM1676931,GSM1676932,GSM1676933,GSM1676934,GSM1676935,GSM1676936,GSM1676937,GSM1676938,GSM1676939,GSM1676940,GSM1676941,GSM1676942,GSM1676943,GSM1676944,GSM1676945,GSM1676946,GSM1676947,GSM1676948,GSM1676949,GSM1676950,GSM1676951,GSM1676952,GSM1676953,GSM1676954,GSM1676955,GSM1676956,GSM1676957,GSM1676958,GSM1676959,GSM1676960,GSM1676961,GSM1676962,GSM1676963,GSM1676964,GSM1676965,GSM1676966,GSM1676967,GSM1676968,GSM1676969,GSM1676970,GSM1676971,GSM1676972,GSM1676973,GSM1676974,GSM1676975,GSM1676976,GSM1676977,GSM1676978,GSM1676979,GSM1676980,GSM1676981,GSM1676982,GSM1676983,GSM1676984,GSM1676985,GSM1676986,GSM1676987,GSM1676988,GSM1676989,GSM1676990,GSM1676991,GSM1676992,GSM1676993,GSM1676994,GSM1676995,GSM1676996,GSM1676997,GSM1676998,GSM1676999,GSM1677000
2
+ Adrenocortical_Cancer,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.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,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,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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
+ Age,,,,,,,,,,,67.0,66.0,72.0,56.0,48.0,,,,,,,,,,,,,,,,,,,,,,,,48.0,,,66.0,56.0,72.0,,67.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,67.0,56.0,48.0,,,,,,,,,66.0,72.0,,,,,,,,,,67.0,56.0,,66.0,,,48.0,,72.0,,,,,,,,,,,,,,,,,,,,,
4
+ Gender,,,0.0,,,,,,,,1.0,1.0,1.0,0.0,0.0,,,,,,,,,,,,,,,,,,,,,,,,0.0,,,1.0,0.0,1.0,,1.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1.0,0.0,0.0,,,,,,,,,1.0,1.0,,,,,,,,,,1.0,0.0,,1.0,,,0.0,,1.0,,,,,,,,,,,,,,,,,,,,,
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE68950.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,3
2
+ Adrenocortical_Cancer,0.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE75415.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ,GSM1954726,GSM1954727,GSM1954728,GSM1954729,GSM1954730,GSM1954731,GSM1954732,GSM1954733,GSM1954734,GSM1954735,GSM1954736,GSM1954737,GSM1954738,GSM1954739,GSM1954740,GSM1954741,GSM1954742,GSM1954743,GSM1954744,GSM1954745,GSM1954746,GSM1954747,GSM1954748,GSM1954749,GSM1954750,GSM1954751,GSM1954752,GSM1954753,GSM1954754,GSM1954755,GSM1954756
2
+ Adrenocortical_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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
3
+ Gender,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,,,,,,,,
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE76019.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1972883,GSM1972884,GSM1972885,GSM1972886,GSM1972887,GSM1972888,GSM1972889,GSM1972890,GSM1972891,GSM1972892,GSM1972893,GSM1972894,GSM1972895,GSM1972896,GSM1972897,GSM1972898,GSM1972899,GSM1972900,GSM1972901,GSM1972902,GSM1972903,GSM1972904,GSM1972905,GSM1972906,GSM1972907,GSM1972908,GSM1972909,GSM1972910,GSM1972911,GSM1972912,GSM1972913,GSM1972914,GSM1972915,GSM1972916
2
+ Adrenocortical_Cancer,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/GSE90713.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM2411058,GSM2411059,GSM2411060,GSM2411061,GSM2411062,GSM2411063,GSM2411064,GSM2411065,GSM2411066,GSM2411067,GSM2411068,GSM2411069,GSM2411070,GSM2411071,GSM2411072,GSM2411073,GSM2411074,GSM2411075,GSM2411076,GSM2411077,GSM2411078,GSM2411079,GSM2411080,GSM2411081,GSM2411082,GSM2411083,GSM2411084,GSM2411085,GSM2411086,GSM2411087,GSM2411088,GSM2411089,GSM2411090,GSM2411091,GSM2411092,GSM2411093,GSM2411094,GSM2411095,GSM2411096,GSM2411097,GSM2411098,GSM2411099,GSM2411100,GSM2411101,GSM2411102,GSM2411103,GSM2411104,GSM2411105,GSM2411106,GSM2411107,GSM2411108,GSM2411109,GSM2411110,GSM2411111,GSM2411112,GSM2411113,GSM2411114,GSM2411115,GSM2411116,GSM2411117,GSM2411118,GSM2411119,GSM2411120
2
+ Adrenocortical_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Adrenocortical_Cancer/clinical_data/TCGA.csv ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sampleID,Adrenocortical_Cancer,Age,Gender
2
+ TCGA-OR-A5J1-01,1,58,1
3
+ TCGA-OR-A5J2-01,1,44,0
4
+ TCGA-OR-A5J3-01,1,23,0
5
+ TCGA-OR-A5J4-01,1,23,0
6
+ TCGA-OR-A5J5-01,1,30,1
7
+ TCGA-OR-A5J6-01,1,29,0
8
+ TCGA-OR-A5J7-01,1,30,0
9
+ TCGA-OR-A5J8-01,1,66,1
10
+ TCGA-OR-A5J9-01,1,22,0
11
+ TCGA-OR-A5JA-01,1,53,0
12
+ TCGA-OR-A5JB-01,1,52,1
13
+ TCGA-OR-A5JC-01,1,37,1
14
+ TCGA-OR-A5JD-01,1,57,0
15
+ TCGA-OR-A5JE-01,1,17,0
16
+ TCGA-OR-A5JF-01,1,69,0
17
+ TCGA-OR-A5JG-01,1,61,1
18
+ TCGA-OR-A5JH-01,1,32,0
19
+ TCGA-OR-A5JI-01,1,22,1
20
+ TCGA-OR-A5JJ-01,1,65,1
21
+ TCGA-OR-A5JK-01,1,49,1
22
+ TCGA-OR-A5JL-01,1,36,0
23
+ TCGA-OR-A5JM-01,1,25,0
24
+ TCGA-OR-A5JO-01,1,26,0
25
+ TCGA-OR-A5JP-01,1,40,1
26
+ TCGA-OR-A5JQ-01,1,26,0
27
+ TCGA-OR-A5JR-01,1,45,1
28
+ TCGA-OR-A5JS-01,1,65,0
29
+ TCGA-OR-A5JT-01,1,65,0
30
+ TCGA-OR-A5JU-01,1,58,0
31
+ TCGA-OR-A5JV-01,1,55,1
32
+ TCGA-OR-A5JW-01,1,47,1
33
+ TCGA-OR-A5JX-01,1,50,1
34
+ TCGA-OR-A5JY-01,1,68,0
35
+ TCGA-OR-A5JZ-01,1,60,1
36
+ TCGA-OR-A5K0-01,1,69,0
37
+ TCGA-OR-A5K1-01,1,48,1
38
+ TCGA-OR-A5K2-01,1,32,0
39
+ TCGA-OR-A5K3-01,1,53,1
40
+ TCGA-OR-A5K4-01,1,64,0
41
+ TCGA-OR-A5K5-01,1,59,0
42
+ TCGA-OR-A5K6-01,1,56,0
43
+ TCGA-OR-A5K8-01,1,39,1
44
+ TCGA-OR-A5K9-01,1,61,0
45
+ TCGA-OR-A5KB-01,1,61,0
46
+ TCGA-OR-A5KO-01,1,39,0
47
+ TCGA-OR-A5KP-01,1,45,0
48
+ TCGA-OR-A5KQ-01,1,20,0
49
+ TCGA-OR-A5KS-01,1,72,1
50
+ TCGA-OR-A5KT-01,1,44,0
51
+ TCGA-OR-A5KU-01,1,37,0
52
+ TCGA-OR-A5KV-01,1,17,0
53
+ TCGA-OR-A5KW-01,1,55,0
54
+ TCGA-OR-A5KX-01,1,25,0
55
+ TCGA-OR-A5KY-01,1,23,0
56
+ TCGA-OR-A5KZ-01,1,42,1
57
+ TCGA-OR-A5L1-01,1,37,0
58
+ TCGA-OR-A5L2-01,1,83,0
59
+ TCGA-OR-A5L3-01,1,67,0
60
+ TCGA-OR-A5L4-01,1,48,0
61
+ TCGA-OR-A5L5-01,1,77,0
62
+ TCGA-OR-A5L6-01,1,60,1
63
+ TCGA-OR-A5L8-01,1,36,0
64
+ TCGA-OR-A5L9-01,1,53,0
65
+ TCGA-OR-A5LA-01,1,52,0
66
+ TCGA-OR-A5LB-01,1,59,1
67
+ TCGA-OR-A5LC-01,1,71,0
68
+ TCGA-OR-A5LD-01,1,52,1
69
+ TCGA-OR-A5LE-01,1,14,1
70
+ TCGA-OR-A5LF-01,1,74,0
71
+ TCGA-OR-A5LG-01,1,46,1
72
+ TCGA-OR-A5LH-01,1,36,0
73
+ TCGA-OR-A5LI-01,1,42,0
74
+ TCGA-OR-A5LJ-01,1,54,0
75
+ TCGA-OR-A5LK-01,1,62,1
76
+ TCGA-OR-A5LL-01,1,75,0
77
+ TCGA-OR-A5LM-01,1,23,1
78
+ TCGA-OR-A5LN-01,1,31,0
79
+ TCGA-OR-A5LO-01,1,61,0
80
+ TCGA-OR-A5LP-01,1,37,0
81
+ TCGA-OR-A5LR-01,1,30,0
82
+ TCGA-OR-A5LS-01,1,34,0
83
+ TCGA-OR-A5LT-01,1,57,1
84
+ TCGA-OU-A5PI-01,1,53,0
85
+ TCGA-P6-A5OF-01,1,55,0
86
+ TCGA-P6-A5OG-01,1,45,0
87
+ TCGA-P6-A5OH-01,1,59,0
88
+ TCGA-PA-A5YG-01,1,51,1
89
+ TCGA-PK-A5H8-01,1,42,1
90
+ TCGA-PK-A5H9-01,1,27,0
91
+ TCGA-PK-A5HA-01,1,63,1
92
+ TCGA-PK-A5HB-01,1,63,1
93
+ TCGA-PK-A5HC-01,1,44,0
p3/preprocess/Adrenocortical_Cancer/code/GSE108088.py ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Adrenocortical_Cancer"
6
+ cohort = "GSE108088"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Adrenocortical_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Adrenocortical_Cancer/GSE108088"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Adrenocortical_Cancer/GSE108088.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Adrenocortical_Cancer/gene_data/GSE108088.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Adrenocortical_Cancer/clinical_data/GSE108088.csv"
16
+ json_path = "./output/preprocess/3/Adrenocortical_Cancer/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes, this dataset appears to be gene expression data given the series summary about molecular profiling
38
+ is_gene_available = True
39
+
40
+ # 2. Variable Data Type & Conversion
41
+
42
+ # 2.1 Data Availability
43
+ # No Adrenocortical Cancer cases found in conditions
44
+ trait_row = None
45
+ age_row = None
46
+ gender_row = None
47
+
48
+ # 2.2 Data Type Conversion Functions
49
+ def convert_trait(x):
50
+ # Binary: 0 = other cancers, 1 = our target cancer
51
+ if not isinstance(x, str):
52
+ return None
53
+ value = x.split(': ')[-1].lower()
54
+ # For Adrenocortical Cancer - no matching cases found
55
+ return 0
56
+
57
+ def convert_age(x):
58
+ # Not needed since age data unavailable
59
+ return None
60
+
61
+ def convert_gender(x):
62
+ # Not needed since gender data unavailable
63
+ return None
64
+
65
+ # 3. Save Metadata - Initial Filtering
66
+ is_trait_available = trait_row is not None
67
+ validate_and_save_cohort_info(is_final=False,
68
+ cohort=cohort,
69
+ info_path=json_path,
70
+ is_gene_available=is_gene_available,
71
+ is_trait_available=is_trait_available)
72
+
73
+ # 4. Clinical Feature Extraction
74
+ # Skip since trait_row is None (no Adrenocortical Cancer cases)
75
+ # Extract gene expression data from matrix file
76
+ gene_data = get_genetic_data(matrix_file)
77
+
78
+ # Print first 20 row IDs and shape of data to help debug
79
+ print("Shape of gene expression data:", gene_data.shape)
80
+ print("\nFirst few rows of data:")
81
+ print(gene_data.head())
82
+ print("\nFirst 20 gene/probe identifiers:")
83
+ print(gene_data.index[:20])
84
+
85
+ # Inspect a snippet of raw file to verify identifier format
86
+ import gzip
87
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
88
+ lines = []
89
+ for i, line in enumerate(f):
90
+ if "!series_matrix_table_begin" in line:
91
+ # Get the next 5 lines after the marker
92
+ for _ in range(5):
93
+ lines.append(next(f).strip())
94
+ break
95
+ print("\nFirst few lines after matrix marker in raw file:")
96
+ for line in lines:
97
+ print(line)
98
+ # Review gene identifiers
99
+ # The identifiers like "1007_s_at", "1053_at" are Affymetrix probe IDs from microarray data
100
+ # These need to be mapped to official gene symbols before analysis
101
+ requires_gene_mapping = True
102
+ # Get file paths using library function
103
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
104
+
105
+ # Extract gene annotation from SOFT file and get meaningful data
106
+ gene_annotation = get_gene_annotation(soft_file)
107
+
108
+ # Preview gene annotation data
109
+ print("Gene annotation shape:", gene_annotation.shape)
110
+ print("\nGene annotation preview:")
111
+ print(preview_df(gene_annotation))
112
+
113
+ print("\nNumber of non-null values in each column:")
114
+ print(gene_annotation.count())
115
+
116
+ # Print example rows showing the mapping information columns
117
+ print("\nSample mapping columns ('ID' and 'Gene Symbol'):")
118
+ print(gene_annotation[['ID', 'Gene Symbol']].head().to_string())
119
+
120
+ print("\nNote: Gene mapping will use:")
121
+ print("'ID' column: Probe identifiers")
122
+ print("'Gene Symbol' column: Contains gene symbol information")
123
+ # Get gene mapping from annotation data
124
+ mapping_data = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
125
+
126
+ # Apply mapping to convert probe data to gene data
127
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
128
+
129
+ # Print info about the mapped gene data
130
+ print("Gene expression data shape after mapping:", gene_data.shape)
131
+ print("\nFirst few rows of mapped gene data:")
132
+ print(gene_data.head())
133
+ print("\nFirst few gene symbols:")
134
+ print(gene_data.index[:10])
135
+ # 1. Normalize gene symbols
136
+ gene_data = normalize_gene_symbols_in_index(gene_data)
137
+
138
+ # Save normalized gene data
139
+ gene_data.to_csv(out_gene_data_file)
140
+
141
+ # 2. Link clinical and genetic data
142
+ try:
143
+ clinical_data = pd.read_csv(out_clinical_data_file, index_col=0)
144
+ linked_data = geo_link_clinical_genetic_data(clinical_data, gene_data)
145
+
146
+ # 3. Handle missing values
147
+ linked_data = handle_missing_values(linked_data, trait)
148
+
149
+ # 4. Determine if features are biased
150
+ is_trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
151
+
152
+ # 5. Validate and save cohort info
153
+ is_usable = validate_and_save_cohort_info(
154
+ is_final=True,
155
+ cohort=cohort,
156
+ info_path=json_path,
157
+ is_gene_available=True,
158
+ is_trait_available=True,
159
+ is_biased=is_trait_biased,
160
+ df=linked_data,
161
+ note="Gene expression data successfully mapped and linked with clinical features"
162
+ )
163
+
164
+ # 6. Save linked data if usable
165
+ if is_usable:
166
+ linked_data.to_csv(out_data_file)
167
+
168
+ except Exception as e:
169
+ print(f"Error in data linking and processing: {str(e)}")
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=True,
176
+ is_biased=True,
177
+ df=pd.DataFrame(),
178
+ note=f"Data processing failed: {str(e)}"
179
+ )
p3/preprocess/Adrenocortical_Cancer/code/GSE143383.py ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Adrenocortical_Cancer"
6
+ cohort = "GSE143383"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Adrenocortical_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Adrenocortical_Cancer/GSE143383"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Adrenocortical_Cancer/GSE143383.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Adrenocortical_Cancer/gene_data/GSE143383.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Adrenocortical_Cancer/clinical_data/GSE143383.csv"
16
+ json_path = "./output/preprocess/3/Adrenocortical_Cancer/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes, it uses Affymetrix PrimeView platform for gene expression profiling
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability
41
+ # For trait - all samples are adrenocortical tumor samples per study design
42
+ trait_row = 0
43
+
44
+ # For gender - present in key 0
45
+ gender_row = 0
46
+
47
+ # For age - not available
48
+ age_row = None
49
+
50
+ # 2.2 Data Type Conversion Functions
51
+ def convert_trait(x):
52
+ # All samples are tumor samples
53
+ return 1
54
+
55
+ def convert_gender(x):
56
+ if not isinstance(x, str):
57
+ return None
58
+ x = x.lower().split(': ')[1] if ': ' in x else x.lower()
59
+ if x == 'm' or x == 'male':
60
+ return 1
61
+ elif x == 'f' or x == 'female':
62
+ return 0
63
+ return None
64
+
65
+ def convert_age(x):
66
+ # Not needed as age data is not available
67
+ return None
68
+
69
+ # 3. Save Metadata
70
+ is_trait_available = (trait_row is not None)
71
+
72
+ # Initial validation and save metadata
73
+ is_usable = validate_and_save_cohort_info(
74
+ is_final=False,
75
+ cohort=cohort,
76
+ info_path=json_path,
77
+ is_gene_available=is_gene_available,
78
+ is_trait_available=is_trait_available
79
+ )
80
+
81
+ # 4. Extract Clinical Features
82
+ if trait_row is not None:
83
+ clinical_features = geo_select_clinical_features(
84
+ clinical_df=clinical_data,
85
+ trait=trait,
86
+ trait_row=trait_row,
87
+ convert_trait=convert_trait,
88
+ age_row=age_row,
89
+ convert_age=convert_age,
90
+ gender_row=gender_row,
91
+ convert_gender=convert_gender
92
+ )
93
+
94
+ # Preview the extracted features
95
+ print("Preview of clinical features:")
96
+ print(preview_df(clinical_features))
97
+
98
+ # Save clinical data
99
+ clinical_features.to_csv(out_clinical_data_file)
100
+ # Extract gene expression data from matrix file
101
+ gene_data = get_genetic_data(matrix_file)
102
+
103
+ # Print first 20 row IDs and shape of data to help debug
104
+ print("Shape of gene expression data:", gene_data.shape)
105
+ print("\nFirst few rows of data:")
106
+ print(gene_data.head())
107
+ print("\nFirst 20 gene/probe identifiers:")
108
+ print(gene_data.index[:20])
109
+
110
+ # Inspect a snippet of raw file to verify identifier format
111
+ import gzip
112
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
113
+ lines = []
114
+ for i, line in enumerate(f):
115
+ if "!series_matrix_table_begin" in line:
116
+ # Get the next 5 lines after the marker
117
+ for _ in range(5):
118
+ lines.append(next(f).strip())
119
+ break
120
+ print("\nFirst few lines after matrix marker in raw file:")
121
+ for line in lines:
122
+ print(line)
123
+ # Looking at the ID format (e.g., "11715100_at", "11715101_s_at"), these are Affymetrix probe IDs
124
+ # from a microarray platform, not standard human gene symbols.
125
+ # They need to be mapped to HGNC gene symbols for standardization across studies.
126
+ requires_gene_mapping = True
127
+ # Get file paths using library function
128
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
129
+
130
+ # Extract gene annotation from SOFT file and get meaningful data
131
+ gene_annotation = get_gene_annotation(soft_file)
132
+
133
+ # Preview gene annotation data
134
+ print("Gene annotation shape:", gene_annotation.shape)
135
+ print("\nGene annotation preview:")
136
+ print(preview_df(gene_annotation))
137
+
138
+ print("\nNumber of non-null values in each column:")
139
+ print(gene_annotation.count())
140
+
141
+ # Print example rows showing the mapping information columns
142
+ print("\nSample mapping columns ('ID' and 'Gene Symbol'):")
143
+ print(gene_annotation[['ID', 'Gene Symbol']].head().to_string())
144
+
145
+ print("\nNote: Gene mapping will use:")
146
+ print("'ID' column: Probe identifiers")
147
+ print("'Gene Symbol' column: Contains gene symbol information")
148
+ # Get mapping between probe IDs and gene symbols
149
+ mapping_data = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
150
+
151
+ # Apply gene mapping to convert probe-level data to gene-level data
152
+ gene_data = apply_gene_mapping(expression_df=gene_data, mapping_df=mapping_data)
153
+
154
+ # Save genetic data
155
+ gene_data.to_csv(out_gene_data_file)
156
+
157
+ # Print gene data shape and preview
158
+ print("\nGene expression data shape after mapping:", gene_data.shape)
159
+ print("\nPreview of gene expression data:")
160
+ print(preview_df(gene_data))
161
+ # 1. Normalize gene symbols
162
+ gene_data = normalize_gene_symbols_in_index(gene_data)
163
+
164
+ # Save normalized gene data
165
+ gene_data.to_csv(out_gene_data_file)
166
+
167
+ # 2. Link clinical and genetic data
168
+ try:
169
+ clinical_data = pd.read_csv(out_clinical_data_file, index_col=0)
170
+ linked_data = geo_link_clinical_genetic_data(clinical_data, gene_data)
171
+
172
+ # 3. Handle missing values
173
+ linked_data = handle_missing_values(linked_data, trait)
174
+
175
+ # 4. Determine if features are biased
176
+ is_trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
177
+
178
+ # 5. Validate and save cohort info
179
+ is_usable = validate_and_save_cohort_info(
180
+ is_final=True,
181
+ cohort=cohort,
182
+ info_path=json_path,
183
+ is_gene_available=True,
184
+ is_trait_available=True,
185
+ is_biased=is_trait_biased,
186
+ df=linked_data,
187
+ note="Gene expression data successfully mapped and linked with clinical features"
188
+ )
189
+
190
+ # 6. Save linked data if usable
191
+ if is_usable:
192
+ linked_data.to_csv(out_data_file)
193
+
194
+ except Exception as e:
195
+ print(f"Error in data linking and processing: {str(e)}")
196
+ is_usable = validate_and_save_cohort_info(
197
+ is_final=True,
198
+ cohort=cohort,
199
+ info_path=json_path,
200
+ is_gene_available=True,
201
+ is_trait_available=True,
202
+ is_biased=True,
203
+ df=pd.DataFrame(),
204
+ note=f"Data processing failed: {str(e)}"
205
+ )
p3/preprocess/Adrenocortical_Cancer/code/GSE19776.py ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Adrenocortical_Cancer"
6
+ cohort = "GSE19776"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Adrenocortical_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Adrenocortical_Cancer/GSE19776"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Adrenocortical_Cancer/GSE19776.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Adrenocortical_Cancer/gene_data/GSE19776.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Adrenocortical_Cancer/clinical_data/GSE19776.csv"
16
+ json_path = "./output/preprocess/3/Adrenocortical_Cancer/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Based on series title and extensive disease/tumor grade info, this appears to be a gene expression study
38
+ is_gene_available = True
39
+
40
+ # 2.1 Data Availability
41
+ # Trait (cancer stage) available in Feature 1 - extent of disease
42
+ trait_row = 1
43
+
44
+ # Age available in Feature 5
45
+ age_row = 5
46
+
47
+ # Gender available in Feature 4
48
+ gender_row = 4
49
+
50
+ # 2.2 Data Type Conversion Functions
51
+ def convert_trait(val: str) -> int:
52
+ """Convert extent of disease to binary (0=localized, 1=advanced)"""
53
+ if not val or 'Unknown' in val:
54
+ return None
55
+ val = val.split(': ')[1].strip()
56
+ if val == 'Localized':
57
+ return 0
58
+ elif val in ['Regional', 'Metastatic']:
59
+ return 1
60
+ return None
61
+
62
+ def convert_age(val: str) -> float:
63
+ """Convert age to float"""
64
+ if not val or 'Unknown' in val:
65
+ return None
66
+ try:
67
+ return float(val.split(': ')[1])
68
+ except:
69
+ return None
70
+
71
+ def convert_gender(val: str) -> int:
72
+ """Convert gender to binary (0=F, 1=M)"""
73
+ if not val:
74
+ return None
75
+ val = val.split(': ')[1].strip()
76
+ if val == 'F':
77
+ return 0
78
+ elif val == 'M':
79
+ return 1
80
+ return None
81
+
82
+ # 3. Save Metadata
83
+ validate_and_save_cohort_info(
84
+ is_final=False,
85
+ cohort=cohort,
86
+ info_path=json_path,
87
+ is_gene_available=is_gene_available,
88
+ is_trait_available=trait_row is not None
89
+ )
90
+
91
+ # 4. Extract Clinical Features
92
+ selected_clinical = geo_select_clinical_features(
93
+ clinical_df=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
+
103
+ print("Preview of selected clinical features:")
104
+ print(preview_df(selected_clinical))
105
+
106
+ # Save clinical data
107
+ selected_clinical.to_csv(out_clinical_data_file)
108
+ # Extract gene expression data from matrix file
109
+ gene_data = get_genetic_data(matrix_file)
110
+
111
+ # Print first 20 row IDs and shape of data to help debug
112
+ print("Shape of gene expression data:", gene_data.shape)
113
+ print("\nFirst few rows of data:")
114
+ print(gene_data.head())
115
+ print("\nFirst 20 gene/probe identifiers:")
116
+ print(gene_data.index[:20])
117
+
118
+ # Inspect a snippet of raw file to verify identifier format
119
+ import gzip
120
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
121
+ lines = []
122
+ for i, line in enumerate(f):
123
+ if "!series_matrix_table_begin" in line:
124
+ # Get the next 5 lines after the marker
125
+ for _ in range(5):
126
+ lines.append(next(f).strip())
127
+ break
128
+ print("\nFirst few lines after matrix marker in raw file:")
129
+ for line in lines:
130
+ print(line)
131
+ # Looking at the data, we see numeric IDs (3,4,5,8,9 etc) being used as identifiers
132
+ # These are not standard human gene symbols, which are typically alphanumeric (e.g. TP53, BRCA1)
133
+ # Therefore mapping will be required to convert these IDs to gene symbols
134
+
135
+ requires_gene_mapping = True
136
+ # Get file paths using library function
137
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
138
+
139
+ # Extract gene annotation from SOFT file and get meaningful data
140
+ gene_annotation = get_gene_annotation(soft_file)
141
+
142
+ # Preview gene annotation data
143
+ print("Gene annotation shape:", gene_annotation.shape)
144
+ print("\nGene annotation preview:")
145
+ print(preview_df(gene_annotation))
146
+
147
+ print("\nNumber of non-null values in each column:")
148
+ print(gene_annotation.count())
149
+
150
+ # Print example rows showing the mapping information columns
151
+ print("\nSample mapping columns ('ID' and 'Gene Symbol'):")
152
+ print(gene_annotation[['ID', 'Gene Symbol']].head().to_string())
153
+
154
+ print("\nNote: Gene mapping will use:")
155
+ print("'ID' column: Probe identifiers")
156
+ print("'Gene Symbol' column: Contains gene symbol information")
157
+ # Get probe-to-gene mapping from annotation data
158
+ mapping_df = gene_annotation[['ID', 'Gene Symbol']].copy()
159
+ mapping_df = mapping_df.rename(columns={'Gene Symbol': 'Gene'})
160
+
161
+ # Convert IDs to string type and remove any leading/trailing whitespace
162
+ mapping_df['ID'] = mapping_df['ID'].astype(str).str.strip()
163
+ gene_data.index = gene_data.index.str.strip()
164
+
165
+ # Filter annotation data to match numeric probe IDs only
166
+ mapping_df = mapping_df[mapping_df['ID'].str.match(r'^\d+$')]
167
+
168
+ # Apply mapping to convert probe-level data to gene expression data
169
+ # Note: Each probe's expression will be divided among its target genes, then summed per gene
170
+ gene_data = apply_gene_mapping(gene_data, mapping_df)
171
+
172
+ # Normalize gene symbols before saving
173
+ gene_data = normalize_gene_symbols_in_index(gene_data)
174
+
175
+ print("Shape after mapping probes to genes:", gene_data.shape)
176
+ print("\nFirst few rows of gene expression data:")
177
+ print(gene_data.head())
178
+
179
+ # Save gene expression data
180
+ gene_data.to_csv(out_gene_data_file)
181
+ # Skip data linking since gene mapping failed
182
+ linked_data = pd.DataFrame() # Empty dataframe since no valid gene data
183
+
184
+ # Validate and save cohort info indicating the data is not usable
185
+ is_usable = validate_and_save_cohort_info(
186
+ is_final=True,
187
+ cohort=cohort,
188
+ info_path=json_path,
189
+ is_gene_available=False, # Set to False since gene mapping failed
190
+ is_trait_available=True, # Clinical data was successfully extracted
191
+ is_biased=True, # No valid data to analyze
192
+ df=linked_data,
193
+ note="Gene mapping failed - numeric probe IDs in expression data did not match Affymetrix IDs in annotation"
194
+ )
p3/preprocess/Adrenocortical_Cancer/code/GSE49278.py ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Adrenocortical_Cancer"
6
+ cohort = "GSE49278"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Adrenocortical_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Adrenocortical_Cancer/GSE49278"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Adrenocortical_Cancer/GSE49278.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Adrenocortical_Cancer/gene_data/GSE49278.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Adrenocortical_Cancer/clinical_data/GSE49278.csv"
16
+ json_path = "./output/preprocess/3/Adrenocortical_Cancer/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene Expression Data Availability
37
+ # Yes - Affymetrix Human Gene 2.0 ST Array data mentioned in background info
38
+ is_gene_available = True
39
+
40
+ # 2. Variable Availability and Row Identification
41
+ trait_row = 2 # Cell type row contains ACC info
42
+ age_row = 0 # Age data available
43
+ gender_row = 1 # Gender data available
44
+
45
+ # 2.2 Data Type Conversion Functions
46
+ def convert_trait(value: str) -> int:
47
+ """Convert cell type to binary where ACC=1"""
48
+ if pd.isna(value):
49
+ return None
50
+ value = value.split(': ')[-1].strip().lower()
51
+ if 'adrenocortical carcinoma' in value:
52
+ return 1
53
+ return None
54
+
55
+ def convert_age(value: str) -> float:
56
+ """Convert age to continuous numeric value"""
57
+ if pd.isna(value):
58
+ return None
59
+ value = value.split(': ')[-1].strip()
60
+ try:
61
+ return float(value)
62
+ except:
63
+ return None
64
+
65
+ def convert_gender(value: str) -> int:
66
+ """Convert gender to binary where F=0, M=1"""
67
+ if pd.isna(value):
68
+ return None
69
+ value = value.split(': ')[-1].strip().upper()
70
+ if value == 'F':
71
+ return 0
72
+ elif value == 'M':
73
+ return 1
74
+ return None
75
+
76
+ # 3. Save initial metadata
77
+ is_trait_available = trait_row is not None
78
+ _ = validate_and_save_cohort_info(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
+ # 4. Extract clinical features
85
+ if trait_row is not None:
86
+ clinical_features = geo_select_clinical_features(
87
+ clinical_data,
88
+ trait=trait,
89
+ trait_row=trait_row,
90
+ convert_trait=convert_trait,
91
+ age_row=age_row,
92
+ convert_age=convert_age,
93
+ gender_row=gender_row,
94
+ convert_gender=convert_gender
95
+ )
96
+
97
+ # Preview the extracted features
98
+ print("Preview of extracted clinical features:")
99
+ print(preview_df(clinical_features))
100
+
101
+ # Save to CSV
102
+ clinical_features.to_csv(out_clinical_data_file)
103
+ # Extract gene expression data from matrix file
104
+ gene_data = get_genetic_data(matrix_file)
105
+
106
+ # Print first 20 row IDs and shape of data to help debug
107
+ print("Shape of gene expression data:", gene_data.shape)
108
+ print("\nFirst few rows of data:")
109
+ print(gene_data.head())
110
+ print("\nFirst 20 gene/probe identifiers:")
111
+ print(gene_data.index[:20])
112
+
113
+ # Inspect a snippet of raw file to verify identifier format
114
+ import gzip
115
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
116
+ lines = []
117
+ for i, line in enumerate(f):
118
+ if "!series_matrix_table_begin" in line:
119
+ # Get the next 5 lines after the marker
120
+ for _ in range(5):
121
+ lines.append(next(f).strip())
122
+ break
123
+ print("\nFirst few lines after matrix marker in raw file:")
124
+ for line in lines:
125
+ print(line)
126
+ # The identifiers appear to be numeric probe IDs (16650001, etc)
127
+ # which are not human gene symbols and will need to be mapped
128
+ requires_gene_mapping = True
129
+ # Get file paths using library function
130
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
131
+
132
+ # First inspect the SOFT file contents to understand the annotation format
133
+ import gzip
134
+ print("Inspecting SOFT file for gene mapping information:")
135
+ pattern = None
136
+ with gzip.open(soft_file, 'rt') as f:
137
+ for i, line in enumerate(f):
138
+ if i < 100: # Check first 100 lines
139
+ if "gene_assignment" in line or "gene_symbol" in line:
140
+ print(f"\nFound gene mapping pattern in line: {line.strip()}")
141
+ pattern = line
142
+ elif "transcript_id" in line or "mrna_assignment" in line:
143
+ print(f"\nFound alternative mapping pattern in line: {line.strip()}")
144
+ pattern = line
145
+ else:
146
+ break
147
+
148
+ # Based on file inspection, extract gene annotation with appropriate prefixes
149
+ gene_annotation = get_gene_annotation(soft_file, prefixes=['#', '!platform_table_begin', '!platform_table_end'])
150
+
151
+ # Preview gene annotation data structure
152
+ print("\nGene annotation shape:", gene_annotation.shape)
153
+ print("\nAvailable columns:")
154
+ print(gene_annotation.columns.tolist())
155
+
156
+ # Display a few rows of relevant mapping columns
157
+ mapping_cols = [col for col in gene_annotation.columns if 'gene' in col.lower()
158
+ or 'symbol' in col.lower()
159
+ or 'transcript' in col.lower()
160
+ or col == 'ID']
161
+ if mapping_cols:
162
+ print("\nPreview of mapping-related columns:")
163
+ print(gene_annotation[mapping_cols].head())
164
+ else:
165
+ print("\nNo obvious gene mapping columns found. Displaying first row:")
166
+ print(gene_annotation.iloc[0])
p3/preprocess/Adrenocortical_Cancer/code/GSE67766.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Adrenocortical_Cancer"
6
+ cohort = "GSE67766"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Adrenocortical_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Adrenocortical_Cancer/GSE67766"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Adrenocortical_Cancer/GSE67766.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Adrenocortical_Cancer/gene_data/GSE67766.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Adrenocortical_Cancer/clinical_data/GSE67766.csv"
16
+ json_path = "./output/preprocess/3/Adrenocortical_Cancer/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # First extract background info and subseries info
22
+ background_info, _ = get_background_and_clinical_data(matrix_file,
23
+ prefixes_a=['!Series_title', '!Series_summary',
24
+ '!Series_overall_design', '!Series_type',
25
+ '!Series_relation'],
26
+ prefixes_b=None)
27
+
28
+ print("Initial Dataset Information:")
29
+ print(background_info)
30
+ print("\nChecking for subseries...\n")
31
+
32
+ # If SuperSeries, get the constituent series accession
33
+ subseries = None
34
+ if 'SuperSeries' in background_info:
35
+ for line in background_info.split('\n'):
36
+ if '!Series_relation\t' in line:
37
+ matches = re.finditer(r'GSE\d+', line)
38
+ for match in matches:
39
+ potential_subseries = match.group(0)
40
+ if potential_subseries != cohort: # Skip if it's the SuperSeries ID
41
+ subseries_dir = os.path.join(in_trait_dir, potential_subseries)
42
+ if os.path.exists(subseries_dir):
43
+ print(f"Found valid subseries: {potential_subseries}")
44
+ subseries = potential_subseries
45
+ break
46
+
47
+ # If subseries found, update directory path and get new files
48
+ if subseries:
49
+ in_cohort_dir = os.path.join(in_trait_dir, subseries)
50
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
51
+ print(f"\nUsing subseries data from: {in_cohort_dir}\n")
52
+ else:
53
+ print("\nNo valid subseries found, using original data\n")
54
+
55
+ # Extract background info and clinical data from final files
56
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
57
+
58
+ # Get unique values per clinical feature
59
+ sample_characteristics = get_unique_values_by_row(clinical_data)
60
+
61
+ # Print final dataset information
62
+ print("Final Dataset Information:")
63
+ print(f"{background_info}\n")
64
+
65
+ print("Sample Characteristics:")
66
+ for feature, values in sample_characteristics.items():
67
+ print(f"Feature: {feature}")
68
+ print(f"Values: {values}\n")
69
+ # 1. Gene Expression Data Availability
70
+ # Based on !Series_type, which includes "Expression profiling by array" and "Expression profiling by high throughput sequencing"
71
+ # this dataset likely contains gene expression data
72
+ is_gene_available = True
73
+
74
+ # 2.1 Data Availability
75
+ # Looking at sample characteristics:
76
+ # Row 0 shows "cell line: SW-13" - this indicates cell line data, not clinical samples
77
+ # No rows for trait, age or gender found
78
+ trait_row = None
79
+ age_row = None
80
+ gender_row = None
81
+
82
+ # 2.2 Data Type Conversion Functions
83
+ # Although not used since data is unavailable, define placeholder functions
84
+ def convert_trait(x):
85
+ if x is None or pd.isna(x):
86
+ return None
87
+ value = str(x).split(':')[-1].strip()
88
+ # Binary conversion would go here
89
+ return None
90
+
91
+ def convert_age(x):
92
+ if x is None or pd.isna(x):
93
+ return None
94
+ value = str(x).split(':')[-1].strip()
95
+ # Numeric conversion would go here
96
+ return None
97
+
98
+ def convert_gender(x):
99
+ if x is None or pd.isna(x):
100
+ return None
101
+ value = str(x).split(':')[-1].strip().lower()
102
+ # Gender binary conversion would go here
103
+ return None
104
+
105
+ # 3. Save Metadata
106
+ # trait_row is None so is_trait_available is False
107
+ validate_and_save_cohort_info(is_final=False,
108
+ cohort=cohort,
109
+ info_path=json_path,
110
+ is_gene_available=is_gene_available,
111
+ is_trait_available=False)
112
+
113
+ # 4. Clinical Feature Extraction
114
+ # Skip since trait_row is None
115
+ # Extract gene expression data from matrix file
116
+ gene_data = get_genetic_data(matrix_file)
117
+
118
+ # Print first 20 row IDs and shape of data to help debug
119
+ print("Shape of gene expression data:", gene_data.shape)
120
+ print("\nFirst few rows of data:")
121
+ print(gene_data.head())
122
+ print("\nFirst 20 gene/probe identifiers:")
123
+ print(gene_data.index[:20])
124
+
125
+ # Inspect a snippet of raw file to verify identifier format
126
+ import gzip
127
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
128
+ lines = []
129
+ for i, line in enumerate(f):
130
+ if "!series_matrix_table_begin" in line:
131
+ # Get the next 5 lines after the marker
132
+ for _ in range(5):
133
+ lines.append(next(f).strip())
134
+ break
135
+ print("\nFirst few lines after matrix marker in raw file:")
136
+ for line in lines:
137
+ print(line)
138
+ # Looking at the identifiers starting with "ILMN_", these are Illumina probe IDs
139
+ # They need to be mapped to official gene symbols to be interpretable in analysis
140
+ requires_gene_mapping = True
141
+ # Get file paths using library function
142
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
143
+
144
+ # Extract gene annotation from SOFT file and get meaningful data
145
+ gene_annotation = get_gene_annotation(soft_file)
146
+
147
+ # Preview gene annotation data
148
+ print("Gene annotation shape:", gene_annotation.shape)
149
+ print("\nGene annotation preview:")
150
+ print(preview_df(gene_annotation))
151
+
152
+ print("\nNumber of non-null values in each column:")
153
+ print(gene_annotation.count())
154
+
155
+ # Print example rows showing the mapping information columns
156
+ print("\nSample mapping columns ('ID' and 'Symbol'):")
157
+ print("\nFirst 5 rows:")
158
+ print(gene_annotation[['ID', 'Symbol']].head().to_string())
159
+
160
+ print("\nNote: Gene mapping will use:")
161
+ print("'ID' column: Probe identifiers")
162
+ print("'Symbol' column: Contains gene symbol information")
163
+ # 1. Based on previous output:
164
+ # Gene expression data uses 'ILMN_*' identifiers as index
165
+ # Gene annotation data has matching IDs in 'ID' column and gene symbols in 'Symbol' column
166
+
167
+ # 2. Extract mapping between probe IDs and gene symbols
168
+ mapping = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Symbol')
169
+
170
+ # 3. Apply gene mapping to convert probe-level measurements to gene expression
171
+ gene_data = apply_gene_mapping(gene_data, mapping)
172
+
173
+ # Print info about the mapping results
174
+ print("Shape of probe-level data:", gene_data.shape)
175
+ print("\nShape after mapping to genes:", gene_data.shape)
176
+ print("\nFirst few rows of gene expression data:")
177
+ print(gene_data.head())
178
+ print("\nFirst few gene symbols:")
179
+ print(gene_data.index[:10])
180
+ # 1. Normalize and save gene expression data
181
+ gene_data = normalize_gene_symbols_in_index(gene_data)
182
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
183
+ gene_data.to_csv(out_gene_data_file)
184
+
185
+ # 2-4. Skip clinical data linking and bias checking since no clinical data exists
186
+
187
+ # 5. Update cohort info to reflect dataset is not usable due to lack of trait data
188
+ validate_and_save_cohort_info(
189
+ is_final=True,
190
+ cohort=cohort,
191
+ info_path=json_path,
192
+ is_gene_available=True,
193
+ is_trait_available=False,
194
+ is_biased=True, # Cell line data is considered biased for human trait analysis
195
+ df=gene_data, # Provide gene expression data
196
+ note="Dataset contains only cell line data (SW-13) without clinical information"
197
+ )
198
+
199
+ # 6. Skip saving linked data since dataset is not usable for trait analysis
p3/preprocess/Adrenocortical_Cancer/code/GSE75415.py ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Adrenocortical_Cancer"
6
+ cohort = "GSE75415"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Adrenocortical_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Adrenocortical_Cancer/GSE75415"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Adrenocortical_Cancer/GSE75415.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Adrenocortical_Cancer/gene_data/GSE75415.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Adrenocortical_Cancer/clinical_data/GSE75415.csv"
16
+ json_path = "./output/preprocess/3/Adrenocortical_Cancer/cohort_info.json"
17
+
18
+ # Get file paths
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values per clinical feature
25
+ sample_characteristics = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Dataset Background Information:")
29
+ print(f"{background_info}\n")
30
+
31
+ # Print sample characteristics
32
+ print("Sample Characteristics:")
33
+ for feature, values in sample_characteristics.items():
34
+ print(f"Feature: {feature}")
35
+ print(f"Values: {values}\n")
36
+ # 1. Gene expression data availability - "Gene expression profiling" in title suggests gene data
37
+ is_gene_available = True
38
+
39
+ # 2.1. Identify feature rows from sample characteristics
40
+ trait_row = 1 # "histologic type" indicates tumor/normal status
41
+ age_row = None # Age not available in sample characteristics
42
+ gender_row = 0 # Gender data available
43
+
44
+ # 2.2. Data type conversion functions
45
+ def convert_trait(val: str) -> int:
46
+ """Convert histologic type to binary: 1 for tumor (carcinoma/adenoma), 0 for normal"""
47
+ if not val or 'unknown' in val.lower():
48
+ return None
49
+ val = val.lower().split(': ')[-1]
50
+ if 'normal' in val:
51
+ return 0
52
+ elif 'carcinoma' in val or 'adenoma' in val:
53
+ return 1
54
+ return None
55
+
56
+ def convert_gender(val: str) -> int:
57
+ """Convert gender to binary: 0 for female, 1 for male"""
58
+ if not val or 'unknown' in val.lower():
59
+ return None
60
+ val = val.lower().split(': ')[-1]
61
+ if 'female' in val:
62
+ return 0
63
+ elif 'male' in val:
64
+ return 1
65
+ return None
66
+
67
+ # 3. Save metadata about data availability
68
+ validate_and_save_cohort_info(is_final=False,
69
+ cohort=cohort,
70
+ info_path=json_path,
71
+ is_gene_available=is_gene_available,
72
+ is_trait_available=trait_row is not None)
73
+
74
+ # 4. Extract clinical features since trait_row is not None
75
+ clinical_df = geo_select_clinical_features(clinical_data,
76
+ trait=trait,
77
+ trait_row=trait_row,
78
+ convert_trait=convert_trait,
79
+ gender_row=gender_row,
80
+ convert_gender=convert_gender)
81
+
82
+ # Preview and save clinical data
83
+ print("Clinical data preview:")
84
+ print(preview_df(clinical_df))
85
+ clinical_df.to_csv(out_clinical_data_file)
86
+ # Extract gene expression data from matrix file
87
+ gene_data = get_genetic_data(matrix_file)
88
+
89
+ # Print first 20 row IDs and shape of data to help debug
90
+ print("Shape of gene expression data:", gene_data.shape)
91
+ print("\nFirst few rows of data:")
92
+ print(gene_data.head())
93
+ print("\nFirst 20 gene/probe identifiers:")
94
+ print(gene_data.index[:20])
95
+
96
+ # Inspect a snippet of raw file to verify identifier format
97
+ import gzip
98
+ with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
99
+ lines = []
100
+ for i, line in enumerate(f):
101
+ if "!series_matrix_table_begin" in line:
102
+ # Get the next 5 lines after the marker
103
+ for _ in range(5):
104
+ lines.append(next(f).strip())
105
+ break
106
+ print("\nFirst few lines after matrix marker in raw file:")
107
+ for line in lines:
108
+ print(line)
109
+ # Looking at the identifiers like '1007_s_at', '1053_at', etc. these appear to be
110
+ # Affymetrix probe IDs rather than standard gene symbols
111
+ # They will need to be mapped to HGNC gene symbols
112
+ requires_gene_mapping = True
113
+ # Get file paths using library function
114
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
115
+
116
+ # Extract gene annotation from SOFT file and get meaningful data
117
+ gene_annotation = get_gene_annotation(soft_file)
118
+
119
+ # Preview gene annotation data
120
+ print("Gene annotation shape:", gene_annotation.shape)
121
+ print("\nGene annotation preview:")
122
+ print(preview_df(gene_annotation))
123
+
124
+ print("\nNumber of non-null values in each column:")
125
+ print(gene_annotation.count())
126
+
127
+ # Print example rows showing the mapping information columns
128
+ print("\nSample mapping columns ('ID' and 'Gene Symbol'):")
129
+ print("\nFirst 5 rows:")
130
+ print(gene_annotation[['ID', 'Gene Symbol']].head().to_string())
131
+
132
+ print("\nNote: Gene mapping will use:")
133
+ print("'ID' column: Probe identifiers")
134
+ print("'Gene Symbol' column: Contains gene symbol information")
135
+ # Extract mapping between probe IDs and gene symbols from annotation data
136
+ mapping_data = get_gene_mapping(gene_annotation, 'ID', 'Gene Symbol')
137
+
138
+ # Convert probe-level measurements to gene expression data using the mapping
139
+ gene_data = apply_gene_mapping(gene_data, mapping_data)
140
+
141
+ # Preview the mapped gene expression data
142
+ print("Gene expression data after mapping:")
143
+ print("Shape:", gene_data.shape)
144
+ print("\nFirst few rows:")
145
+ print(gene_data.head())
146
+ # 1. Load clinical data and save normalized gene data
147
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
148
+ gene_data.index = gene_data.index.str.replace('-mRNA', '')
149
+ gene_data = normalize_gene_symbols_in_index(gene_data)
150
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
151
+ gene_data.to_csv(out_gene_data_file)
152
+
153
+ # 2. Link clinical and genetic data
154
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
155
+
156
+ # 3. Handle missing values
157
+ linked_data = handle_missing_values(linked_data, trait)
158
+
159
+ # 4. Check for biased features and remove them if needed
160
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
161
+
162
+ # 5. Validate and save cohort info
163
+ is_usable = validate_and_save_cohort_info(
164
+ is_final=True,
165
+ cohort=cohort,
166
+ info_path=json_path,
167
+ is_gene_available=True,
168
+ is_trait_available=True,
169
+ is_biased=is_biased,
170
+ df=linked_data,
171
+ note="Study examining gene expression changes in adipose tissue under different protein diets during energy restriction"
172
+ )
173
+
174
+ # 6. Save linked data if usable
175
+ if is_usable:
176
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
177
+ linked_data.to_csv(out_data_file)
p3/preprocess/Adrenocortical_Cancer/cohort_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"GSE90713": {"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": 63, "note": "Study examining gene expression changes in adipose tissue under different protein diets during energy restriction"}, "GSE76019": {"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": 34, "note": "Study examining gene expression changes in adipose tissue under different protein diets during energy restriction"}, "GSE75415": {"is_usable": true, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": false, "has_age": false, "has_gender": true, "sample_size": 30, "note": "Study examining gene expression changes in adipose tissue under different protein diets during energy restriction"}, "GSE68950": {"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": "Data from Sanger cell line Affymetrix gene expression project examining cancer cell lines"}, "GSE68606": {"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": 137, "note": "Study examining gene expression changes in adipose tissue under different protein diets during energy restriction"}, "GSE67766": {"is_usable": false, "is_gene_available": true, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": "Dataset contains only cell line data (SW-13) without clinical information"}, "GSE19776": {"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": "Gene mapping failed - numeric probe IDs in expression data did not match Affymetrix IDs in annotation"}, "GSE143383": {"is_usable": false, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": true, "has_age": false, "has_gender": true, "sample_size": 63, "note": "Gene expression data successfully mapped and linked with clinical features"}, "GSE108088": {"is_usable": false, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": true, "has_age": false, "has_gender": false, "sample_size": 43, "note": "Gene expression data successfully mapped and linked with clinical features"}, "TCGA": {"is_usable": false, "is_gene_available": true, "is_trait_available": true, "is_available": true, "is_biased": true, "has_age": true, "has_gender": true, "sample_size": 79, "note": "Contains molecular data from tumor and normal samples with patient demographics."}}
p3/preprocess/Stomach_Cancer/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a95276d0194fd38e5ad18bb68f1441609b7e74e6ccf13b13a02d8c6e998fa39
3
+ size 134880596
p3/preprocess/Type_1_Diabetes/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1af91f3f70de4ff46a0012ce0656136fa7cb77931fc4a8b729666b6f55c84ee0
3
+ size 55211577
p3/preprocess/Underweight/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1af91f3f70de4ff46a0012ce0656136fa7cb77931fc4a8b729666b6f55c84ee0
3
+ size 55211577