Liu-Hy commited on
Commit
7623c74
·
verified ·
1 Parent(s): f811ee7

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 +3 -0
  2. p3/preprocess/Kidney_stones/gene_data/TCGA.csv +3 -0
  3. p3/preprocess/LDL_Cholesterol_Levels/GSE181339.csv +0 -0
  4. p3/preprocess/LDL_Cholesterol_Levels/clinical_data/GSE181339.csv +3 -0
  5. p3/preprocess/LDL_Cholesterol_Levels/clinical_data/GSE34945.csv +2 -0
  6. p3/preprocess/LDL_Cholesterol_Levels/code/GSE111567.py +120 -0
  7. p3/preprocess/LDL_Cholesterol_Levels/code/GSE181339.py +153 -0
  8. p3/preprocess/LDL_Cholesterol_Levels/code/GSE28893.py +130 -0
  9. p3/preprocess/LDL_Cholesterol_Levels/code/GSE34945.py +87 -0
  10. p3/preprocess/LDL_Cholesterol_Levels/code/TCGA.py +179 -0
  11. p3/preprocess/LDL_Cholesterol_Levels/cohort_info.json +1 -0
  12. p3/preprocess/LDL_Cholesterol_Levels/gene_data/GSE111567.csv +0 -0
  13. p3/preprocess/LDL_Cholesterol_Levels/gene_data/GSE181339.csv +0 -0
  14. p3/preprocess/Lactose_Intolerance/gene_data/GSE136395.csv +3 -0
  15. p3/preprocess/Lactose_Intolerance/gene_data/GSE138297.csv +3 -0
  16. p3/preprocess/Large_B-cell_Lymphoma/GSE243973.csv +0 -0
  17. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE114022.csv +2 -0
  18. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE142494.csv +2 -0
  19. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE145848.csv +2 -0
  20. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE156309.csv +3 -0
  21. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE159472.csv +2 -0
  22. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE173263.csv +2 -0
  23. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE197977.csv +2 -0
  24. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE243973.csv +2 -0
  25. p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE248835.csv +2 -0
  26. p3/preprocess/Large_B-cell_Lymphoma/code/GSE114022.py +132 -0
  27. p3/preprocess/Large_B-cell_Lymphoma/code/GSE142494.py +118 -0
  28. p3/preprocess/Large_B-cell_Lymphoma/code/GSE145848.py +115 -0
  29. p3/preprocess/Large_B-cell_Lymphoma/code/GSE156309.py +123 -0
  30. p3/preprocess/Large_B-cell_Lymphoma/code/GSE159472.py +169 -0
  31. p3/preprocess/Large_B-cell_Lymphoma/code/GSE173263.py +120 -0
  32. p3/preprocess/Large_B-cell_Lymphoma/code/GSE182362.py +69 -0
  33. p3/preprocess/Large_B-cell_Lymphoma/code/GSE197977.py +122 -0
  34. p3/preprocess/Large_B-cell_Lymphoma/code/GSE243973.py +133 -0
  35. p3/preprocess/Large_B-cell_Lymphoma/code/GSE248835.py +109 -0
  36. p3/preprocess/Large_B-cell_Lymphoma/code/TCGA.py +166 -0
  37. p3/preprocess/Large_B-cell_Lymphoma/cohort_info.json +1 -0
  38. p3/preprocess/Large_B-cell_Lymphoma/gene_data/GSE243973.csv +0 -0
  39. p3/preprocess/Liver_Cancer/clinical_data/GSE148346.csv +2 -0
  40. p3/preprocess/Liver_Cancer/clinical_data/GSE164760.csv +2 -0
  41. p3/preprocess/Liver_Cancer/clinical_data/GSE174570.csv +2 -0
  42. p3/preprocess/Liver_Cancer/clinical_data/GSE228782.csv +2 -0
  43. p3/preprocess/Liver_Cancer/clinical_data/GSE228783.csv +2 -0
  44. p3/preprocess/Liver_Cancer/clinical_data/GSE45032.csv +4 -0
  45. p3/preprocess/Liver_Cancer/clinical_data/GSE66843.csv +2 -0
  46. p3/preprocess/Liver_Cancer/clinical_data/TCGA.csv +439 -0
  47. p3/preprocess/Liver_Cancer/code/GSE148346.py +139 -0
  48. p3/preprocess/Liver_Cancer/code/GSE164760.py +146 -0
  49. p3/preprocess/Liver_Cancer/code/GSE174570.py +81 -0
  50. p3/preprocess/Liver_Cancer/code/GSE178201.py +136 -0
.gitattributes CHANGED
@@ -1853,3 +1853,6 @@ p3/preprocess/Kidney_Papillary_Cell_Carcinoma/gene_data/GSE68950.csv filter=lfs
1853
  p3/preprocess/Kidney_Clear_Cell_Carcinoma/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1854
  p3/preprocess/Kidney_stones/gene_data/GSE123993.csv filter=lfs diff=lfs merge=lfs -text
1855
  p3/preprocess/Kidney_stones/gene_data/GSE73680.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
1853
  p3/preprocess/Kidney_Clear_Cell_Carcinoma/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1854
  p3/preprocess/Kidney_stones/gene_data/GSE123993.csv filter=lfs diff=lfs merge=lfs -text
1855
  p3/preprocess/Kidney_stones/gene_data/GSE73680.csv filter=lfs diff=lfs merge=lfs -text
1856
+ p3/preprocess/Lactose_Intolerance/gene_data/GSE136395.csv filter=lfs diff=lfs merge=lfs -text
1857
+ p3/preprocess/Kidney_stones/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1858
+ p3/preprocess/Lactose_Intolerance/gene_data/GSE138297.csv filter=lfs diff=lfs merge=lfs -text
p3/preprocess/Kidney_stones/gene_data/TCGA.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbe84ce20bc825ee72420fdf2aeb1eb9862eeaa485441df20c9ae1263607b851
3
+ size 97074045
p3/preprocess/LDL_Cholesterol_Levels/GSE181339.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/LDL_Cholesterol_Levels/clinical_data/GSE181339.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ,GSM5494930,GSM5494931,GSM5494932,GSM5494933,GSM5494934,GSM5494935,GSM5494936,GSM5494937,GSM5494938,GSM5494939,GSM5494940,GSM5494941,GSM5494942,GSM5494943,GSM5494944,GSM5494945,GSM5494946,GSM5494947,GSM5494948,GSM5494949,GSM5494950,GSM5494951,GSM5494952,GSM5494953,GSM5494954,GSM5494955,GSM5494956,GSM5494957,GSM5494958,GSM5494959,GSM5494960,GSM5494961,GSM5494962,GSM5494963,GSM5494964,GSM5494965,GSM5494966,GSM5494967,GSM5494968,GSM5494969,GSM5494970,GSM5494971,GSM5494972,GSM5494973,GSM5494974,GSM5494975,GSM5494976,GSM5494977,GSM5494978,GSM5494979,GSM5494980,GSM5494981,GSM5494982,GSM5494983,GSM5494984,GSM5494985,GSM5494986,GSM5494987,GSM5494988,GSM5494989,GSM5494990,GSM5494991,GSM5494992,GSM5494993,GSM5494994,GSM5494995,GSM5494996,GSM5494997,GSM5494998,GSM5494999,GSM5495000,GSM5495001,GSM5495002,GSM5495003,GSM5495004,GSM5495005,GSM5495006,GSM5495007
2
+ LDL_Cholesterol_Levels,0.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,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,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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
+ Gender,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.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,1.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0
p3/preprocess/LDL_Cholesterol_Levels/clinical_data/GSE34945.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM858200,GSM858201,GSM858202,GSM858203,GSM858204,GSM858205,GSM858206,GSM858207,GSM858208,GSM858209,GSM858210,GSM858211,GSM858212,GSM858213,GSM858214,GSM858215,GSM858216,GSM858217,GSM858218,GSM858219,GSM858220,GSM858221,GSM858222,GSM858223,GSM858224,GSM858225,GSM858226,GSM858227,GSM858228,GSM858229,GSM858230,GSM858231,GSM858232,GSM858233,GSM858234,GSM858235,GSM858236,GSM858237,GSM858238,GSM858239,GSM858240,GSM858241,GSM858242,GSM858243,GSM858244,GSM858245,GSM858246,GSM858247,GSM858248,GSM858249,GSM858250,GSM858251,GSM858252,GSM858253,GSM858254,GSM858255,GSM858256,GSM858257,GSM858258,GSM858259,GSM858260,GSM858261,GSM858262,GSM858263,GSM858264,GSM858265,GSM858266,GSM858267,GSM858268,GSM858269,GSM858270,GSM858271,GSM858272,GSM858273,GSM858274,GSM858275,GSM858276,GSM858277,GSM858278,GSM858279,GSM858280,GSM858281,GSM858282,GSM858283,GSM858284,GSM858285,GSM858286,GSM858287,GSM858288,GSM858289,GSM858290,GSM858291,GSM858292,GSM858293,GSM858294,GSM858295,GSM858296,GSM858297,GSM858298,GSM858299,GSM858300,GSM858301,GSM858302,GSM858303,GSM858304,GSM858305,GSM858306,GSM858307,GSM858308,GSM858309,GSM858310,GSM858311,GSM858312,GSM858313,GSM858314,GSM858315,GSM858316,GSM858317,GSM858318,GSM858319,GSM858320,GSM858321,GSM858322,GSM858323,GSM858324,GSM858325,GSM858326,GSM858327,GSM858328,GSM858329,GSM858330,GSM858331,GSM858332,GSM858333,GSM858334,GSM858335,GSM858336,GSM858337,GSM858338,GSM858339,GSM858340,GSM858341,GSM858342,GSM858343,GSM858344,GSM858345,GSM858346,GSM858347,GSM858348,GSM858349,GSM858350,GSM858351,GSM858352,GSM858353,GSM858354,GSM858355,GSM858356,GSM858357,GSM858358,GSM858359,GSM858360,GSM858361,GSM858362,GSM858363,GSM858364,GSM858365,GSM858366,GSM858367,GSM858368,GSM858369,GSM858370,GSM858371,GSM858372,GSM858373,GSM858374,GSM858375,GSM858376,GSM858377,GSM858378,GSM858379,GSM858380,GSM858381,GSM858382,GSM858383,GSM858384,GSM858385,GSM858386,GSM858387,GSM858388,GSM858389,GSM858390,GSM858391,GSM858392,GSM858393,GSM858394,GSM858395,GSM858396,GSM858397,GSM858398,GSM858399,GSM858400,GSM858401,GSM858402,GSM858403,GSM858404,GSM858405,GSM858406,GSM858407,GSM858408,GSM858409,GSM858410,GSM858411,GSM858412,GSM858413,GSM858414,GSM858415,GSM858416,GSM858417,GSM858418,GSM858419,GSM858420,GSM858421,GSM858422,GSM858423,GSM858424,GSM858425,GSM858426,GSM858427,GSM858428,GSM858429,GSM858430,GSM858431,GSM858432,GSM858433,GSM858434,GSM858435,GSM858436,GSM858437,GSM858438,GSM858439,GSM858440,GSM858441,GSM858442,GSM858443,GSM858444,GSM858445,GSM858446,GSM858447,GSM858448,GSM858449,GSM858450,GSM858451,GSM858452,GSM858453,GSM858454,GSM858455,GSM858456,GSM858457,GSM858458,GSM858459,GSM858460,GSM858461,GSM858462,GSM858463,GSM858464,GSM858465,GSM858466,GSM858467,GSM858468,GSM858469,GSM858470,GSM858471,GSM858472,GSM858473,GSM858474,GSM858475,GSM858476,GSM858477,GSM858478,GSM858479,GSM858480,GSM858481,GSM858482,GSM858483,GSM858484,GSM858485,GSM858486,GSM858487,GSM858488,GSM858489,GSM858490,GSM858491,GSM858492,GSM858493,GSM858494,GSM858495,GSM858496,GSM858497,GSM858498,GSM858499,GSM858500,GSM858501,GSM858502,GSM858503,GSM858504,GSM858505,GSM858506,GSM858507,GSM858508,GSM858509,GSM858510,GSM858511,GSM858512,GSM858513,GSM858514,GSM858515,GSM858516,GSM858517,GSM858518,GSM858519,GSM858520,GSM858521,GSM858522,GSM858523,GSM858524,GSM858525,GSM858526,GSM858527,GSM858528,GSM858529,GSM858530,GSM858531,GSM858532,GSM858533,GSM858534,GSM858535,GSM858536,GSM858537,GSM858538,GSM858539,GSM858540,GSM858541,GSM858542,GSM858543,GSM858544,GSM858545,GSM858546,GSM858547,GSM858548,GSM858549,GSM858550,GSM858551,GSM858552,GSM858553,GSM858554,GSM858555,GSM858556,GSM858557,GSM858558,GSM858559,GSM858560,GSM858561,GSM858562,GSM858563,GSM858564,GSM858565,GSM858566,GSM858567,GSM858568,GSM858569,GSM858570,GSM858571,GSM858572,GSM858573,GSM858574,GSM858575,GSM858576,GSM858577,GSM858578,GSM858579,GSM858580,GSM858581,GSM858582,GSM858583,GSM858584,GSM858585,GSM858586,GSM858587,GSM858588,GSM858589,GSM858590,GSM858591,GSM858592,GSM858593,GSM858594,GSM858595,GSM858596,GSM858597,GSM858598,GSM858599,GSM858600,GSM858601,GSM858602,GSM858603,GSM858604,GSM858605,GSM858606,GSM858607,GSM858608,GSM858609,GSM858610,GSM858611,GSM858612,GSM858613,GSM858614,GSM858615,GSM858616,GSM858617,GSM858618,GSM858619,GSM858620,GSM858621,GSM858622,GSM858623,GSM858624,GSM858625,GSM858626,GSM858627,GSM858628,GSM858629,GSM858630,GSM858631,GSM858632,GSM858633,GSM858634,GSM858635,GSM858636,GSM858637,GSM858638,GSM858639,GSM858640,GSM858641,GSM858642,GSM858643,GSM858644,GSM858645,GSM858646,GSM858647,GSM858648,GSM858649,GSM858650,GSM858651,GSM858652,GSM858653,GSM858654,GSM858655,GSM858656,GSM858657,GSM858658,GSM858659,GSM858660,GSM858661,GSM858662,GSM858663,GSM858664,GSM858665,GSM858666,GSM858667,GSM858668,GSM858669,GSM858670,GSM858671,GSM858672,GSM858673,GSM858674,GSM858675,GSM858676,GSM858677,GSM858678,GSM858679,GSM858680,GSM858681,GSM858682,GSM858683,GSM858684,GSM858685,GSM858686,GSM858687,GSM858688,GSM858689,GSM858690,GSM858691,GSM858692,GSM858693,GSM858694,GSM858695,GSM858696,GSM858697,GSM858698,GSM858699,GSM858700,GSM858701,GSM858702,GSM858703,GSM858704,GSM858705,GSM858706,GSM858707,GSM858708,GSM858709,GSM858710,GSM858711,GSM858712,GSM858713,GSM858714,GSM858715,GSM858716,GSM858717,GSM858718,GSM858719,GSM858720,GSM858721,GSM858722,GSM858723,GSM858724,GSM858725,GSM858726,GSM858727,GSM858728,GSM858729,GSM858730,GSM858731,GSM858732,GSM858733,GSM858734,GSM858735,GSM858736,GSM858737,GSM858738,GSM858739,GSM858740,GSM858741,GSM858742,GSM858743,GSM858744,GSM858745,GSM858746,GSM858747,GSM858748,GSM858749,GSM858750,GSM858751,GSM858752,GSM858753,GSM858754,GSM858755,GSM858756,GSM858757,GSM858758,GSM858759,GSM858760,GSM858761,GSM858762,GSM858763,GSM858764,GSM858765,GSM858766,GSM858767,GSM858768,GSM858769,GSM858770,GSM858771,GSM858772,GSM858773,GSM858774,GSM858775,GSM858776,GSM858777,GSM858778,GSM858779,GSM858780,GSM858781,GSM858782,GSM858783,GSM858784,GSM858785,GSM858786,GSM858787,GSM858788,GSM858789,GSM858790,GSM858791,GSM858792,GSM858793,GSM858794,GSM858795,GSM858796,GSM858797,GSM858798,GSM858799,GSM858800,GSM858801,GSM858802,GSM858803,GSM858804,GSM858805,GSM858806,GSM858807,GSM858808,GSM858809,GSM858810,GSM858811,GSM858812,GSM858813,GSM858814,GSM858815,GSM858816,GSM858817,GSM858818,GSM858819,GSM858820,GSM858821,GSM858822,GSM858823,GSM858824,GSM858825,GSM858826,GSM858827,GSM858828,GSM858829,GSM858830,GSM858831,GSM858832,GSM858833,GSM858834,GSM858835,GSM858836,GSM858837,GSM858838,GSM858839,GSM858840,GSM858841,GSM858842,GSM858843,GSM858844,GSM858845,GSM858846,GSM858847,GSM858848,GSM858849,GSM858850,GSM858851,GSM858852,GSM858853,GSM858854,GSM858855,GSM858856,GSM858857,GSM858858,GSM858859,GSM858860,GSM858861,GSM858862,GSM858863,GSM858864,GSM858865,GSM858866,GSM858867,GSM858868,GSM858869,GSM858870,GSM858871,GSM858872,GSM858873,GSM858874,GSM858875,GSM858876,GSM858877,GSM858878,GSM858879,GSM858880,GSM858881,GSM858882,GSM858883,GSM858884,GSM858885,GSM858886,GSM858887,GSM858888,GSM858889,GSM858890,GSM858891,GSM858892,GSM858893,GSM858894,GSM858895,GSM858896,GSM858897,GSM858898,GSM858899,GSM858900,GSM858901,GSM858902,GSM858903,GSM858904,GSM858905,GSM858906,GSM858907,GSM858908,GSM858909,GSM858910,GSM858911,GSM858912,GSM858913,GSM858914,GSM858915,GSM858916,GSM858917,GSM858918,GSM858919,GSM858920,GSM858921,GSM858922,GSM858923,GSM858924,GSM858925,GSM858926,GSM858927,GSM858928,GSM858929,GSM858930,GSM858931,GSM858932,GSM858933,GSM858934,GSM858935,GSM858936,GSM858937,GSM858938,GSM858939,GSM858940,GSM858941,GSM858942,GSM858943,GSM858944,GSM858945,GSM858946,GSM858947,GSM858948,GSM858949,GSM858950,GSM858951,GSM858952,GSM858953,GSM858954,GSM858955,GSM858956,GSM858957,GSM858958,GSM858959,GSM858960,GSM858961,GSM858962,GSM858963,GSM858964,GSM858965,GSM858966,GSM858967,GSM858968,GSM858969,GSM858970,GSM858971,GSM858972,GSM858973,GSM858974,GSM858975,GSM858976,GSM858977,GSM858978,GSM858979,GSM858980,GSM858981,GSM858982,GSM858983,GSM858984,GSM858985,GSM858986,GSM858987,GSM858988,GSM858989,GSM858990,GSM858991,GSM858992,GSM858993,GSM858994,GSM858995,GSM858996,GSM858997,GSM858998,GSM858999,GSM859000,GSM859001,GSM859002,GSM859003,GSM859004,GSM859005,GSM859006,GSM859007,GSM859008,GSM859009,GSM859010,GSM859011,GSM859012,GSM859013,GSM859014,GSM859015,GSM859016,GSM859017,GSM859018,GSM859019,GSM859020,GSM859021,GSM859022,GSM859023,GSM859024,GSM859025,GSM859026,GSM859027,GSM859028,GSM859029,GSM859030,GSM859031,GSM859032,GSM859033,GSM859034,GSM859035,GSM859036,GSM859037,GSM859038,GSM859039,GSM859040,GSM859041,GSM859042,GSM859043,GSM859044,GSM859045,GSM859046,GSM859047,GSM859048,GSM859049,GSM859050,GSM859051,GSM859052,GSM859053,GSM859054,GSM859055,GSM859056,GSM859057,GSM859058,GSM859059,GSM859060,GSM859061,GSM859062,GSM859063,GSM859064,GSM859065,GSM859066,GSM859067,GSM859068,GSM859069,GSM859070,GSM859071,GSM859072,GSM859073,GSM859074,GSM859075,GSM859076,GSM859077,GSM859078,GSM859079,GSM859080,GSM859081,GSM859082,GSM859083,GSM859084,GSM859085,GSM859086,GSM859087,GSM859088,GSM859089,GSM859090,GSM859091,GSM859092,GSM859093,GSM859094,GSM859095,GSM859096,GSM859097,GSM859098,GSM859099,GSM859100,GSM859101,GSM859102,GSM859103,GSM859104,GSM859105,GSM859106,GSM859107,GSM859108,GSM859109,GSM859110,GSM859111,GSM859112,GSM859113,GSM859114,GSM859115,GSM859116,GSM859117,GSM859118,GSM859119,GSM859120,GSM859121,GSM859122,GSM859123,GSM859124,GSM859125,GSM859126,GSM859127,GSM859128,GSM859129,GSM859130,GSM859131,GSM859132,GSM859133,GSM859134,GSM859135,GSM859136,GSM859137,GSM859138,GSM859139,GSM859140,GSM859141,GSM859142,GSM859143,GSM859144,GSM859145,GSM859146,GSM859147,GSM859148,GSM859149,GSM859150,GSM859151,GSM859152,GSM859153,GSM859154,GSM859155,GSM859156,GSM859157,GSM859158,GSM859159,GSM859160,GSM859161,GSM859162,GSM859163,GSM859164,GSM859165,GSM859166,GSM859167,GSM859168,GSM859169,GSM859170,GSM859171,GSM859172,GSM859173,GSM859174,GSM859175,GSM859176,GSM859177,GSM859178,GSM859179,GSM859180,GSM859181,GSM859182,GSM859183,GSM859184,GSM859185,GSM859186,GSM859187,GSM859188,GSM859189,GSM859190,GSM859191,GSM859192,GSM859193,GSM859194,GSM859195,GSM859196,GSM859197,GSM859198,GSM859199,GSM859200,GSM859201,GSM859202,GSM859203,GSM859204,GSM859205,GSM859206,GSM859207,GSM859208,GSM859209,GSM859210,GSM859211,GSM859212,GSM859213,GSM859214,GSM859215,GSM859216,GSM859217,GSM859218,GSM859219,GSM859220,GSM859221,GSM859222,GSM859223,GSM859224,GSM859225,GSM859226,GSM859227,GSM859228,GSM859229,GSM859230,GSM859231,GSM859232,GSM859233,GSM859234,GSM859235,GSM859236,GSM859237,GSM859238,GSM859239,GSM859240,GSM859241,GSM859242,GSM859243,GSM859244,GSM859245,GSM859246,GSM859247,GSM859248,GSM859249,GSM859250,GSM859251,GSM859252,GSM859253,GSM859254,GSM859255,GSM859256,GSM859257,GSM859258,GSM859259,GSM859260,GSM859261,GSM859262,GSM859263,GSM859264,GSM859265,GSM859266,GSM859267,GSM859268,GSM859269,GSM859270,GSM859271,GSM859272,GSM859273,GSM859274,GSM859275,GSM859276,GSM859277,GSM859278,GSM859279,GSM859280,GSM859281,GSM859282,GSM859283,GSM859284,GSM859285,GSM859286,GSM859287,GSM859288,GSM859289,GSM859290,GSM859291,GSM859292,GSM859293,GSM859294,GSM859295,GSM859296,GSM859297,GSM859298,GSM859299,GSM859300,GSM859301,GSM859302,GSM859303,GSM859304,GSM859305,GSM859306,GSM859307,GSM859308,GSM859309,GSM859310,GSM859311,GSM859312,GSM859313,GSM859314,GSM859315,GSM859316,GSM859317,GSM859318,GSM859319,GSM859320,GSM859321,GSM859322,GSM859323,GSM859324,GSM859325,GSM859326,GSM859327,GSM859328,GSM859329,GSM859330,GSM859331,GSM859332,GSM859333,GSM859334,GSM859335,GSM859336,GSM859337,GSM859338,GSM859339,GSM859340,GSM859341,GSM859342,GSM859343,GSM859344,GSM859345,GSM859346,GSM859347,GSM859348,GSM859349,GSM859350,GSM859351,GSM859352,GSM859353,GSM859354,GSM859355,GSM859356,GSM859357,GSM859358,GSM859359,GSM859360,GSM859361,GSM859362,GSM859363,GSM859364,GSM859365,GSM859366,GSM859367,GSM859368,GSM859369,GSM859370,GSM859371,GSM859372,GSM859373,GSM859374,GSM859375,GSM859376,GSM859377,GSM859378,GSM859379,GSM859380,GSM859381,GSM859382,GSM859383,GSM859384,GSM859385,GSM859386,GSM859387,GSM859388,GSM859389,GSM859390,GSM859391,GSM859392,GSM859393,GSM859394,GSM859395,GSM859396,GSM859397,GSM859398,GSM859399,GSM859400,GSM859401,GSM859402,GSM859403,GSM859404,GSM859405,GSM859406,GSM859407,GSM859408,GSM859409,GSM859410,GSM859411,GSM859412,GSM859413,GSM859414,GSM859415,GSM859416,GSM859417,GSM859418
2
+ LDL_Cholesterol_Levels,5.298013245,-47.59825328,-35.94470046,-23.8372093,-31.57894737,-20.83333333,-41.66666667,-27.92792793,-26.76056338,-32.11382114,-24.06417112,-14.48275862,-18.23899371,-35.31914894,-29.77099237,-36.95652174,-27.91666667,-8.02919708,-27.81065089,-29.76190476,-24.87309645,-29.8245614,-53.27510917,-7.352941176,-27.40384615,-26.9058296,-39.92395437,-40.75829384,-8.888888889,-6.640625,7.894736842,-61.42857143,-49.01960784,-16.44736842,-2.255639098,-34.3373494,-23.28767123,-42.0,-28.57142857,-42.66666667,-21.26245847,-41.7218543,5.479452055,-34.75177305,-25.89928058,19.40298508,-9.565217391,-35.81081081,-26.54320988,-36.40776699,24.80620155,-43.93939394,-26.74418605,6.382978723,-50.4587156,1.234567901,-37.08920188,-33.33333333,-36.80981595,-49.09090909,-44.28571429,-32.59259259,-15.52511416,-1.388888889,-30.55555556,-38.13559322,-5.660377358,-39.61352657,-49.51456311,-16.01731602,9.659090909,-35.17241379,-56.3559322,-23.25581395,-26.06060606,-18.91891892,-35.26785714,-40.4040404,-46.5,0.0,6.896551724,-24.61538462,-30.09259259,-31.57894737,-9.285714286,-11.61616162,-22.02380952,-50.0,42.06896552,-12.71676301,-25.68807339,-43.33333333,-20.76502732,-27.72277228,-18.5840708,-8.396946565,-28.11059908,-33.13253012,-3.333333333,-43.24324324,-22.05882353,-51.62454874,-17.10526316,-49.35897436,-31.61290323,-11.24031008,-42.24137931,-21.47651007,-17.00680272,-61.95286195,-12.35294118,-32.8125,-15.86206897,-12.76595745,-46.40883978,-51.02040816,-44.44444444,5.263157895,-10.2189781,-51.14503817,-46.4516129,-27.83018868,-30.15075377,-17.8343949,-28.71287129,-52.77777778,-49.24242424,-0.934579439,-16.98113208,-46.2962963,-51.17647059,-27.38853503,-25.17006803,-28.49740933,-26.8722467,-15.48387097,-35.97560976,-42.6035503,-29.45736434,2.843601896,-52.96803653,-33.09859155,-16.55172414,-6.993006993,-29.32862191,-9.090909091,-23.70689655,-14.07035176,7.975460123,-49.55752212,-26.75438596,9.844559586,-41.7218543,-36.30136986,-30.84577114,-33.74233129,-9.137055838,0.552486188,-38.76651982,-25.51724138,17.68707483,-21.76470588,-25.36764706,-33.09352518,-27.31707317,-47.09677419,-7.213114754,-47.08737864,5.063291139,-32.3943662,-32.52427184,-47.98206278,-44.67005076,-5.042016807,5.395683453,43.47826087,-38.18181818,-9.6,-29.51807229,-16.25615764,-44.04145078,-32.45614035,-26.54867257,-40.95940959,-34.44976077,-31.90789474,-39.71119134,20.40816327,-41.07142857,-3.184713376,-35.43307087,-43.47826087,-26.47058824,-38.01652893,-53.7593985,-53.51351351,-29.61165049,-36.19631902,-30.17751479,-2.604166667,-36.84210526,-44.85981308,-14.5631068,-18.06451613,-33.18777293,-47.39583333,-35.77023499,-25.86206897,-54.52196382,-27.02702703,9.090909091,-28.43601896,-44.0625,-55.73770492,-34.07821229,-9.266409266,-20.21276596,-25.0,-32.48945148,-27.38853503,-45.64102564,-70.10309278,-37.82051282,-30.06134969,-56.30252101,89.94708995,-24.85207101,14.85148515,-39.16666667,-30.56994819,-29.93197279,-8.275862069,7.857142857,-28.50241546,-48.75,-49.58677686,-44.59459459,-54.07725322,-24.35233161,-26.78571429,-45.61403509,-19.12568306,0.934579439,-36.19631902,-36.875,-25.87064677,-57.05521472,-34.41558442,-23.77622378,-33.84615385,-31.12582781,-40.33613445,-44.76987448,-50.54347826,-45.45454545,-43.91534392,-41.26984127,-50.40983607,-28.0,-16.38418079,-43.08943089,-38.70967742,-44.67005076,-51.63934426,-41.70854271,-35.97560976,15.81769437,-2.247191011,-22.08588957,-35.71428571,-42.85714286,-30.57324841,-44.44444444,-49.20634921,-11.29032258,-43.31983806,-39.18367347,-26.66666667,-25.0,-12.4137931,-52.19512195,-37.20930233,-29.14285714,-41.37931034,-37.5,-14.95327103,-37.20930233,-41.20879121,-26.19047619,-37.80487805,-18.04878049,-50.19455253,-42.25941423,-30.32258065,-21.875,-42.79279279,-40.0,-32.5,-34.74576271,-40.12738854,-44.04145078,-15.2173913,-39.71631206,-34.28571429,-43.75,-23.91304348,-10.92436975,-6.923076923,-29.36170213,-11.18881119,11.9205298,-56.16438356,-50.95238095,-15.96638655,-18.90547264,-60.52631579,-53.19148936,-50.35460993,-30.98591549,-9.248554913,-33.5078534,-35.16483516,-36.17021277,-46.8164794,-38.21989529,-0.877192982,-27.37430168,-25.92592593,-38.79781421,-73.03370787,-45.56213018,-48.7804878,-30.04291845,-32.89473684,-56.23268698,-52.5,-35.07462687,-38.7434555,-48.68913858,-41.99134199,14.56953642,-11.67883212,-0.67114094,-41.71122995,-35.29411765,-47.54098361,-54.74452555,0.0,17.24137931,-14.48275862,-49.15254237,-22.02643172,-40.25157233,-39.07103825,-58.10810811,-44.61538462,-33.61702128,-40.15151515,-55.04885993,-36.69064748,-47.27272727,-28.57142857,-23.13432836,-46.90265487,-48.85245902,-41.66666667,-27.09677419,-15.81920904,-33.10344828,-44.50867052,-24.74226804,-46.80851064,-45.45454545,-29.21348315,-23.80952381,-52.20883534,-21.12676056,-41.81818182,-16.77018634,-45.88235294,-27.10280374,-19.63190184,-42.99065421,-15.58441558,68.33333333,-7.558139535,-12.8,-58.5,-42.95774648,-30.15075377,-27.38095238,-18.03278689,-33.33333333,-22.5,-43.38624339,-41.71779141,-63.00813008,-47.82608696,-50.2617801,-20.12195122,-55.49450549,-4.761904762,-47.36842105,-45.81005587,-36.56716418,-49.71751412,-39.62264151,-51.56950673,-36.36363636,-66.86390533,-43.37349398,-42.76315789,-9.248554913,-55.98290598,-46.40151515,-56.58362989,-67.03601108,-29.19254658,-15.83333333,-34.35114504,-48.58757062,-40.55944056,-58.33333333,-23.07692308,-32.29166667,-45.83333333,-29.13043478,-22.77227723,-31.03448276,-28.28282828,2.325581395,0.571428571,-9.523809524,-25.67567568,-56.19834711,-49.72527473,-55.859375,-40.52287582,-19.8630137,-20.0,-39.13043478,510.0,-29.19708029,-24.08376963,-39.92248062,-36.07142857,-41.66666667,-38.23529412,-22.99465241,-31.19266055,-30.72625698,-31.51515152,-36.86440678,-15.92356688,-21.58273381,-0.625,-6.52173913,-28.81355932,-53.73134328,-36.70212766,-47.34513274,-25.74850299,-13.10861423,-47.01492537,-44.11764706,-36.68341709,-34.14634146,-51.83246073,-48.37398374,-61.97183099,-17.5257732,-38.31775701,-21.55172414,-47.02702703,-9.401709402,-26.11111111,50.0,-49.45652174,-32.3699422,-46.15384615,-30.43478261,-25.59726962,-16.66666667,-36.64122137,-42.05128205,-33.57664234,39.58333333,-38.88888889,-53.71621622,-36.84210526,-5.714285714,-30.06134969,-52.22222222,-47.15025907,-26.71755725,-19.04761905,-48.31460674,-27.87878788,-25.0,-41.50943396,-53.84615385,-41.31147541,-45.45454545,-40.6779661,-5.511811024,-45.03816794,-44.53125,-7.643312102,-41.63424125,-38.41059603,-34.84848485,-52.42718447,-44.09448819,-21.66666667,-7.96460177,-42.94871795,-49.26829268,-38.98916968,-36.23188406,-47.50957854,-25.0,-19.0,-37.5,5.673758865,-54.5112782,-34.74576271,-57.06521739,73.65269461,-45.02923977,-57.46606335,-33.68421053,-46.63212435,-20.49469965,-42.74193548,-18.53932584,-29.87804878,-36.68224299,23.15789474,-21.05263158,-44.04145078,-18.4,-40.34090909,-54.58515284,-50.43478261,-28.66666667,-34.19354839,-28.26086957,-27.13567839,-34.69387755,-41.07142857,-15.94202899,-37.56906077,-20.87378641,-28.18791946,-49.67741935,-14.28571429,-4.166666667,-32.63888889,-47.43589744,-35.25179856,-9.274193548,-37.22943723,-37.27810651,-43.31550802,-53.76884422,39.2,-34.22222222,-36.12565445,-27.63157895,-57.24137931,-4.812834225,-34.39490446,-43.93063584,-41.8079096,-27.63157895,-0.881057269,-27.81065089,-47.54901961,-24.11764706,-42.65402844,-18.44660194,-46.875,-21.13402062,-16.09195402,-53.0726257,-21.15384615,-36.91460055,-11.6751269,-28.15533981,-36.30136986,-54.72972973,-55.26315789,-25.11627907,-50.81967213,-19.40298507,-40.14084507,-38.75968992,-16.98113208,-25.87064677,-45.80645161,-49.10179641,-21.57894737,-43.72294372,-35.79335793,-14.0,-41.80327869,-41.7218543,-39.9103139,-0.925925926,-40.35087719,-37.73584906,22.22222222,-41.37931034,-37.45704467,-26.74418605,-51.2455516,-43.66197183,-64.0,-50.97402597,-37.69633508,-56.83060109,-38.07106599,2.112676056,-27.83018868,-58.06451613,0.0,-51.47928994,-49.77973568,-47.08994709,-32.88288288,-56.0,-55.96707819,-14.03508772,-4.166666667,-47.71573604,-14.28571429,-40.20100503,-14.65968586,-42.82051282,-67.34693878,-34.63414634,-43.82716049,-58.80149813,-23.01587302,-30.5785124,-24.0,33.57400722,-26.53061224,-23.92638037,-16.23376623,6.611570248,-24.24242424,-4.761904762,-30.26315789,-5.462184874,-31.28205128,-14.20454545,-7.80141844,0.518134715,-34.72803347,-14.72081218,23.97260274,-48.29268293,-13.15789474,-31.00775194,7.692307692,-16.05839416,1.960784314,-15.05791506,-22.56097561,-11.898017,-33.5106383,-11.88811189,-17.71653543,37.890625,-39.75409836,1.041666667,-28.41530055,2.272727273,-34.21052632,-14.79820628,60.69651741,-25.28735632,-13.49693252,-11.25541126,-6.976744186,-17.21311475,-18.43575419,18.69918699,1.754385965,13.3640553,29.47368421,-19.11111111,-2.040816327,-12.40310078,-20.51948052,-5.054151625,5.04587156,-28.71794872,-36.492891,-45.51282051,-20.70707071,-4.8,-20.76923077,-20.0,4.827586207,-21.16788321,-46.11872146,-16.77018634,-39.02439024,-11.33333333,5.833333333,35.16483517,-14.07407407,-40.61302682,-12.17948718,12.0,-24.3902439,-5.34351145,27.6119403,-17.12062257,-26.2295082,-23.15789474,-13.14285714,-46.66666667,5.594405594,-18.90756303,-25.0,-19.16666667,23.61111111,2.673796791,-43.93305439,-40.28776978,-25.90673575,-1.083032491,-5.882352941,-55.34591195,-29.78723404,-22.40437158,-14.87179487,-14.0625,-11.57024793,-29.74358974,-22.37762238,12.65306122,-20.08032129,-15.96244131,-20.83333333,-11.42857143,-25.55555556,2.580645161,0.0,-15.38461538,-13.30472103,-15.55555556,2.702702703,-31.38297872,-9.863945578,-44.0,-12.41830065,-7.865168539,-5.936073059,-21.42857143,-10.63829787,7.751937985,-48.46153846,-21.58273381,16.83168317,-20.99644128,5.660377359,-10.22727273,-24.42396313,-28.09917355,-17.69230769,-31.77083333,-6.796116505,-37.31343284,6.451612903,-22.3880597,-2.586206897,-44.39252336,-11.2,-29.25531915,22.31404959,10.82474227,-27.02702703,-23.21428571,107.9136691,-9.259259259,-12.03007519,8.474576271,-12.01923077,-19.18604651,-0.488997555,-2.631578947,2.380952381,-20.43010753,-23.45679012,-2.259887006,-17.8343949,-21.48760331,81.81818182,-32.5,-15.87301587,-27.27272727,-24.6835443,-9.090909091,-30.68783069,45.07772021,-22.26890756,-9.941520468,-22.68518519,-6.018518519,6.944444444,27.60736196,-25.92592593,-12.06896552,5.714285714,-18.03278689,-27.16981132,-23.22580645,-36.06557377,-7.462686567,12.26993865,-45.99156118,-30.72916667,-5.426356589,-22.77227723,-4.0,2.577319588,-39.23611111,-37.20136519,-13.76146789,-15.38461538,-26.63755459,-41.09090909,-36.51685393,-1.923076923,-31.16883117,2.941176471,24.47552448,-25.55555556,-7.766990291,-25.0,8.333333333,0.46728972,-20.45454545,-25.0,-37.9501385,-23.07692308,16.77852349,-38.97435897,-49.74093264,-27.67857143,-17.71428571,-12.57142857,-27.52808989,-34.66666667,-34.85714286,15.83333333,-46.5408805,16.0,5.625,-17.72727273,-22.4852071,-25.74257426,-21.54696133,-16.66666667,2.158273381,-31.81818182,-26.72413793,-31.89655172,-26.14379085,-53.55805243,10.79545455,-36.92307692,-25.20325203,25.0,-13.22751323,-10.38961039,-15.97633136,-14.13043478,-36.04651163,-6.161137441,0.81300813,-13.25301205,-22.96918768,3.636363636,-34.09090909,-9.202453988,28.93617021,-16.26984127,-26.92307692,-24.77876106,-4.47761194,-11.11111111,-13.0952381,24.50331126,-33.5078534,-37.68115942,-30.34825871,72.95081967,-32.46073298,-20.63492063,-21.63461538,-21.65898618,-10.63829787,-11.11111111,-2.877697842,-24.64454976,-15.96958175,-17.88990826,-12.04819277,-40.84507042,2.158273381,-15.02890173,-11.03448276,17.5,-41.72413793,-58.58208955,-8.368200837,-3.636363636,-7.182320442,-16.81415929,-43.91304348,-13.1147541,-27.39726027,-24.74226804,5.128205128,18.98734177,-27.3255814,-15.07537688,-36.1516035,-32.09876543,-11.23595506,-24.89959839,-58.78378378,-26.80851064,10.74380165,-25.71428571,50.94339623,-28.0,-21.27659574,-37.57225434,-15.7635468,-14.0077821,12.76595745,-34.21052632,-8.148148148,-29.54545455,-19.4092827,-7.731958763,18.78172589,30.47619048,-59.48275862,-58.88888889,-24.45414847,6.818181818,-0.854700855,-32.17054264,-40.33613445,-19.51219512,-29.88047809,-36.0,-39.01639344,-16.78321678,3.529411765,6.857142857,2.877697842,-21.15384615,-26.96629213,-62.5,12.09677419,-2.69058296,-18.51851852,8.914728682,-32.60869565,-21.05263158,1.764705882,-27.56183746,22.30215827,-28.20512821,-10.0,-21.77419355,-17.91044776,29.61373391,-13.17829457,5.142857143,-30.69306931,29.31034483,0.0,-25.12820513,-7.90960452,-19.04761905,-39.67391304,-41.86046512,-9.027777778,-5.263157895,-24.07407407,-17.27272727,-30.5785124,-38.88888889,-8.979591837,18.6440678,-11.62790698,-2.994011976,17.00680272,-6.751054852,25.0965251,-33.5106383,6.578947368,-9.322033898,-3.623188406,-29.13907285,-39.2,-14.92537313,1.818181818,-11.35135135,-10.0591716,-20.18348624,-4.580152672,-39.1025641,-35.0,-26.06837607,-30.85106383,-32.87671233,-14.54545455,-36.02771363,-37.73584906,-27.63157895,74.21875,-0.909090909,-3.278688525,-2.666666667,-19.89528796,-18.95734597,-29.50819672,-32.43243243,-14.92537313,-11.875,-20.35928144,-33.43023256,-4.21686747,-40.69767442,12.21374046,4.929577465,-27.04402516,-39.42857143,-28.87700535,-24.12280702,-37.20930233,-42.85714286,-18.18181818,-27.08333333,-35.21126761,-20.98765432,-34.35114504,-31.13772455,-24.27184466,-24.87046632,-34.54894434,-38.35616438,-37.6344086,-1.807228916,-24.83660131,-23.88059701,-18.24324324,-5.925925926,-23.75,3.10880829,-20.21857923,-43.80952381,-31.09756098,-31.0880829,-27.23404255,-13.15789474,-33.15508021,-37.70491803,-52.99684543,4.385964912,-35.19553073,-8.936170213,62.6984127,-34.46601942,-15.97222222,-31.55080214,-30.46875,7.947019868,-43.69747899,-34.15492958,-34.12462908,-10.16949153,-8.943089431,-42.10526316,-33.83084577,-30.25210084,-39.66480447,39.0625,-3.076923077,-26.25698324,2.479338843,-13.83647799,1.694915254,-25.92592593,-25.61576355,-43.03030303,-19.74248927,-8.637873754,16.07142857,-41.89189189,-24.58100559,-5.494505495,11.88118812,-38.57142857,-39.54248366,-42.9245283,-27.91666667,-64.92146597,-13.77245509,24.07407407,-20.83333333,-28.31050228,-10.66666667,-29.14979757,-27.23735409,-4.968944099,-28.05429864,-16.53543307,-41.14713217,-22.64957265,7.627118644,-13.76146789,0.0,7.236842105,-12.5,-7.784431138,-9.375,-11.53846154,-14.04958678,-52.88461538,-16.80672269,-27.21893491,-19.00826446,-12.99435028,0.0,-14.43661972,-23.1292517,-10.16949153,-54.44444444,-17.3553719,-10.1910828,-10.1910828,24.41860465,18.24817518,-25.49019608,-26.62337662,20.68965517,-46.32034632,-35.71428571,-30.65326633,15.0,-23.6453202,-16.37931034,-7.692307692,0.961538462,-11.85185185,-10.38961039,-32.85714286,-6.617647059,-49.36708861,-15.49295775,-32.31132075,-12.68292683,-24.8447205,-38.46153846,-27.38095238,-24.03433476,-10.91954023,-19.1011236,-24.33628319,-45.12195122,-1.578947368,-3.846153846,-28.40909091,20.53571429,-2.564102564,-20.0,-9.239130435,-20.80924855,-27.87878788,-11.17318436,-43.51851852,-50.0,-30.88235294,-8.333333333,-25.24271845,-11.9760479,3.636363636,-27.94759825,-35.20408163,-38.55932203,-10.86956522,-40.4494382,-21.53846154,-40.65420561,-28.63436123,-23.90852391,-29.09090909,-5.681818182,-6.474820144,-44.97607656,-37.71186441,0.909090909,-16.66666667,-18.84057971,2.777777778,-13.43283582,23.125,-12.55813953
p3/preprocess/LDL_Cholesterol_Levels/code/GSE111567.py ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "LDL_Cholesterol_Levels"
6
+ cohort = "GSE111567"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/LDL_Cholesterol_Levels"
10
+ in_cohort_dir = "../DATA/GEO/LDL_Cholesterol_Levels/GSE111567"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/GSE111567.csv"
14
+ out_gene_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/gene_data/GSE111567.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/clinical_data/GSE111567.csv"
16
+ json_path = "./output/preprocess/3/LDL_Cholesterol_Levels/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the background info mentioning HumanHT-12 v4 microarray and gene expression analysis,
34
+ # this dataset contains gene expression data
35
+ is_gene_available = True
36
+
37
+ # 2. Variable Availability and Data Type Conversion
38
+
39
+ # Trait (LDL cholesterol) is not directly available in clinical features
40
+ trait_row = None
41
+
42
+ # Age is not available in clinical features
43
+ age_row = None
44
+
45
+ # Gender is available at index 0
46
+ gender_row = 0
47
+
48
+ def convert_gender(x):
49
+ if x is None:
50
+ return None
51
+ value = x.split(': ')[1].strip()
52
+ if value.upper() == 'F':
53
+ return 0
54
+ elif value.upper() == 'M':
55
+ return 1
56
+ return None
57
+
58
+ # Convert functions for completeness though trait and age not available
59
+ def convert_trait(x):
60
+ return None
61
+
62
+ def convert_age(x):
63
+ return None
64
+
65
+ # 3. Save Metadata
66
+ # Perform initial filtering and save cohort info
67
+ validate_and_save_cohort_info(
68
+ is_final=False,
69
+ cohort=cohort,
70
+ info_path=json_path,
71
+ is_gene_available=is_gene_available,
72
+ is_trait_available=trait_row is not None
73
+ )
74
+
75
+ # 4. Clinical Feature Extraction
76
+ # Skip since trait_row is None, indicating clinical data is not usable for our purpose
77
+ # Extract gene expression data from matrix file
78
+ genetic_data = get_genetic_data(matrix_file)
79
+
80
+ # Print first 20 row IDs
81
+ print("First 20 gene/probe IDs:")
82
+ print(genetic_data.index[:20].tolist())
83
+ # These are Illumina probe IDs, not standard human gene symbols
84
+ # They need to be mapped to official HGNC gene symbols for analysis
85
+ requires_gene_mapping = True
86
+ # Extract gene annotation from SOFT file
87
+ gene_annotation = get_gene_annotation(soft_file)
88
+
89
+ # Preview column names and first few values
90
+ print("Gene Annotation Preview:")
91
+ print(preview_df(gene_annotation))
92
+ # 1. Observe gene identifiers:
93
+ # Gene expression data uses 'ILMN_' probe IDs, which match the 'ID' column in annotation
94
+ # Gene symbols are in the 'Symbol' column of annotation
95
+
96
+ # 2. Extract mapping between probe IDs and gene symbols
97
+ mapping_data = get_gene_mapping(gene_annotation, 'ID', 'Symbol')
98
+
99
+ # 3. Apply gene mapping to convert probe-level data to gene expression data
100
+ gene_data = apply_gene_mapping(genetic_data, mapping_data)
101
+ # 1. Normalize gene symbols and save gene data
102
+ gene_data = normalize_gene_symbols_in_index(gene_data)
103
+ gene_data.to_csv(out_gene_data_file)
104
+
105
+ # Create a minimal dataframe for validation purposes
106
+ df_for_validation = pd.DataFrame(index=gene_data.index)
107
+ df_for_validation[trait] = None # Add trait column with all missing values
108
+
109
+ note = "The dataset contains gene expression data from peripheral blood mononuclear cells measured with HumanHT-12 v4 microarray but lacks LDL cholesterol level measurements."
110
+
111
+ is_usable = validate_and_save_cohort_info(
112
+ is_final=True,
113
+ cohort=cohort,
114
+ info_path=json_path,
115
+ is_gene_available=is_gene_available,
116
+ is_trait_available=False,
117
+ is_biased=True, # Missing trait data is considered extreme bias
118
+ df=df_for_validation,
119
+ note=note
120
+ )
p3/preprocess/LDL_Cholesterol_Levels/code/GSE181339.py ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "LDL_Cholesterol_Levels"
6
+ cohort = "GSE181339"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/LDL_Cholesterol_Levels"
10
+ in_cohort_dir = "../DATA/GEO/LDL_Cholesterol_Levels/GSE181339"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/GSE181339.csv"
14
+ out_gene_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/gene_data/GSE181339.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/clinical_data/GSE181339.csv"
16
+ json_path = "./output/preprocess/3/LDL_Cholesterol_Levels/cohort_info.json"
17
+
18
+ # Get paths for relevant files
19
+ soft_path, matrix_path = 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_path)
23
+
24
+ # Get unique values for each clinical feature
25
+ sample_chars = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print dataset background information
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features Overview:")
31
+ print(json.dumps(sample_chars, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Yes - the background information mentions RNA extraction, microarray experiments
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # LDL levels can be inferred from group (MONW has high LDL)
38
+ trait_row = 1
39
+ # Age data appears to be sample IDs rather than actual ages
40
+ age_row = None
41
+ # Gender data is available in row 0
42
+ gender_row = 0
43
+
44
+ # 2.2 Data Type Conversion Functions
45
+ def convert_trait(x):
46
+ if not isinstance(x, str):
47
+ return None
48
+ # Extract value after colon
49
+ x = x.split(': ')[-1].strip()
50
+ # MONW group has high LDL, other groups have normal LDL
51
+ if x == 'MONW':
52
+ return 1
53
+ elif x in ['NW', 'OW/OB']:
54
+ return 0
55
+ return None
56
+
57
+ def convert_age(x):
58
+ # Not used since age data unreliable
59
+ return None
60
+
61
+ def convert_gender(x):
62
+ if not isinstance(x, str):
63
+ return None
64
+ x = x.split(': ')[-1].strip()
65
+ if x.lower() == 'woman':
66
+ return 0
67
+ elif x.lower() == 'man':
68
+ return 1
69
+ return None
70
+
71
+ # 3. Save Metadata
72
+ validate_and_save_cohort_info(is_final=False,
73
+ cohort=cohort,
74
+ info_path=json_path,
75
+ is_gene_available=is_gene_available,
76
+ is_trait_available=trait_row is not None)
77
+
78
+ # 4. Clinical Feature Extraction
79
+ if trait_row is not None:
80
+ selected_clinical_df = geo_select_clinical_features(
81
+ clinical_df=clinical_data,
82
+ trait=trait,
83
+ trait_row=trait_row,
84
+ convert_trait=convert_trait,
85
+ age_row=age_row,
86
+ convert_age=convert_age,
87
+ gender_row=gender_row,
88
+ convert_gender=convert_gender
89
+ )
90
+
91
+ # Preview data
92
+ print("Preview of selected clinical features:")
93
+ print(preview_df(selected_clinical_df))
94
+
95
+ # Save clinical data
96
+ selected_clinical_df.to_csv(out_clinical_data_file)
97
+ # Get gene expression data
98
+ genetic_data = get_genetic_data(matrix_path)
99
+
100
+ # Preview raw data structure
101
+ print("First few rows of the raw data:")
102
+ print(genetic_data.head())
103
+
104
+ print("\nShape of the data:")
105
+ print(genetic_data.shape)
106
+
107
+ # Print first 20 row IDs to verify data structure
108
+ print("\nFirst 20 probe/gene identifiers:")
109
+ print(list(genetic_data.index)[:20])
110
+ # From the pattern of gene identifiers being simple numbers like '7', '8', '15', etc.
111
+ # These appear to be probe IDs rather than human gene symbols and will need to be mapped
112
+ requires_gene_mapping = True
113
+ # Extract gene annotation data from SOFT file
114
+ gene_metadata = get_gene_annotation(soft_path)
115
+
116
+ # Preview annotation data structure
117
+ print("Gene annotation data preview:")
118
+ print(preview_df(gene_metadata))
119
+ # Get mapping between gene IDs and gene symbols
120
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='GENE_SYMBOL')
121
+
122
+ # Apply mapping to convert probe-level data to gene expression data
123
+ gene_data = apply_gene_mapping(genetic_data, mapping_df)
124
+
125
+ # Preview gene data
126
+ print("\nFirst few rows of gene expression data:")
127
+ print(gene_data.head())
128
+ print("\nShape of gene data:")
129
+ print(gene_data.shape)
130
+ # 1. Normalize gene symbols
131
+ gene_data = normalize_gene_symbols_in_index(gene_data)
132
+ gene_data.to_csv(out_gene_data_file)
133
+
134
+ # 2. Link clinical and genetic data
135
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, gene_data)
136
+
137
+ # 3. Handle missing values
138
+ linked_data = handle_missing_values(linked_data, trait)
139
+
140
+ # 4. Check for biased features and remove biased demographic ones
141
+ # The function will print detailed distribution information
142
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
143
+
144
+ # 5. Validate and save metadata about dataset quality
145
+ # The validation is affected by if the trait is biased, if the data has been filtered out, etc.
146
+ note = "This dataset compares gene expression between matched tumor and non-tumor kidney tissue samples."
147
+ is_usable = validate_and_save_cohort_info(is_final=True, cohort=cohort, info_path=json_path,
148
+ is_gene_available=True, is_trait_available=True,
149
+ is_biased=trait_biased, df=linked_data, note=note)
150
+
151
+ # 6. Save linked data if usable
152
+ if is_usable:
153
+ linked_data.to_csv(out_data_file)
p3/preprocess/LDL_Cholesterol_Levels/code/GSE28893.py ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "LDL_Cholesterol_Levels"
6
+ cohort = "GSE28893"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/LDL_Cholesterol_Levels"
10
+ in_cohort_dir = "../DATA/GEO/LDL_Cholesterol_Levels/GSE28893"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/GSE28893.csv"
14
+ out_gene_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/gene_data/GSE28893.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/clinical_data/GSE28893.csv"
16
+ json_path = "./output/preprocess/3/LDL_Cholesterol_Levels/cohort_info.json"
17
+
18
+ # Get paths for relevant files
19
+ soft_path, matrix_path = 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_path)
23
+
24
+ # Get unique values for each clinical feature
25
+ sample_chars = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print dataset background information
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features Overview:")
31
+ print(json.dumps(sample_chars, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # The dataset is from Illumina Expression Array and is about gene expression in liver tissue
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # From background info, this study includes eQTLs related to LDL cholesterol levels
38
+ # But trait values are not directly available in sample characteristics
39
+ trait_row = None
40
+
41
+ # Age data is available in row 1
42
+ age_row = 1
43
+
44
+ # Gender data is available in row 2
45
+ gender_row = 2
46
+
47
+ # 2.2 Data Type Conversion Functions
48
+ def convert_trait(x):
49
+ # Not needed since trait data is not available
50
+ return None
51
+
52
+ def convert_age(x):
53
+ try:
54
+ # Extract number after colon
55
+ age = int(x.split(': ')[1])
56
+ return age
57
+ except:
58
+ return None
59
+
60
+ def convert_gender(x):
61
+ try:
62
+ # Extract value after colon and convert to binary
63
+ gender = x.split(': ')[1]
64
+ if gender == 'F':
65
+ return 0
66
+ elif gender == 'M':
67
+ return 1
68
+ return None
69
+ except:
70
+ return None
71
+
72
+ # 3. Save metadata - initial filtering
73
+ 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=False
79
+ )
80
+
81
+ # 4. Skip clinical feature extraction since trait_row is None
82
+ # Get gene expression data
83
+ genetic_data = get_genetic_data(matrix_path)
84
+
85
+ # Preview raw data structure
86
+ print("First few rows of the raw data:")
87
+ print(genetic_data.head())
88
+
89
+ print("\nShape of the data:")
90
+ print(genetic_data.shape)
91
+
92
+ # Print first 20 row IDs to verify data structure
93
+ print("\nFirst 20 probe/gene identifiers:")
94
+ print(list(genetic_data.index)[:20])
95
+ # These IDs start with "ILMN_" which indicates they are Illumina probe IDs, not gene symbols
96
+ requires_gene_mapping = True
97
+ # Extract gene annotation data from SOFT file
98
+ gene_metadata = get_gene_annotation(soft_path)
99
+
100
+ # Preview annotation data structure
101
+ print("Gene annotation data preview:")
102
+ print(preview_df(gene_metadata))
103
+ # 1. 'ID' column in metadata matches ILMN probe IDs in expression data
104
+ # 'Symbol' column contains the gene symbols
105
+
106
+ # 2. Get gene mapping data
107
+ mapping_data = get_gene_mapping(gene_metadata, "ID", "Symbol")
108
+
109
+ # 3. Convert probe-level measurements to gene-level expression
110
+ gene_data = apply_gene_mapping(genetic_data, mapping_data)
111
+
112
+ # Preview result
113
+ print("Gene expression data preview:")
114
+ print(gene_data.head())
115
+ print("\nShape after mapping:", gene_data.shape)
116
+ # 1. Normalize gene symbols
117
+ gene_data = normalize_gene_symbols_in_index(gene_data)
118
+ gene_data.to_csv(out_gene_data_file)
119
+
120
+ # Since we previously determined trait data is not available (trait_row = None),
121
+ # we cannot proceed with data linking and quality assessment
122
+ # We need to validate this cohort as not usable
123
+ note = "The dataset contains gene expression data but lacks LDL cholesterol level measurements"
124
+ is_usable = validate_and_save_cohort_info(
125
+ is_final=False, # Use initial filtering since we can't do final validation
126
+ cohort=cohort,
127
+ info_path=json_path,
128
+ is_gene_available=True,
129
+ is_trait_available=False
130
+ )
p3/preprocess/LDL_Cholesterol_Levels/code/GSE34945.py ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "LDL_Cholesterol_Levels"
6
+ cohort = "GSE34945"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/LDL_Cholesterol_Levels"
10
+ in_cohort_dir = "../DATA/GEO/LDL_Cholesterol_Levels/GSE34945"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/GSE34945.csv"
14
+ out_gene_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/gene_data/GSE34945.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/clinical_data/GSE34945.csv"
16
+ json_path = "./output/preprocess/3/LDL_Cholesterol_Levels/cohort_info.json"
17
+
18
+ # Get paths for relevant files
19
+ soft_path, matrix_path = 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_path)
23
+
24
+ # Get unique values for each clinical feature
25
+ sample_chars = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print dataset background information
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features Overview:")
31
+ print(json.dumps(sample_chars, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the background information, this study is about SNPs genotyping, not gene expression
34
+ is_gene_available = False
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # 2.1 Data Availability
38
+ # LDL levels not directly given, check changed in apoc3 levels as proxy
39
+ trait_row = 2
40
+ # Age and gender not available in characteristics
41
+ age_row = None
42
+ gender_row = None
43
+
44
+ # 2.2 Data Type Conversion Functions
45
+ def convert_trait(x):
46
+ # Extract numeric value after colon
47
+ if isinstance(x, str) and "percent change in apoc3 levels:" in x:
48
+ try:
49
+ return float(x.split(":")[1].strip())
50
+ except:
51
+ return None
52
+ return None
53
+
54
+ def convert_age(x):
55
+ return None # Not available
56
+
57
+ def convert_gender(x):
58
+ return None # Not available
59
+
60
+ # 3. Save Initial Metadata
61
+ # Trait data is available since trait_row is not None
62
+ is_trait_available = True if trait_row is not None else False
63
+ validate_and_save_cohort_info(is_final=False, cohort=cohort, info_path=json_path,
64
+ is_gene_available=is_gene_available,
65
+ is_trait_available=is_trait_available)
66
+
67
+ # 4. Clinical Feature Extraction
68
+ # Since trait_row is not None, extract clinical features
69
+ if trait_row is not None:
70
+ selected_clinical_df = geo_select_clinical_features(
71
+ clinical_df=clinical_data,
72
+ trait=trait,
73
+ trait_row=trait_row,
74
+ convert_trait=convert_trait,
75
+ age_row=age_row,
76
+ convert_age=convert_age,
77
+ gender_row=gender_row,
78
+ convert_gender=convert_gender
79
+ )
80
+
81
+ # Preview the data
82
+ preview = preview_df(selected_clinical_df)
83
+ print("Preview of selected clinical features:")
84
+ print(preview)
85
+
86
+ # Save to CSV
87
+ selected_clinical_df.to_csv(out_clinical_data_file)
p3/preprocess/LDL_Cholesterol_Levels/code/TCGA.py ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "LDL_Cholesterol_Levels"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/3/LDL_Cholesterol_Levels/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/3/LDL_Cholesterol_Levels/cohort_info.json"
15
+
16
+ # Cannot proceed with column identification without first having access to
17
+ # the column names from the previous step's output
18
+
19
+ # For now, define empty candidates
20
+ candidate_age_cols = []
21
+ candidate_gender_cols = []
22
+
23
+ preview_dict = {}
24
+ preview_dict
25
+ # 1. From the subdirectories list, none contain terms directly related to LDL cholesterol or lipid levels
26
+ # Therefore, we need to examine a proxy tissue/condition most related to cholesterol metabolism
27
+ # The liver is the primary organ for cholesterol metabolism, so we'll use liver cancer data
28
+ cohort_dir = os.path.join(tcga_root_dir, 'TCGA_Liver_Cancer_(LIHC)')
29
+
30
+ # 2. Get the clinical and genetic data file paths
31
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
32
+
33
+ # 3. Load the data files
34
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
35
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
36
+
37
+ # 4. Print clinical data columns
38
+ print("Clinical data columns:")
39
+ print(clinical_df.columns.tolist())
40
+ # Define candidate columns
41
+ candidate_age_cols = ['age_at_initial_pathologic_diagnosis', 'days_to_birth', 'year_of_initial_pathologic_diagnosis']
42
+ candidate_gender_cols = ['gender']
43
+
44
+ # Use LIHC (Liver Cancer) data
45
+ cohort_dir = os.path.join(tcga_root_dir, "TCGA_Liver_Cancer_(LIHC)")
46
+
47
+ # Get clinical data path
48
+ clinical_file_path, _ = tcga_get_relevant_filepaths(cohort_dir)
49
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0)
50
+
51
+ # Preview age columns
52
+ age_preview = {}
53
+ for col in candidate_age_cols:
54
+ if col in clinical_df.columns:
55
+ age_preview[col] = clinical_df[col].head(5).tolist()
56
+ print("Age columns preview:", age_preview)
57
+
58
+ # Preview gender columns
59
+ gender_preview = {}
60
+ for col in candidate_gender_cols:
61
+ if col in clinical_df.columns:
62
+ gender_preview[col] = clinical_df[col].head(5).tolist()
63
+ print("\nGender columns preview:", gender_preview)
64
+ # Information from previous step
65
+ # Dictionaries containing sample values from candidate columns
66
+ age_candidates = {'age_at_initial_pathologic_diagnosis': [63, 53, 69, 65, 59], 'age_began_smoking_in_years': ['[Not Applicable]', '[Not Available]', '[Not Available]', '[Not Available]', '[Not Applicable]']}
67
+ gender_candidates = {'gender': ['FEMALE', 'FEMALE', 'FEMALE', 'MALE', 'MALE']}
68
+
69
+ # Select age column - choose 'age_at_initial_pathologic_diagnosis' as it has valid numeric values
70
+ age_col = 'age_at_initial_pathologic_diagnosis' if 'age_at_initial_pathologic_diagnosis' in age_candidates and all(isinstance(x, (int, float)) for x in age_candidates['age_at_initial_pathologic_diagnosis']) else None
71
+
72
+ # Select gender column - choose 'gender' if it contains valid gender values
73
+ gender_col = 'gender' if 'gender' in gender_candidates and all(isinstance(x, str) and x.upper() in ['MALE', 'FEMALE'] for x in gender_candidates['gender']) else None
74
+
75
+ # Print chosen columns
76
+ print(f"Selected age column: {age_col}")
77
+ print(f"Selected gender column: {gender_col}")
78
+ # 1. Extract and standardize clinical features
79
+ # First reload data with correct separator
80
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
81
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
82
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
83
+
84
+ # Use days_to_birth as a source for age calculation since LDL is a continuous trait
85
+ age_values = (-clinical_df['days_to_birth']/365).round()
86
+ age_values = age_values.fillna(age_values.mean()).astype(int)
87
+ clinical_df['age_at_initial_pathologic_diagnosis'] = age_values
88
+
89
+ selected_clinical_df = tcga_select_clinical_features(clinical_df, trait, age_col=age_col, gender_col=gender_col)
90
+
91
+ # 2. Normalize gene symbols
92
+ normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
93
+
94
+ # Save normalized gene data
95
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
96
+ normalized_gene_df.to_csv(out_gene_data_file)
97
+
98
+ # 3. Link clinical and genetic data
99
+ linked_data = pd.concat([selected_clinical_df, normalized_gene_df.T], axis=1)
100
+
101
+ # 4. Handle missing values
102
+ linked_data = handle_missing_values(linked_data, trait)
103
+
104
+ # 5. Check for biased features and remove biased demographic features
105
+ is_trait_biased, cleaned_data = judge_and_remove_biased_features(linked_data, trait)
106
+
107
+ # 6. Validate data quality and save cohort info
108
+ note = "Data from TCGA Liver Cancer cohort used as proxy for LDL cholesterol studies due to liver's role in cholesterol metabolism. Age was calculated from days_to_birth for more accurate values."
109
+ is_usable = validate_and_save_cohort_info(
110
+ is_final=True,
111
+ cohort="TCGA_LIHC",
112
+ info_path=json_path,
113
+ is_gene_available=True,
114
+ is_trait_available=True,
115
+ is_biased=is_trait_biased,
116
+ df=cleaned_data,
117
+ note=note
118
+ )
119
+
120
+ # 7. Save linked data if usable
121
+ if is_usable:
122
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
123
+ cleaned_data.to_csv(out_data_file)
124
+ print(f"Data saved to {out_data_file}")
125
+ else:
126
+ print("Data quality validation failed. Dataset not saved.")
127
+ # 1. Extract and standardize clinical features
128
+ # First reload data with correct separator
129
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
130
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
131
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
132
+
133
+ # Define demographic columns based on inspection from previous steps
134
+ age_col = 'age_at_initial_pathologic_diagnosis'
135
+ gender_col = 'gender'
136
+
137
+ # Calculate age from days_to_birth for more accuracy
138
+ age_values = (-clinical_df['days_to_birth']/365).round()
139
+ age_values = age_values.fillna(age_values.mean()).astype(int)
140
+ clinical_df[age_col] = age_values
141
+
142
+ selected_clinical_df = tcga_select_clinical_features(clinical_df, trait, age_col=age_col, gender_col=gender_col)
143
+
144
+ # 2. Normalize gene symbols
145
+ normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
146
+
147
+ # Save normalized gene data
148
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
149
+ normalized_gene_df.to_csv(out_gene_data_file)
150
+
151
+ # 3. Link clinical and genetic data
152
+ linked_data = pd.concat([selected_clinical_df, normalized_gene_df.T], axis=1)
153
+
154
+ # 4. Handle missing values
155
+ linked_data = handle_missing_values(linked_data, trait)
156
+
157
+ # 5. Check for biased features and remove biased demographic features
158
+ is_trait_biased, cleaned_data = judge_and_remove_biased_features(linked_data, trait)
159
+
160
+ # 6. Validate data quality and save cohort info
161
+ note = "Data from TCGA Liver Cancer cohort used as proxy for LDL cholesterol studies due to liver's role in cholesterol metabolism. Age was calculated from days_to_birth for more accurate values."
162
+ is_usable = validate_and_save_cohort_info(
163
+ is_final=True,
164
+ cohort="TCGA_LIHC",
165
+ info_path=json_path,
166
+ is_gene_available=True,
167
+ is_trait_available=True,
168
+ is_biased=is_trait_biased,
169
+ df=cleaned_data,
170
+ note=note
171
+ )
172
+
173
+ # 7. Save linked data if usable
174
+ if is_usable:
175
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
176
+ cleaned_data.to_csv(out_data_file)
177
+ print(f"Data saved to {out_data_file}")
178
+ else:
179
+ print("Data quality validation failed. Dataset not saved.")
p3/preprocess/LDL_Cholesterol_Levels/cohort_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"GSE34945": {"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}, "GSE28893": {"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": null}, "GSE181339": {"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": 78, "note": "This dataset compares gene expression between matched tumor and non-tumor kidney tissue samples."}, "GSE111567": {"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": "The dataset contains gene expression data from peripheral blood mononuclear cells measured with HumanHT-12 v4 microarray but lacks LDL cholesterol level measurements."}, "TCGA_LIHC": {"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": 423, "note": "Data from TCGA Liver Cancer cohort used as proxy for LDL cholesterol studies due to liver's role in cholesterol metabolism. Age was calculated from days_to_birth for more accurate values."}}
p3/preprocess/LDL_Cholesterol_Levels/gene_data/GSE111567.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/LDL_Cholesterol_Levels/gene_data/GSE181339.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Lactose_Intolerance/gene_data/GSE136395.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0fd96598f01e366804a694b9d555a3fe95b572a62c9f392195c02211f16cd00
3
+ size 54636027
p3/preprocess/Lactose_Intolerance/gene_data/GSE138297.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de9565415a246beb680e5ba05e15de50eccfec4d24f558d0cba022302313ca04
3
+ size 15408302
p3/preprocess/Large_B-cell_Lymphoma/GSE243973.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE114022.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM3130825,GSM3130826,GSM3130827,GSM3130828,GSM3130829,GSM3130830,GSM3130831,GSM3130832,GSM3130833,GSM3130834,GSM3130835,GSM3130836,GSM3130837,GSM3130838,GSM3130839,GSM3130840,GSM3130841,GSM3130842,GSM3130843,GSM3130844,GSM3130845,GSM3130846,GSM3130847,GSM3130848,GSM3130849,GSM3130850,GSM3130851,GSM3130852,GSM3130853,GSM3130854
2
+ Large_B-cell_Lymphoma,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,,,,1.0,1.0,1.0,0.0,0.0,0.0,,,,1.0,1.0,1.0,0.0,0.0,0.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE142494.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM4230397,GSM4230398,GSM4230399,GSM4230400,GSM4230401,GSM4230402,GSM4230403,GSM4230404,GSM4230405,GSM4230406,GSM4230407,GSM4230408,GSM4230409,GSM4230410,GSM4230411,GSM4230412,GSM4230413,GSM4230414,GSM4230415,GSM4230416,GSM4230417,GSM4230418,GSM4230419,GSM4230420,GSM4230421,GSM4230422,GSM4230423,GSM4230424,GSM4230425,GSM4230426,GSM4230427,GSM4230428,GSM4230429,GSM4230430,GSM4230431,GSM4230432,GSM4230433,GSM4230434,GSM4230435,GSM4230436,GSM4230437,GSM4230438,GSM4230439,GSM4230440,GSM4230441,GSM4230442,GSM4230443,GSM4230444,GSM4230445,GSM4230446,GSM4230447,GSM4230448,GSM4230449,GSM4230450,GSM4230451,GSM4230452,GSM4230453,GSM4230454,GSM4230455,GSM4230456,GSM4230457,GSM4230458,GSM4230459
2
+ Large_B-cell_Lymphoma,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE145848.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM4337662,GSM4337663,GSM4337664,GSM4337665,GSM4337666,GSM4337667,GSM4337668,GSM4337669,GSM4337670,GSM4337671,GSM4337672,GSM4337673,GSM4337674,GSM4337675,GSM4337676,GSM4337677,GSM4337678,GSM4337679,GSM4337680,GSM4337681,GSM4337682,GSM4337683,GSM4337684,GSM4337685,GSM4337686,GSM4337687,GSM4337688
2
+ Large_B-cell_Lymphoma,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,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE156309.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ,GSM4728797,GSM4728798,GSM4728799,GSM4728800,GSM4728801,GSM4728802,GSM4728803,GSM4728804,GSM4728805,GSM4728806,GSM4728807,GSM4728808,GSM4728809,GSM4728810,GSM4728811,GSM4728812,GSM4728813,GSM4728814,GSM4728815,GSM4728816,GSM4728817,GSM4728818,GSM4728819,GSM4728820,GSM4728821,GSM4728822,GSM4728823,GSM4728824,GSM4728825,GSM4728826,GSM4728827,GSM4728828,GSM4728829,GSM4728830,GSM4728831,GSM4728832,GSM4728833,GSM4728834,GSM4728835,GSM4728836,GSM4728837,GSM4728838,GSM4728839,GSM4728840,GSM4728841,GSM4728842,GSM4728843,GSM4728844,GSM4728845,GSM4728846,GSM4728847,GSM4728848,GSM4728849,GSM4728850,GSM4728851,GSM4728852,GSM4728853,GSM4728854,GSM4728855,GSM4728856,GSM4728857
2
+ Large_B-cell_Lymphoma,0.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.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,0.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
3
+ Age,37.0,32.0,35.0,38.0,26.0,65.0,35.0,36.0,58.0,19.0,26.0,38.0,57.0,55.0,36.0,51.0,38.0,30.0,56.0,29.0,54.0,38.0,54.0,27.0,51.0,53.0,39.0,60.0,33.0,26.0,39.0,57.0,47.0,34.0,29.0,58.0,55.0,36.0,54.0,45.0,35.0,60.0,31.0,60.0,26.0,34.0,57.0,38.0,59.0,54.0,39.0,37.0,57.0,38.0,29.0,55.0,25.0,59.0,23.0,52.0,60.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE159472.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM4830213,GSM4830214,GSM4830215,GSM4830216,GSM4830217,GSM4830218,GSM4830219,GSM4830220,GSM4830221,GSM4830222,GSM4830223,GSM4830224,GSM4830225,GSM4830226,GSM4830227,GSM4830228,GSM4830229,GSM4830230,GSM4830231,GSM4830232,GSM4830233,GSM4830234,GSM4830235,GSM4830236,GSM4830237,GSM4830238,GSM4830239,GSM4830240,GSM4830241,GSM4830242,GSM4830243,GSM4830244,GSM4830245,GSM4830246,GSM4830247,GSM4830248,GSM4830249,GSM4830250,GSM4830251,GSM4830252,GSM4830253,GSM4830254,GSM4830255,GSM4830256,GSM4830257,GSM4830258,GSM4830259,GSM4830260,GSM4830261,GSM4830262,GSM4830263,GSM4830264,GSM4830265,GSM4830266,GSM4830267,GSM4830268,GSM4830269,GSM4830270,GSM4830271,GSM4830272,GSM4830273,GSM4830274,GSM4830275,GSM4830276,GSM4830277,GSM4830278,GSM4830279,GSM4830280,GSM4830281,GSM4830282,GSM4830283,GSM4830284,GSM4830285,GSM4830286,GSM4830287,GSM4830288,GSM4830289,GSM4830290,GSM4830291,GSM4830292,GSM4830293,GSM4830294,GSM4830295,GSM4830296,GSM4830297,GSM4830298,GSM4830299,GSM4830300,GSM4830301,GSM4830302,GSM4830303,GSM4830304,GSM4830305,GSM4830306,GSM4830307,GSM4830308,GSM4830309,GSM4830310,GSM4830311,GSM4830312,GSM4830313,GSM4830314,GSM4830315,GSM4830316,GSM4830317,GSM4830318,GSM4830319,GSM4830320,GSM4830321,GSM4830322,GSM4830323,GSM4830324,GSM4830325,GSM4830326,GSM4830327,GSM4830328,GSM4830329,GSM4830330,GSM4830331,GSM4830332,GSM4830333,GSM4830334,GSM4830335,GSM4830336,GSM4830337,GSM4830338,GSM4830339,GSM4830340,GSM4830341,GSM4830342,GSM4830343,GSM4830344,GSM4830345,GSM4830346,GSM4830347,GSM4830348,GSM4830349,GSM4830350,GSM4830351,GSM4830352,GSM4830353,GSM4830354,GSM4830355,GSM4830356,GSM4830357,GSM4830358,GSM4830359,GSM4830360,GSM4830361,GSM4830362,GSM4830363,GSM4830364,GSM4830365,GSM4830366,GSM4830367,GSM4830368,GSM4830369,GSM4830370,GSM4830371,GSM4830372,GSM4830373,GSM4830374,GSM4830375,GSM4830376,GSM4830377,GSM4830378,GSM4830379,GSM4830380,GSM4830381,GSM4830382,GSM4830383,GSM4830384,GSM4830385,GSM4830386,GSM4830387,GSM4830388,GSM4830389,GSM4830390,GSM4830391,GSM4830392
2
+ Large_B-cell_Lymphoma,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.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,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,0.0,1.0,0.0,0.0,0.0,0.0,1.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,1.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,1.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.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,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,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,0.0,0.0,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,1.0,0.0,0.0,1.0,0.0,1.0,0.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE173263.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM5264464,GSM5264465,GSM5264466,GSM5264467,GSM5264468,GSM5264469,GSM5264470,GSM5264471,GSM5264472,GSM5264473,GSM5264474,GSM5264475,GSM5264476,GSM5264477,GSM5264478,GSM5264479,GSM5264480,GSM5264481,GSM5264482,GSM5264483,GSM5264484,GSM5264485,GSM5264486,GSM5264487,GSM5264488,GSM5264489,GSM5264490,GSM5264491,GSM5264492,GSM5264493,GSM5264494,GSM5264495,GSM5264496,GSM5264497,GSM5264498,GSM5264499,GSM5264500,GSM5264501,GSM5264502
2
+ Large_B-cell_Lymphoma,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE197977.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM5935018,GSM5935019,GSM5935020,GSM5935021,GSM5935022,GSM5935023,GSM5935024,GSM5935025,GSM5935026,GSM5935027,GSM5935028,GSM5935029,GSM5935030,GSM5935031,GSM5935032,GSM5935033,GSM5935034,GSM5935035,GSM5935036,GSM5935037,GSM5935038,GSM5935039,GSM5935040,GSM5935041,GSM5935042,GSM5935043,GSM5935044,GSM5935045,GSM5935046,GSM5935047,GSM5935048,GSM5935049,GSM5935050,GSM5935051,GSM5935052,GSM5935053,GSM5935054,GSM5935055,GSM5935056,GSM5935057,GSM5935058,GSM5935059,GSM5935060,GSM5935061,GSM5935062,GSM5935063,GSM5935064,GSM5935065,GSM5935066,GSM5935067,GSM5935068,GSM5935069,GSM5935070,GSM5935071,GSM5935072,GSM5935073,GSM5935074,GSM5935075,GSM5935076,GSM5935077,GSM5935078,GSM5935079,GSM5935080,GSM5935081,GSM5935082,GSM5935083,GSM5935084,GSM5935085,GSM5935086,GSM5935087,GSM5935088,GSM5935089,GSM5935090,GSM5935091
2
+ Large_B-cell_Lymphoma,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE243973.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM7802550,GSM7802551,GSM7802552,GSM7802553,GSM7802554,GSM7802555,GSM7802556,GSM7802557,GSM7802558,GSM7802559,GSM7802560,GSM7802561,GSM7802562,GSM7802563,GSM7802564,GSM7802565,GSM7802566,GSM7802567,GSM7802568,GSM7802569,GSM7802570,GSM7802571,GSM7802572,GSM7802573,GSM7802574,GSM7802575,GSM7802576,GSM7802577,GSM7802578,GSM7802579,GSM7802580,GSM7802581,GSM7802582,GSM7802583,GSM7802584,GSM7802585,GSM7802586,GSM7802587,GSM7802588,GSM7802589,GSM7802590,GSM7802591,GSM7802592,GSM7802593,GSM7802594,GSM7802595,GSM7802596,GSM7802597,GSM7802598,GSM7802599,GSM7802600,GSM7802601,GSM7802602,GSM7802603,GSM7802604,GSM7802605,GSM7802606,GSM7802607,GSM7802608,GSM7802609,GSM7802610,GSM7802611,GSM7802612,GSM7802613,GSM7802614,GSM7802615,GSM7802616,GSM7802617,GSM7802618,GSM7802619,GSM7802620,GSM7802621,GSM7802622,GSM7802623,GSM7802624,GSM7802625,GSM7802626,GSM7802627,GSM7802628,GSM7802629,GSM7802630,GSM7802631,GSM7802632,GSM7802633,GSM7802634
2
+ Large_B-cell_Lymphoma,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Large_B-cell_Lymphoma/clinical_data/GSE248835.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM7920866,GSM7920867,GSM7920868,GSM7920869,GSM7920870,GSM7920871,GSM7920872,GSM7920873,GSM7920874,GSM7920875,GSM7920876,GSM7920877,GSM7920878,GSM7920879,GSM7920880,GSM7920881,GSM7920882,GSM7920883,GSM7920884,GSM7920885,GSM7920886,GSM7920887,GSM7920888,GSM7920889,GSM7920890,GSM7920891,GSM7920892,GSM7920893,GSM7920894,GSM7920895,GSM7920896,GSM7920897,GSM7920898,GSM7920899,GSM7920900,GSM7920901,GSM7920902,GSM7920903,GSM7920904,GSM7920905,GSM7920906,GSM7920907,GSM7920908,GSM7920909,GSM7920910,GSM7920911,GSM7920912,GSM7920913,GSM7920914,GSM7920915,GSM7920916,GSM7920917,GSM7920918,GSM7920919,GSM7920920,GSM7920921,GSM7920922,GSM7920923,GSM7920924,GSM7920925,GSM7920926,GSM7920927,GSM7920928,GSM7920929,GSM7920930,GSM7920931,GSM7920932,GSM7920933,GSM7920934,GSM7920935,GSM7920936,GSM7920937,GSM7920938,GSM7920939,GSM7920940,GSM7920941,GSM7920942,GSM7920943,GSM7920944,GSM7920945,GSM7920946,GSM7920947,GSM7920948,GSM7920949,GSM7920950,GSM7920951,GSM7920952,GSM7920953,GSM7920954,GSM7920955,GSM7920956,GSM7920957,GSM7920958,GSM7920959,GSM7920960,GSM7920961,GSM7920962,GSM7920963,GSM7920964,GSM7920965,GSM7920966,GSM7920967,GSM7920968,GSM7920969,GSM7920970,GSM7920971,GSM7920972,GSM7920973,GSM7920974,GSM7920975,GSM7920976,GSM7920977,GSM7920978,GSM7920979,GSM7920980,GSM7920981,GSM7920982,GSM7920983,GSM7920984,GSM7920985,GSM7920986,GSM7920987,GSM7920988,GSM7920989,GSM7920990,GSM7920991,GSM7920992,GSM7920993,GSM7920994,GSM7920995,GSM7920996,GSM7920997,GSM7920998,GSM7920999,GSM7921000,GSM7921001,GSM7921002,GSM7921003,GSM7921004,GSM7921005,GSM7921006,GSM7921007,GSM7921008,GSM7921009,GSM7921010,GSM7921011,GSM7921012,GSM7921013,GSM7921014,GSM7921015,GSM7921016,GSM7921017,GSM7921018,GSM7921019,GSM7921020,GSM7921021,GSM7921022,GSM7921023,GSM7921024,GSM7921025,GSM7921026,GSM7921027,GSM7921028,GSM7921029,GSM7921030,GSM7921031,GSM7921032,GSM7921033,GSM7921034,GSM7921035,GSM7921036,GSM7921037,GSM7921038,GSM7921039,GSM7921040,GSM7921041,GSM7921042,GSM7921043,GSM7921044,GSM7921045,GSM7921046,GSM7921047,GSM7921048,GSM7921049,GSM7921050,GSM7921051,GSM7921052,GSM7921053,GSM7921054,GSM7921055,GSM7921056,GSM7921057,GSM7921058,GSM7921059,GSM7921060,GSM7921061,GSM7921062,GSM7921063,GSM7921064,GSM7921065,GSM7921066,GSM7921067,GSM7921068,GSM7921069,GSM7921070,GSM7921071,GSM7921072,GSM7921073,GSM7921074,GSM7921075,GSM7921076,GSM7921077,GSM7921078,GSM7921079,GSM7921080,GSM7921081,GSM7921082,GSM7921083,GSM7921084,GSM7921085,GSM7921086,GSM7921087,GSM7921088,GSM7921089,GSM7921090,GSM7921091,GSM7921092,GSM7921093,GSM7921094,GSM7921095,GSM7921096,GSM7921097,GSM7921098,GSM7921099,GSM7921100,GSM7921101,GSM7921102,GSM7921103,GSM7921104,GSM7921105,GSM7921106,GSM7921107,GSM7921108,GSM7921109,GSM7921110,GSM7921111,GSM7921112,GSM7921113,GSM7921114,GSM7921115,GSM7921116,GSM7921117,GSM7921118,GSM7921119,GSM7921120,GSM7921121
2
+ Large_B-cell_Lymphoma,0.0,0.0,0.0,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,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,1.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.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,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.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,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.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,1.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,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,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,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Large_B-cell_Lymphoma/code/GSE114022.py ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE114022"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE114022"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE114022.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE114022.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE114022.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # The title and design indicate this is gene expression data from cell lines
34
+ is_gene_available = True
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # 2.1 Data Availability
38
+
39
+ # Treatment (YK-S vs YK-R) can be used as binary trait
40
+ trait_row = 1
41
+
42
+ # Cell lines only, no patient age data
43
+ age_row = None
44
+
45
+ # Cell lines only, no gender data
46
+ gender_row = None
47
+
48
+ # 2.2 Data Type Conversion
49
+ def convert_trait(value):
50
+ if not isinstance(value, str):
51
+ return None
52
+ value = value.lower().split(": ")[-1]
53
+ # YK-S vs YK-R comparison (exclude DMSO control)
54
+ if value == "yk-s":
55
+ return 0
56
+ elif value == "yk-r":
57
+ return 1
58
+ return None
59
+
60
+ def convert_age(value):
61
+ # Not available
62
+ return None
63
+
64
+ def convert_gender(value):
65
+ # Not available
66
+ return None
67
+
68
+ # 3. Save Initial Metadata
69
+ is_trait_available = trait_row is not None
70
+ validate_and_save_cohort_info(is_final=False,
71
+ cohort=cohort,
72
+ info_path=json_path,
73
+ is_gene_available=is_gene_available,
74
+ is_trait_available=is_trait_available)
75
+
76
+ # 4. Extract Clinical Features
77
+ if trait_row is not None:
78
+ clinical_features = geo_select_clinical_features(clinical_data,
79
+ trait=trait,
80
+ trait_row=trait_row,
81
+ convert_trait=convert_trait,
82
+ age_row=age_row,
83
+ convert_age=convert_age,
84
+ gender_row=gender_row,
85
+ convert_gender=convert_gender)
86
+
87
+ # Preview results
88
+ preview = preview_df(clinical_features)
89
+ print("Preview of clinical features:")
90
+ print(preview)
91
+
92
+ # Save clinical data
93
+ clinical_features.to_csv(out_clinical_data_file)
94
+ # Extract gene expression data from matrix file
95
+ genetic_data = get_genetic_data(matrix_file)
96
+
97
+ # Print DataFrame info and dimensions to verify data structure
98
+ print("DataFrame info:")
99
+ print(genetic_data.info())
100
+ print("\nDataFrame dimensions:", genetic_data.shape)
101
+
102
+ # Print an excerpt of the data to inspect row/column structure
103
+ print("\nFirst few rows and columns of data:")
104
+ print(genetic_data.head().iloc[:, :5])
105
+
106
+ # Print first 20 row IDs
107
+ print("\nFirst 20 gene/probe IDs:")
108
+ print(genetic_data.index[:20].tolist())
109
+ # The gene identifiers start with "ILMN_" which indicates these are Illumina probe IDs
110
+ # They need to be mapped to standard human gene symbols for analysis
111
+ requires_gene_mapping = True
112
+ # Extract gene annotation data
113
+ gene_annotation = get_gene_annotation(soft_file)
114
+
115
+ # Preview the annotation data structure
116
+ print("Gene Annotation Preview:")
117
+ preview = preview_df(gene_annotation)
118
+ print(json.dumps(preview, indent=2))
119
+
120
+ print("\nGene Annotation Analysis:")
121
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
122
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
123
+
124
+ # Update validation info to show dataset cannot be used due to missing gene mapping
125
+ validate_and_save_cohort_info(
126
+ is_final=False,
127
+ cohort=cohort,
128
+ info_path=json_path,
129
+ is_gene_available=False, # Set to False since gene expression data is not mappable
130
+ is_trait_available=trait_row is not None,
131
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
132
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/GSE142494.py ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE142494"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE142494"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE142494.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE142494.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE142494.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the series description, this appears to be a gene expression study focused on B-cell differentiation
34
+ is_gene_available = True
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # 2.1 Data rows
38
+ trait_row = 0 # Using cell type as trait indicator
39
+ age_row = None # Age not available
40
+ gender_row = None # Gender not available
41
+
42
+ # 2.2 Conversion functions
43
+ def convert_trait(value: str) -> int:
44
+ """Convert cell type to binary: 1 for memory B cells, 0 for total B cells"""
45
+ if pd.isna(value):
46
+ return None
47
+ value = value.split(': ')[-1].lower().strip()
48
+ if 'memory b cells' in value:
49
+ return 1
50
+ elif 'total b cells' in value:
51
+ return 0
52
+ return None
53
+
54
+ def convert_age(value: str) -> float:
55
+ """Not used as age data is unavailable"""
56
+ return None
57
+
58
+ def convert_gender(value: str) -> int:
59
+ """Not used as gender data is unavailable"""
60
+ return None
61
+
62
+ # 3. Save metadata
63
+ validate_and_save_cohort_info(
64
+ is_final=False,
65
+ cohort=cohort,
66
+ info_path=json_path,
67
+ is_gene_available=is_gene_available,
68
+ is_trait_available=trait_row is not None
69
+ )
70
+
71
+ # 4. Extract clinical features
72
+ clinical_df = geo_select_clinical_features(
73
+ clinical_df=clinical_data,
74
+ trait=trait,
75
+ trait_row=trait_row,
76
+ convert_trait=convert_trait,
77
+ age_row=age_row,
78
+ convert_age=convert_age,
79
+ gender_row=gender_row,
80
+ convert_gender=convert_gender
81
+ )
82
+
83
+ # Preview and save clinical data
84
+ print("Clinical data preview:")
85
+ print(preview_df(clinical_df))
86
+ clinical_df.to_csv(out_clinical_data_file)
87
+ # Extract gene expression data from matrix file
88
+ genetic_data = get_genetic_data(matrix_file)
89
+
90
+ # Print DataFrame info and dimensions to verify data structure
91
+ print("DataFrame info:")
92
+ print(genetic_data.info())
93
+ print("\nDataFrame dimensions:", genetic_data.shape)
94
+
95
+ # Print an excerpt of the data to inspect row/column structure
96
+ print("\nFirst few rows and columns of data:")
97
+ print(genetic_data.head().iloc[:, :5])
98
+
99
+ # Print first 20 row IDs
100
+ print("\nFirst 20 gene/probe IDs:")
101
+ print(genetic_data.index[:20].tolist())
102
+ # The identifiers start with "ILMN_", indicating they are Illumina probe IDs
103
+ # These need to be mapped to human gene symbols for analysis
104
+ requires_gene_mapping = True
105
+ # Report discovery of missing gene annotation
106
+ print("Gene Annotation Analysis:")
107
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
108
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
109
+
110
+ # Update validation info to show dataset cannot be used due to missing gene mapping
111
+ validate_and_save_cohort_info(
112
+ is_final=False,
113
+ cohort=cohort,
114
+ info_path=json_path,
115
+ is_gene_available=False, # Set to False since gene expression data is not mappable
116
+ is_trait_available=trait_row is not None,
117
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
118
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/GSE145848.py ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE145848"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE145848"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE145848.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE145848.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE145848.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Title mentions "transcription programs" and B cell cancers,
34
+ # suggesting gene expression data will be part of the series
35
+ is_gene_available = True
36
+
37
+ # 2.1 Data Availability
38
+ # From clinical features dictionary:
39
+ # - trait (healthy vs CLL) is available in row 1
40
+ # - age is not available
41
+ # - gender is not available
42
+ trait_row = 1
43
+ age_row = None
44
+ gender_row = None
45
+
46
+ # 2.2 Data Type Conversion Functions
47
+ def convert_trait(value):
48
+ if not value or ':' not in value:
49
+ return None
50
+ value = value.split(':')[1].strip().lower()
51
+ # Convert to binary: 0 for healthy, 1 for disease
52
+ if 'healthy' in value:
53
+ return 0
54
+ elif 'chronic lymphocytic leukemia' in value:
55
+ return 1
56
+ return None
57
+
58
+ convert_age = None
59
+ convert_gender = None
60
+
61
+ # 3. Save Metadata
62
+ # Initial filtering - only checking data availability
63
+ is_trait_available = trait_row is not None
64
+ validate_and_save_cohort_info(is_final=False,
65
+ cohort=cohort,
66
+ info_path=json_path,
67
+ is_gene_available=is_gene_available,
68
+ is_trait_available=is_trait_available)
69
+
70
+ # 4. Clinical Feature Extraction
71
+ # Since trait_row is not None, we proceed with clinical feature extraction
72
+ clinical_df = geo_select_clinical_features(clinical_data,
73
+ trait=trait,
74
+ trait_row=trait_row,
75
+ convert_trait=convert_trait)
76
+
77
+ # Preview the processed clinical data
78
+ preview = preview_df(clinical_df)
79
+ print("Clinical data preview:", preview)
80
+
81
+ # Save clinical data
82
+ clinical_df.to_csv(out_clinical_data_file)
83
+ # Extract gene expression data from matrix file
84
+ genetic_data = get_genetic_data(matrix_file)
85
+
86
+ # Print DataFrame info and dimensions to verify data structure
87
+ print("DataFrame info:")
88
+ print(genetic_data.info())
89
+ print("\nDataFrame dimensions:", genetic_data.shape)
90
+
91
+ # Print an excerpt of the data to inspect row/column structure
92
+ print("\nFirst few rows and columns of data:")
93
+ print(genetic_data.head().iloc[:, :5])
94
+
95
+ # Print first 20 row IDs
96
+ print("\nFirst 20 gene/probe IDs:")
97
+ print(genetic_data.index[:20].tolist())
98
+ # The row indices appear to be probe identifiers from a microarray platform
99
+ # (16657436, etc) rather than human gene symbols.
100
+ # These need to be mapped to standard gene symbols for analysis.
101
+ requires_gene_mapping = True
102
+ # Report discovery of missing gene annotation
103
+ print("Gene Annotation Analysis:")
104
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
105
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
106
+
107
+ # Update validation info to show dataset cannot be used due to missing gene mapping
108
+ validate_and_save_cohort_info(
109
+ is_final=False,
110
+ cohort=cohort,
111
+ info_path=json_path,
112
+ is_gene_available=False, # Set to False since gene expression data is not mappable
113
+ is_trait_available=trait_row is not None,
114
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
115
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/GSE156309.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE156309"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE156309"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE156309.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE156309.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE156309.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ is_gene_available = True # Using Affymetrix Human U133 Plus 2.0 microarrays for mRNA expression
34
+
35
+ # 2.1 Data Availability
36
+ trait_row = 3 # 'disease status' indicates relapse status
37
+ age_row = 0 # Age information is available
38
+ gender_row = None # No gender information available
39
+
40
+ # 2.2 Data Type Conversion Functions
41
+ def convert_trait(value: str) -> int:
42
+ """Convert relapse status to binary (0: relapse-free, 1: relapse)"""
43
+ if not isinstance(value, str):
44
+ return None
45
+ value = value.split(': ')[-1].lower()
46
+ if value == 'relapse-free':
47
+ return 0
48
+ elif value == 'relapse':
49
+ return 1
50
+ return None
51
+
52
+ def convert_age(value: str) -> float:
53
+ """Convert age to continuous numeric value"""
54
+ if not isinstance(value, str):
55
+ return None
56
+ try:
57
+ age = float(value.split(': ')[-1])
58
+ return age
59
+ except:
60
+ return None
61
+
62
+ def convert_gender(value: str) -> int:
63
+ """Convert gender to binary (0: female, 1: male)"""
64
+ # Not used since gender data is unavailable
65
+ return None
66
+
67
+ # 3. Save Metadata
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. Clinical Feature Extraction
75
+ if trait_row is not None:
76
+ selected_clinical_df = geo_select_clinical_features(
77
+ clinical_df=clinical_data,
78
+ trait=trait,
79
+ trait_row=trait_row,
80
+ convert_trait=convert_trait,
81
+ age_row=age_row,
82
+ convert_age=convert_age,
83
+ gender_row=gender_row,
84
+ convert_gender=convert_gender
85
+ )
86
+
87
+ # Preview the processed data
88
+ print(preview_df(selected_clinical_df))
89
+
90
+ # Save clinical features
91
+ selected_clinical_df.to_csv(out_clinical_data_file)
92
+ # Extract gene expression data from matrix file
93
+ genetic_data = get_genetic_data(matrix_file)
94
+
95
+ # Print DataFrame info and dimensions to verify data structure
96
+ print("DataFrame info:")
97
+ print(genetic_data.info())
98
+ print("\nDataFrame dimensions:", genetic_data.shape)
99
+
100
+ # Print an excerpt of the data to inspect row/column structure
101
+ print("\nFirst few rows and columns of data:")
102
+ print(genetic_data.head().iloc[:, :5])
103
+
104
+ # Print first 20 row IDs
105
+ print("\nFirst 20 gene/probe IDs:")
106
+ print(genetic_data.index[:20].tolist())
107
+ # These appear to be Affymetrix probe IDs (e.g. "1007_s_at", "AFFX-TrpnX-M_at")
108
+ # rather than standard human gene symbols, so they will need to be mapped
109
+ requires_gene_mapping = True
110
+ # Report discovery of missing gene annotation
111
+ print("Gene Annotation Analysis:")
112
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
113
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
114
+
115
+ # Update validation info to show dataset cannot be used due to missing gene mapping
116
+ validate_and_save_cohort_info(
117
+ is_final=False,
118
+ cohort=cohort,
119
+ info_path=json_path,
120
+ is_gene_available=False, # Set to False since gene expression data is not mappable
121
+ is_trait_available=trait_row is not None,
122
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
123
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/GSE159472.py ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE159472"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE159472"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE159472.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE159472.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE159472.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Availability
33
+ # Based on background info and series title, this is a microarray expression data for DLBCL
34
+ is_gene_available = True
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # 2.1 Row Numbers
38
+ # Trait (ABC/GCB subtypes) is in row 2
39
+ trait_row = 2
40
+ # Age and gender not available in characteristics
41
+ age_row = None
42
+ gender_row = None
43
+
44
+ # 2.2 Conversion Functions
45
+ def convert_trait(x):
46
+ """Convert DLBCL subtype to binary: ABC=1, GCB=0"""
47
+ try:
48
+ if not isinstance(x, str):
49
+ return None
50
+ x = x.split(': ')[1].strip()
51
+ if 'ABC' in x:
52
+ return 1
53
+ elif 'GCB' in x:
54
+ return 0
55
+ return None
56
+ except:
57
+ return None
58
+
59
+ def convert_age(x):
60
+ return None
61
+
62
+ def convert_gender(x):
63
+ return None
64
+
65
+ # 3. Save initial metadata
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. Extract clinical features since trait data is available
74
+ if trait_row is not None:
75
+ clinical_features = geo_select_clinical_features(
76
+ 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 extracted features
87
+ print("Preview of clinical features:")
88
+ print(preview_df(clinical_features))
89
+
90
+ # Save to CSV
91
+ clinical_features.to_csv(out_clinical_data_file)
92
+ # Extract gene expression data from matrix file
93
+ genetic_data = get_genetic_data(matrix_file)
94
+
95
+ # Print DataFrame info and dimensions to verify data structure
96
+ print("DataFrame info:")
97
+ print(genetic_data.info())
98
+ print("\nDataFrame dimensions:", genetic_data.shape)
99
+
100
+ # Print an excerpt of the data to inspect row/column structure
101
+ print("\nFirst few rows and columns of data:")
102
+ print(genetic_data.head().iloc[:, :5])
103
+
104
+ # Print first 20 row IDs
105
+ print("\nFirst 20 gene/probe IDs:")
106
+ print(genetic_data.index[:20].tolist())
107
+ # Review gene identifiers - these appear to be Affymetrix probe IDs (e.g. "1007_s_at")
108
+ # rather than standard human gene symbols, so mapping will be required
109
+ requires_gene_mapping = True
110
+ # Extract gene annotation data
111
+ gene_annotation = get_gene_annotation(soft_file)
112
+
113
+ # Print information about annotation data
114
+ print("Gene Annotation Preview:")
115
+ print("\nDataFrame Shape:", gene_annotation.shape)
116
+ print("\nColumn Names:")
117
+ print(gene_annotation.columns.tolist())
118
+ print("\nFirst few rows preview:")
119
+ print(preview_df(gene_annotation))
120
+ # Get mapping between gene IDs and gene symbols from annotation data
121
+ # 'ID' column matches probe IDs in expression data, 'Gene Symbol' contains human gene symbols
122
+ mapping_df = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
123
+
124
+ # Apply mapping to convert probe-level data to gene expression data
125
+ gene_data = apply_gene_mapping(genetic_data, mapping_df)
126
+
127
+ # Print info about the resulting gene expression data
128
+ print("Gene expression data shape after mapping:", gene_data.shape)
129
+ print("\nFirst few mapped genes and their expression values:")
130
+ print(gene_data.head().iloc[:, :5])
131
+ # 1. Normalize gene symbols
132
+ gene_data = normalize_gene_symbols_in_index(gene_data)
133
+ gene_data.to_csv(out_gene_data_file)
134
+
135
+ # 2. Link clinical and genetic data
136
+ linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
137
+
138
+ # Debug print to check data before handling missing values
139
+ print("\nPreview of linked data before handling missing values:")
140
+ print(linked_data.head())
141
+
142
+ # 3. Handle missing values
143
+ linked_data = handle_missing_values(df=linked_data, trait_col=trait)
144
+
145
+ print("\nPreview of linked data after handling missing values:")
146
+ print(linked_data.head())
147
+
148
+ # 4. Check for biases and remove biased demographic features
149
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
150
+
151
+ # 5. Validate dataset quality and save metadata
152
+ note = ""
153
+ if is_biased:
154
+ note = "The trait distribution is severely biased."
155
+
156
+ is_usable = validate_and_save_cohort_info(
157
+ is_final=True,
158
+ cohort=cohort,
159
+ info_path=json_path,
160
+ is_gene_available=True,
161
+ is_trait_available=True,
162
+ is_biased=is_biased,
163
+ df=linked_data,
164
+ note=note
165
+ )
166
+
167
+ # 6. Save linked data if usable
168
+ if is_usable:
169
+ linked_data.to_csv(out_data_file)
p3/preprocess/Large_B-cell_Lymphoma/code/GSE173263.py ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE173263"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE173263"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE173263.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE173263.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE173263.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on background info, this is a GEP (Gene Expression Profile) study
34
+ is_gene_available = True
35
+
36
+ # 2. Data Availability and Type Conversion
37
+ # 2.1 Data Availability
38
+ # Trait (response to R-CHOP) is in row 2
39
+ trait_row = 2
40
+ # Age not available
41
+ age_row = None
42
+ # Gender not available
43
+ gender_row = None
44
+
45
+ # 2.2 Data Type Conversion Functions
46
+ def convert_trait(value):
47
+ if not isinstance(value, str):
48
+ return None
49
+ value = value.lower().split(": ")[-1].strip()
50
+ if "early failure" in value:
51
+ return 1
52
+ elif "remission" in value:
53
+ return 0
54
+ return None
55
+
56
+ def convert_age(value):
57
+ return None
58
+
59
+ def convert_gender(value):
60
+ return None
61
+
62
+ # 3. Save Metadata
63
+ is_trait_available = trait_row is not None
64
+ validate_and_save_cohort_info(is_final=False,
65
+ cohort=cohort,
66
+ info_path=json_path,
67
+ is_gene_available=is_gene_available,
68
+ is_trait_available=is_trait_available)
69
+
70
+ # 4. Clinical Feature Extraction
71
+ if trait_row is not None:
72
+ clinical_features = geo_select_clinical_features(
73
+ clinical_df=clinical_data,
74
+ trait=trait,
75
+ trait_row=trait_row,
76
+ convert_trait=convert_trait,
77
+ age_row=age_row,
78
+ convert_age=convert_age,
79
+ gender_row=gender_row,
80
+ convert_gender=convert_gender
81
+ )
82
+
83
+ # Preview extracted features
84
+ preview = preview_df(clinical_features)
85
+
86
+ # Save clinical features
87
+ clinical_features.to_csv(out_clinical_data_file)
88
+ # Extract gene expression data from matrix file
89
+ genetic_data = get_genetic_data(matrix_file)
90
+
91
+ # Print DataFrame info and dimensions to verify data structure
92
+ print("DataFrame info:")
93
+ print(genetic_data.info())
94
+ print("\nDataFrame dimensions:", genetic_data.shape)
95
+
96
+ # Print an excerpt of the data to inspect row/column structure
97
+ print("\nFirst few rows and columns of data:")
98
+ print(genetic_data.head().iloc[:, :5])
99
+
100
+ # Print first 20 row IDs
101
+ print("\nFirst 20 gene/probe IDs:")
102
+ print(genetic_data.index[:20].tolist())
103
+ # Based on the index format (e.g., '11715100_at', '11715101_s_at'), these appear to be Affymetrix probe IDs
104
+ # rather than standard human gene symbols. They need to be mapped to HGNC gene symbols.
105
+
106
+ requires_gene_mapping = True
107
+ # Report discovery of missing gene annotation
108
+ print("Gene Annotation Analysis:")
109
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
110
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
111
+
112
+ # Update validation info to show dataset cannot be used due to missing gene mapping
113
+ validate_and_save_cohort_info(
114
+ is_final=False,
115
+ cohort=cohort,
116
+ info_path=json_path,
117
+ is_gene_available=False, # Set to False since gene expression data is not mappable
118
+ is_trait_available=trait_row is not None,
119
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
120
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/GSE182362.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE182362"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE182362"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE182362.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE182362.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE182362.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # This is a miRNA study on cell lines, not gene expression data
34
+ is_gene_available = False
35
+
36
+ # 2. Clinical Data Availability and Type Conversion
37
+ # 2.1 Data rows
38
+ # Only has treatment data in row 2, but no human trait/age/gender data
39
+ trait_row = None
40
+ age_row = None
41
+ gender_row = None
42
+
43
+ # 2.2 Conversion functions
44
+ def convert_trait(x):
45
+ # Not used since trait data not available
46
+ return None
47
+
48
+ def convert_age(x):
49
+ # Not used since age data not available
50
+ return None
51
+
52
+ def convert_gender(x):
53
+ # Not used since gender data not available
54
+ return None
55
+
56
+ # 3. Save metadata
57
+ # trait_row is None so trait data not available
58
+ is_trait_available = False if trait_row is None else True
59
+
60
+ validate_and_save_cohort_info(
61
+ is_final=False,
62
+ cohort=cohort,
63
+ info_path=json_path,
64
+ is_gene_available=is_gene_available,
65
+ is_trait_available=is_trait_available
66
+ )
67
+
68
+ # 4. Clinical Feature Extraction
69
+ # Skip since trait_row is None, indicating no clinical data available
p3/preprocess/Large_B-cell_Lymphoma/code/GSE197977.py ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE197977"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE197977"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE197977.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE197977.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE197977.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the series title and summary, this dataset studies tumor gene expression and immune cell signatures,
34
+ # so it should contain gene expression data
35
+ is_gene_available = True
36
+
37
+ # 2. Data Availability and Type Conversion
38
+ # 2.1 Row identifiers
39
+ trait_row = 2 # bestresponse contains response to treatment (CR/PR vs PD/SD)
40
+ age_row = None # Age data not available
41
+ gender_row = None # Gender data not available
42
+
43
+ # 2.2 Type conversion functions
44
+ def convert_trait(value: str) -> int:
45
+ """Convert treatment response to binary outcome
46
+ Complete Response (CR) and Partial Response (PR) -> 1 (response)
47
+ Stable Disease (SD) and Progressive Disease (PD) -> 0 (no response)
48
+ """
49
+ if not value or 'bestresponse:' not in value:
50
+ return None
51
+ response = value.split('bestresponse:')[1].strip()
52
+ if response in ['CR', 'PR']:
53
+ return 1
54
+ elif response in ['SD', 'PD']:
55
+ return 0
56
+ return None
57
+
58
+ def convert_age(value: str) -> float:
59
+ return None
60
+
61
+ def convert_gender(value: str) -> int:
62
+ return None
63
+
64
+ # 3. Save initial 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. Extract clinical features
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
+ # Preview the extracted features
87
+ preview_dict = preview_df(clinical_features)
88
+
89
+ # Save clinical data
90
+ clinical_features.to_csv(out_clinical_data_file)
91
+ # Extract gene expression data from matrix file
92
+ genetic_data = get_genetic_data(matrix_file)
93
+
94
+ # Print DataFrame info and dimensions to verify data structure
95
+ print("DataFrame info:")
96
+ print(genetic_data.info())
97
+ print("\nDataFrame dimensions:", genetic_data.shape)
98
+
99
+ # Print an excerpt of the data to inspect row/column structure
100
+ print("\nFirst few rows and columns of data:")
101
+ print(genetic_data.head().iloc[:, :5])
102
+
103
+ # Print first 20 row IDs
104
+ print("\nFirst 20 gene/probe IDs:")
105
+ print(genetic_data.index[:20].tolist())
106
+ # The row indices shown are simple numeric values (1, 2, 3 etc) which are not gene symbols
107
+ # We need to map these numeric identifiers to proper gene symbols for biological interpretation
108
+ requires_gene_mapping = True
109
+ # Report discovery of missing gene annotation
110
+ print("Gene Annotation Analysis:")
111
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
112
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
113
+
114
+ # Update validation info to show dataset cannot be used due to missing gene mapping
115
+ validate_and_save_cohort_info(
116
+ is_final=False,
117
+ cohort=cohort,
118
+ info_path=json_path,
119
+ is_gene_available=False, # Set to False since gene expression data is not mappable
120
+ is_trait_available=trait_row is not None,
121
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
122
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/GSE243973.py ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE243973"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE243973"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE243973.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE243973.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE243973.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Yes - Series summary mentions transcriptomic profiling
34
+ is_gene_available = True
35
+
36
+ # 2.1 Feature Key Identification
37
+ # Trait - Row 0 contains disease state info
38
+ trait_row = 0
39
+ # Age - Not available in characteristics
40
+ age_row = None
41
+ # Gender - Not available in characteristics
42
+ gender_row = None
43
+
44
+ # 2.2 Data Type Conversion Functions
45
+ def convert_trait(x: str) -> int:
46
+ """Convert disease status to binary: 1 for LBCL, 0 for control"""
47
+ if pd.isna(x):
48
+ return None
49
+ value = x.split(': ')[1].lower() if ': ' in x else x.lower()
50
+ if 'large b-cell lymphoma' in value:
51
+ return 1
52
+ elif 'healthy control' in value:
53
+ return 0
54
+ return None
55
+
56
+ def convert_age(x: str) -> float:
57
+ """Not used but defined for completeness"""
58
+ return None
59
+
60
+ def convert_gender(x: str) -> int:
61
+ """Not used but defined for completeness"""
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. Extract Clinical Features
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
+ # Preview the data
87
+ preview = preview_df(clinical_features)
88
+ print("Clinical features preview:", preview)
89
+
90
+ # Save to CSV
91
+ clinical_features.to_csv(out_clinical_data_file)
92
+ # Extract gene expression data from matrix file
93
+ genetic_data = get_genetic_data(matrix_file)
94
+
95
+ # Print first 20 row IDs
96
+ print("First 20 gene/probe IDs:")
97
+ print(genetic_data.index[:20].tolist())
98
+ # These appear to be standard human gene symbols (HGNC format)
99
+ # e.g. ABCF1, ACACA, ADAR are well-known human gene symbols
100
+ # No mapping needed as they are already in the correct format
101
+ requires_gene_mapping = False
102
+ # 1. Normalize gene symbols
103
+ genetic_data = normalize_gene_symbols_in_index(genetic_data)
104
+ genetic_data.to_csv(out_gene_data_file)
105
+
106
+ # 2. Link clinical and genetic data
107
+ linked_data = geo_link_clinical_genetic_data(clinical_features, genetic_data)
108
+
109
+ # 3. Handle missing values
110
+ linked_data = handle_missing_values(df=linked_data, trait_col=trait)
111
+
112
+ # 4. Check for biases and remove biased demographic features
113
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
114
+
115
+ # 5. Validate dataset quality and save metadata
116
+ note = ""
117
+ if is_biased:
118
+ note = "The trait distribution is severely biased."
119
+
120
+ is_usable = validate_and_save_cohort_info(
121
+ is_final=True,
122
+ cohort=cohort,
123
+ info_path=json_path,
124
+ is_gene_available=True,
125
+ is_trait_available=True,
126
+ is_biased=is_biased,
127
+ df=linked_data,
128
+ note=note
129
+ )
130
+
131
+ # 6. Save linked data if usable
132
+ if is_usable:
133
+ linked_data.to_csv(out_data_file)
p3/preprocess/Large_B-cell_Lymphoma/code/GSE248835.py ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+ cohort = "GSE248835"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Large_B-cell_Lymphoma"
10
+ in_cohort_dir = "../DATA/GEO/Large_B-cell_Lymphoma/GSE248835"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/GSE248835.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/GSE248835.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/GSE248835.csv"
16
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ is_gene_available = True # Based on background info mentioning gene expression signatures
34
+
35
+ # 2.1 Data Availability
36
+ trait_row = 10 # histologically.proven.dlbcl.group indicates disease subtype
37
+ age_row = None # Age not available in characteristics
38
+ gender_row = None # Gender not available in characteristics
39
+
40
+ # 2.2 Data Type Conversion Functions
41
+ def convert_trait(x):
42
+ if pd.isna(x):
43
+ return None
44
+ val = x.split(': ')[-1]
45
+ # Binary coding: DLBCL+Others as 0, HGBL as 1
46
+ if val == 'DLBCL+Others':
47
+ return 0
48
+ elif val == 'HGBL':
49
+ return 1
50
+ return None
51
+
52
+ def convert_age(x):
53
+ return None # Not used since age data unavailable
54
+
55
+ def convert_gender(x):
56
+ return None # Not used since gender data unavailable
57
+
58
+ # 3. Save initial metadata
59
+ validate_and_save_cohort_info(
60
+ is_final=False,
61
+ cohort=cohort,
62
+ info_path=json_path,
63
+ is_gene_available=is_gene_available,
64
+ is_trait_available=trait_row is not None
65
+ )
66
+
67
+ # 4. Extract clinical features
68
+ if trait_row is not None:
69
+ selected_df = geo_select_clinical_features(
70
+ clinical_df=clinical_data,
71
+ trait=trait,
72
+ trait_row=trait_row,
73
+ convert_trait=convert_trait,
74
+ age_row=age_row,
75
+ convert_age=convert_age,
76
+ gender_row=gender_row,
77
+ convert_gender=convert_gender
78
+ )
79
+
80
+ # Preview the data
81
+ print("Preview of extracted clinical features:")
82
+ print(preview_df(selected_df))
83
+
84
+ # Save to CSV
85
+ selected_df.to_csv(out_clinical_data_file)
86
+ # Extract gene expression data from matrix file
87
+ genetic_data = get_genetic_data(matrix_file)
88
+
89
+ # Print first 20 row IDs
90
+ print("First 20 gene/probe IDs:")
91
+ print(genetic_data.index[:20].tolist())
92
+ # These appear to be numerical indices rather than proper gene symbols
93
+ # Human gene symbols are typically alphanumeric strings like 'BRCA1', 'TP53', etc.
94
+ # Therefore mapping will be required to convert these numeric IDs to gene symbols
95
+ requires_gene_mapping = True
96
+ # Report discovery of missing gene annotation
97
+ print("Gene Annotation Analysis:")
98
+ print("WARNING: Gene probe-to-symbol mapping information is not available in this SOFT file.")
99
+ print("The annotation only contains signature names (e.g. TIS.IO360, APM.IO360) rather than human gene symbols.")
100
+
101
+ # Update validation info to show dataset cannot be used due to missing gene mapping
102
+ validate_and_save_cohort_info(
103
+ is_final=False,
104
+ cohort=cohort,
105
+ info_path=json_path,
106
+ is_gene_available=False, # Set to False since gene expression data is not mappable
107
+ is_trait_available=trait_row is not None,
108
+ note="Dataset contains numeric probe IDs but lacks gene symbol mapping information"
109
+ )
p3/preprocess/Large_B-cell_Lymphoma/code/TCGA.py ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Large_B-cell_Lymphoma"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/3/Large_B-cell_Lymphoma/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/3/Large_B-cell_Lymphoma/cohort_info.json"
15
+
16
+ # 1. From the subdirectories list, select Large B-cell Lymphoma (DLBC) data since it matches our target trait
17
+ cohort_dir = os.path.join(tcga_root_dir, 'TCGA_Large_Bcell_Lymphoma_(DLBC)')
18
+
19
+ # 2. Get the clinical and genetic data file paths
20
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
21
+
22
+ # 3. Load the data files
23
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
24
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
25
+
26
+ # 4. Print clinical data columns
27
+ print("Clinical data columns:")
28
+ print(clinical_df.columns.tolist())
29
+ # First check available directories
30
+ import os
31
+ print("Available directories:", os.listdir(tcga_root_dir))
32
+
33
+ # Define candidate columns for age and gender
34
+ candidate_age_cols = ['age_at_initial_pathologic_diagnosis', 'days_to_birth']
35
+ candidate_gender_cols = ['gender']
36
+
37
+ # Large B-cell Lymphoma corresponds to DLBC (Diffuse Large B-Cell Lymphoma) in TCGA nomenclature
38
+ cohort_dir = [os.path.join(tcga_root_dir, d) for d in os.listdir(tcga_root_dir)
39
+ if "DLBC" in d][0]
40
+
41
+ # Get clinical data file path
42
+ clinical_file_path, _ = tcga_get_relevant_filepaths(cohort_dir)
43
+
44
+ # Read clinical data
45
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0)
46
+
47
+ # Extract and preview age columns
48
+ age_preview = {}
49
+ for col in candidate_age_cols:
50
+ age_preview[col] = clinical_df[col].head(5).tolist()
51
+ print("Age columns preview:", age_preview)
52
+
53
+ # Extract and preview gender columns
54
+ gender_preview = {}
55
+ for col in candidate_gender_cols:
56
+ gender_preview[col] = clinical_df[col].head(5).tolist()
57
+ print("\nGender columns preview:", gender_preview)
58
+ # Get the cohort directory path
59
+ cohort_dir = os.path.join(tcga_root_dir, "TCGA_Large_Bcell_Lymphoma_(DLBC)")
60
+
61
+ # Get clinical file path
62
+ clinical_file_path, _ = tcga_get_relevant_filepaths(cohort_dir)
63
+
64
+ # Read clinical data with tab separator
65
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
66
+
67
+ # Extract candidate demographic columns
68
+ candidate_age_cols = ["age_at_initial_pathologic_diagnosis", "_age_at_initial_pathologic_diagnosis"]
69
+ candidate_gender_cols = ["gender"]
70
+
71
+ # Preview candidate columns if they exist in the data
72
+ demo_preview = {}
73
+
74
+ if any(col in clinical_df.columns for col in candidate_age_cols):
75
+ for col in candidate_age_cols:
76
+ if col in clinical_df.columns:
77
+ demo_preview[col] = clinical_df[col].head().tolist()
78
+
79
+ if any(col in clinical_df.columns for col in candidate_gender_cols):
80
+ for col in candidate_gender_cols:
81
+ if col in clinical_df.columns:
82
+ demo_preview[col] = clinical_df[col].head().tolist()
83
+
84
+ print("candidate_age_cols =", candidate_age_cols)
85
+ print("candidate_gender_cols =", candidate_gender_cols)
86
+ print("\nPreview of demographic columns:")
87
+ print(demo_preview)
88
+ # Store the preview data
89
+ preview_dict = {'age_at_initial_pathologic_diagnosis': [75, 67, 40, 73, 58], 'gender': ['MALE', 'MALE', 'MALE', 'MALE', 'FEMALE']}
90
+
91
+ # Check age columns
92
+ age_col = None
93
+ if candidate_age_cols:
94
+ # Select first age column that has valid age values
95
+ for col in candidate_age_cols:
96
+ if col in preview_dict and any(isinstance(x, (int, float)) or (isinstance(x, str) and str(x).strip().isdigit()) for x in preview_dict[col]):
97
+ age_col = col
98
+ break
99
+
100
+ # Check gender columns
101
+ gender_col = None
102
+ if candidate_gender_cols:
103
+ # Select first gender column that has valid gender values
104
+ for col in candidate_gender_cols:
105
+ if col in preview_dict and any(isinstance(x, str) and str(x).upper() in ['MALE', 'FEMALE'] for x in preview_dict[col]):
106
+ gender_col = col
107
+ break
108
+
109
+ # Print chosen columns
110
+ print(f"Selected age column: {age_col}")
111
+ print(f"Selected gender column: {gender_col}")
112
+ # 1. Extract and standardize clinical features
113
+ clinical_file_path, genetic_file_path = tcga_get_relevant_filepaths(cohort_dir)
114
+ clinical_df = pd.read_csv(clinical_file_path, index_col=0, sep='\t')
115
+ genetic_df = pd.read_csv(genetic_file_path, index_col=0, sep='\t')
116
+
117
+ # Define demographic columns based on inspection from previous steps
118
+ age_col = 'age_at_initial_pathologic_diagnosis'
119
+ gender_col = 'gender'
120
+
121
+ # Create a DataFrame with just the sample IDs to ensure proper trait encoding
122
+ sample_ids = pd.DataFrame(index=genetic_df.columns)
123
+ selected_clinical_df = tcga_select_clinical_features(sample_ids, trait, age_col=None, gender_col=None)
124
+
125
+ # Add age and gender from clinical data if available
126
+ if age_col in clinical_df.columns:
127
+ selected_clinical_df['Age'] = clinical_df[age_col]
128
+ if gender_col in clinical_df.columns:
129
+ selected_clinical_df['Gender'] = clinical_df[gender_col].apply(tcga_convert_gender)
130
+
131
+ # 2. Normalize gene symbols
132
+ normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
133
+
134
+ # Save normalized gene data
135
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
136
+ normalized_gene_df.to_csv(out_gene_data_file)
137
+
138
+ # 3. Link clinical and genetic data
139
+ linked_data = pd.concat([selected_clinical_df, normalized_gene_df.T], axis=1)
140
+
141
+ # 4. Handle missing values
142
+ linked_data = handle_missing_values(linked_data, trait)
143
+
144
+ # 5. Check for biased features and remove biased demographic features
145
+ is_trait_biased, cleaned_data = judge_and_remove_biased_features(linked_data, trait)
146
+
147
+ # 6. Validate data quality and save cohort info
148
+ note = "Data from TCGA Large B-cell Lymphoma (DLBC) cohort. Classification based on TCGA sample type codes (01-09: tumor, 10-19: normal)."
149
+ is_usable = validate_and_save_cohort_info(
150
+ is_final=True,
151
+ cohort="TCGA_DLBC",
152
+ info_path=json_path,
153
+ is_gene_available=True,
154
+ is_trait_available=True,
155
+ is_biased=is_trait_biased,
156
+ df=cleaned_data,
157
+ note=note
158
+ )
159
+
160
+ # 7. Save linked data if usable
161
+ if is_usable:
162
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
163
+ cleaned_data.to_csv(out_data_file)
164
+ print(f"Data saved to {out_data_file}")
165
+ else:
166
+ print("Data quality validation failed. Dataset not saved.")
p3/preprocess/Large_B-cell_Lymphoma/cohort_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"GSE248835": {"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}, "GSE243973": {"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": 85, "note": ""}, "GSE197977": {"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}, "GSE182362": {"is_usable": false, "is_gene_available": false, "is_trait_available": false, "is_available": false, "is_biased": null, "has_age": null, "has_gender": null, "sample_size": null, "note": null}, "GSE173263": {"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}, "GSE159472": {"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": 180, "note": ""}, "GSE156309": {"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}, "GSE145848": {"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}, "GSE142494": {"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}, "GSE114022": {"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}, "TCGA_LIHC": {"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": 48, "note": "Data from TCGA Liver Cancer cohort used as proxy for LDL cholesterol studies due to liver's role in cholesterol metabolism. Age was calculated from days_to_birth for more accurate values."}, "TCGA_DLBC": {"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": 48, "note": "Data from TCGA Large B-cell Lymphoma (DLBC) cohort. Classification based on TCGA sample type codes (01-09: tumor, 10-19: normal)."}}
p3/preprocess/Large_B-cell_Lymphoma/gene_data/GSE243973.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Liver_Cancer/clinical_data/GSE148346.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM4462080,GSM4462081,GSM4462082,GSM4462083,GSM4462084,GSM4462085,GSM4462086,GSM4462087,GSM4462088,GSM4462089,GSM4462090,GSM4462091,GSM4462092,GSM4462093,GSM4462094,GSM4462095,GSM4462096,GSM4462097,GSM4462098,GSM4462099,GSM4462100,GSM4462101,GSM4462102,GSM4462103,GSM4462104,GSM4462105,GSM4462106,GSM4462107,GSM4462108,GSM4462109,GSM4462110,GSM4462111,GSM4462112,GSM4462113,GSM4462114,GSM4462115,GSM4462116,GSM4462117,GSM4462118,GSM4462119,GSM4462120,GSM4462121,GSM4462122,GSM4462123,GSM4462124,GSM4462125,GSM4462126,GSM4462127,GSM4462128,GSM4462129,GSM4462130,GSM4462131,GSM4462132,GSM4462133,GSM4462134,GSM4462135,GSM4462136,GSM4462137,GSM4462138,GSM4462139,GSM4462140,GSM4462141,GSM4462142,GSM4462143,GSM4462144,GSM4462145,GSM4462146,GSM4462147,GSM4462148,GSM4462149,GSM4462150,GSM4462151,GSM4462152,GSM4462153,GSM4462154,GSM4462155,GSM4462156,GSM4462157,GSM4462158,GSM4462159,GSM4462160,GSM4462161,GSM4462162,GSM4462163,GSM4462164,GSM4462165,GSM4462166,GSM4462167,GSM4462168,GSM4462169,GSM4462170,GSM4462171,GSM4462172,GSM4462173,GSM4462174,GSM4462175,GSM4462176,GSM4462177,GSM4462178,GSM4462179,GSM4462180,GSM4462181,GSM4462182,GSM4462183,GSM4462184,GSM4462185,GSM4462186,GSM4462187,GSM4462188,GSM4462189,GSM4462190,GSM4462191,GSM4462192,GSM4462193,GSM4462194,GSM4462195,GSM4462196,GSM4462197,GSM4462198,GSM4462199,GSM4462200,GSM4462201,GSM4462202,GSM4462203,GSM4462204,GSM4462205,GSM4462206,GSM4462207,GSM4462208
2
+ Liver_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0
p3/preprocess/Liver_Cancer/clinical_data/GSE164760.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM5018268,GSM5018269,GSM5018270,GSM5018271,GSM5018272,GSM5018273,GSM5018274,GSM5018275,GSM5018276,GSM5018277,GSM5018278,GSM5018279,GSM5018280,GSM5018281,GSM5018282,GSM5018283,GSM5018284,GSM5018285,GSM5018286,GSM5018287,GSM5018288,GSM5018289,GSM5018290,GSM5018291,GSM5018292,GSM5018293,GSM5018294,GSM5018295,GSM5018296,GSM5018297,GSM5018298,GSM5018299,GSM5018300,GSM5018301,GSM5018302,GSM5018303,GSM5018304,GSM5018305,GSM5018306,GSM5018307,GSM5018308,GSM5018309,GSM5018310,GSM5018311,GSM5018312,GSM5018313,GSM5018314,GSM5018315,GSM5018316,GSM5018317,GSM5018318,GSM5018319,GSM5018320,GSM5018321,GSM5018322,GSM5018323,GSM5018324,GSM5018325,GSM5018326,GSM5018327,GSM5018328,GSM5018329,GSM5018330,GSM5018331,GSM5018332,GSM5018333,GSM5018334,GSM5018335,GSM5018336,GSM5018337,GSM5018338,GSM5018339,GSM5018340,GSM5018341,GSM5018342,GSM5018343,GSM5018344,GSM5018345,GSM5018346,GSM5018347,GSM5018348,GSM5018349,GSM5018350,GSM5018351,GSM5018352,GSM5018353,GSM5018354,GSM5018355,GSM5018356,GSM5018357,GSM5018358,GSM5018359,GSM5018360,GSM5018361,GSM5018362,GSM5018363,GSM5018364,GSM5018365,GSM5018366,GSM5018367,GSM5018368,GSM5018369,GSM5018370,GSM5018371,GSM5018372,GSM5018373,GSM5018374,GSM5018375,GSM5018376,GSM5018377,GSM5018378,GSM5018379,GSM5018380,GSM5018381,GSM5018382,GSM5018383,GSM5018384,GSM5018385,GSM5018386,GSM5018387,GSM5018388,GSM5018389,GSM5018390,GSM5018391,GSM5018392,GSM5018393,GSM5018394,GSM5018395,GSM5018396,GSM5018397,GSM5018398,GSM5018399,GSM5018400,GSM5018401,GSM5018402,GSM5018403,GSM5018404,GSM5018405,GSM5018406,GSM5018407,GSM5018408,GSM5018409,GSM5018410,GSM5018411,GSM5018412,GSM5018413,GSM5018414,GSM5018415,GSM5018416,GSM5018417,GSM5018418,GSM5018419,GSM5018420,GSM5018421,GSM5018422,GSM5018423,GSM5018424,GSM5018425,GSM5018426,GSM5018427,GSM5018428,GSM5018429,GSM5018430,GSM5018431,GSM5018432,GSM5018433,GSM5018434,GSM5018435,GSM5018436,GSM5018437
2
+ Liver_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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Liver_Cancer/clinical_data/GSE174570.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM5319834,GSM5319835,GSM5319836,GSM5319837,GSM5319838,GSM5319839,GSM5319840,GSM5319841,GSM5319842,GSM5319843,GSM5319844,GSM5319845,GSM5319846,GSM5319847,GSM5319848,GSM5319849,GSM5319850,GSM5319851,GSM5319852,GSM5319853,GSM5319854,GSM5319855,GSM5319856,GSM5319857,GSM5319858,GSM5319859,GSM5319860,GSM5319861,GSM5319862,GSM5319863,GSM5319864,GSM5319865,GSM5319866,GSM5319867,GSM5319868,GSM5319869,GSM5319870,GSM5319871,GSM5319872,GSM5319873,GSM5319874,GSM5319875,GSM5319876,GSM5319877,GSM5319878,GSM5319879,GSM5319880,GSM5319881,GSM5319882,GSM5319883,GSM5319884,GSM5319885,GSM5319886,GSM5319887,GSM5319888,GSM5319889,GSM5319890,GSM5319891,GSM5319892,GSM5319893,GSM5319894,GSM5319895,GSM5319896,GSM5319897,GSM5319898,GSM5319899,GSM5319900,GSM5319901,GSM5319902,GSM5319903,GSM5319904,GSM5319905,GSM5319906,GSM5319907,GSM5319908,GSM5319909,GSM5319910,GSM5319911,GSM5319912,GSM5319913,GSM5319914,GSM5319915,GSM5319916,GSM5319917,GSM5319918,GSM5319919,GSM5319920,GSM5319921,GSM5319922,GSM5319923,GSM5319924,GSM5319925,GSM5319926,GSM5319927,GSM5319928,GSM5319929,GSM5319930,GSM5319931,GSM5319932,GSM5319933,GSM5319934,GSM5319935,GSM5319936,GSM5319937,GSM5319938,GSM5319939,GSM5319940,GSM5319941,GSM5319942,GSM5319943,GSM5319944,GSM5319945,GSM5319946,GSM5319947
2
+ Liver_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,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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/Liver_Cancer/clinical_data/GSE228782.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM7136390,GSM7136391,GSM7136392,GSM7136393,GSM7136394,GSM7136395,GSM7136396,GSM7136397,GSM7136398,GSM7136399,GSM7136400,GSM7136401,GSM7136402,GSM7136403,GSM7136404,GSM7136405,GSM7136406,GSM7136407,GSM7136408,GSM7136409,GSM7136410,GSM7136411,GSM7136412,GSM7136413,GSM7136414,GSM7136415,GSM7136416,GSM7136417,GSM7136418,GSM7136419,GSM7136420,GSM7136421,GSM7136422,GSM7136423,GSM7136424,GSM7136425,GSM7136426,GSM7136427,GSM7136428,GSM7136429,GSM7136430,GSM7136431,GSM7136432,GSM7136433,GSM7136434,GSM7136435,GSM7136436,GSM7136437,GSM7136438,GSM7136439,GSM7136440,GSM7136441,GSM7136442,GSM7136443,GSM7136444,GSM7136445,GSM7136446,GSM7136447,GSM7136448,GSM7136449,GSM7136450,GSM7136451,GSM7136452,GSM7136453,GSM7136454,GSM7136455,GSM7136456,GSM7136457,GSM7136458,GSM7136460,GSM7136462,GSM7136465,GSM7136468,GSM7136471,GSM7136472,GSM7136473,GSM7136474,GSM7136475,GSM7136476,GSM7136477,GSM7136478,GSM7136479,GSM7136480
2
+ Liver_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,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Liver_Cancer/clinical_data/GSE228783.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM7136321,GSM7136322,GSM7136323,GSM7136324,GSM7136325,GSM7136326,GSM7136327,GSM7136328,GSM7136329,GSM7136330,GSM7136331,GSM7136332,GSM7136333,GSM7136334,GSM7136335,GSM7136336,GSM7136337,GSM7136338,GSM7136339,GSM7136340,GSM7136341,GSM7136342,GSM7136343,GSM7136344,GSM7136345,GSM7136346,GSM7136347,GSM7136348,GSM7136349,GSM7136350,GSM7136351,GSM7136352,GSM7136353,GSM7136354,GSM7136355,GSM7136356,GSM7136357,GSM7136358,GSM7136359,GSM7136360,GSM7136361,GSM7136362,GSM7136363,GSM7136364,GSM7136365,GSM7136366,GSM7136367,GSM7136368,GSM7136369,GSM7136370,GSM7136371,GSM7136372,GSM7136373,GSM7136374,GSM7136375,GSM7136376,GSM7136377,GSM7136378,GSM7136379,GSM7136380,GSM7136381,GSM7136382,GSM7136383,GSM7136384,GSM7136385,GSM7136386,GSM7136387,GSM7136388,GSM7136389,GSM7136390,GSM7136391,GSM7136392,GSM7136393,GSM7136394,GSM7136395,GSM7136396,GSM7136397,GSM7136398,GSM7136399,GSM7136400,GSM7136401,GSM7136402,GSM7136403,GSM7136404,GSM7136405,GSM7136406,GSM7136407,GSM7136408,GSM7136409,GSM7136410,GSM7136411,GSM7136412,GSM7136413,GSM7136414,GSM7136415,GSM7136416,GSM7136417,GSM7136418,GSM7136419,GSM7136420,GSM7136421,GSM7136422,GSM7136423,GSM7136424,GSM7136425,GSM7136426,GSM7136427,GSM7136428,GSM7136429,GSM7136430,GSM7136431,GSM7136432,GSM7136433,GSM7136434,GSM7136435,GSM7136436,GSM7136437,GSM7136438,GSM7136439,GSM7136440,GSM7136441,GSM7136442,GSM7136443,GSM7136444,GSM7136445,GSM7136446,GSM7136447,GSM7136448,GSM7136449,GSM7136450,GSM7136451,GSM7136452,GSM7136453,GSM7136454,GSM7136455,GSM7136456,GSM7136457,GSM7136458,GSM7136460,GSM7136462,GSM7136465,GSM7136468,GSM7136471,GSM7136472,GSM7136473,GSM7136474,GSM7136475,GSM7136476,GSM7136477,GSM7136478,GSM7136479,GSM7136480
2
+ Liver_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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0
p3/preprocess/Liver_Cancer/clinical_data/GSE45032.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM1096016,GSM1096017,GSM1096018,GSM1096019,GSM1096020,GSM1096021,GSM1096022,GSM1096023,GSM1096024,GSM1096025,GSM1096026,GSM1096027,GSM1096028,GSM1096029,GSM1096030,GSM1096031,GSM1096032,GSM1096033,GSM1096034,GSM1096035,GSM1096036,GSM1096037,GSM1096038,GSM1096039,GSM1096040,GSM1096041,GSM1096042,GSM1096043,GSM1096044,GSM1096045,GSM1096046,GSM1096047,GSM1096048,GSM1096049,GSM1096050,GSM1096051,GSM1096052,GSM1096053,GSM1096054,GSM1096055,GSM1096056,GSM1096057,GSM1096058,GSM1096059,GSM1096060,GSM1096061,GSM1096062,GSM1096063
2
+ Liver_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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,56.0,76.0,79.0,66.0,70.0,68.0,72.0,62.0,66.0,55.0,62.0,71.0,73.0,74.0,61.0,54.0,64.0,68.0,59.0,79.0,69.0,59.0,71.0,64.0,55.0,66.0,56.0,66.0,68.0,25.0,41.0,50.0,56.0,66.0,58.0,67.0,49.0,63.0,70.0,60.0,50.0,58.0,61.0,60.0,59.0,52.0,51.0
4
+ Gender,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,1.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,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0
p3/preprocess/Liver_Cancer/clinical_data/GSE66843.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1633236,GSM1633237,GSM1633238,GSM1633239,GSM1633240,GSM1633241,GSM1633242,GSM1633243,GSM1633244,GSM1633245,GSM1633246,GSM1633247,GSM1633248,GSM1633249,GSM1633250,GSM1633251,GSM1633252
2
+ Liver_Cancer,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0
p3/preprocess/Liver_Cancer/clinical_data/TCGA.csv ADDED
@@ -0,0 +1,439 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sampleID,Liver_Cancer,Age,Gender
2
+ TCGA-2V-A95S-01,1,,1
3
+ TCGA-2Y-A9GS-01,1,58.0,1
4
+ TCGA-2Y-A9GT-01,1,51.0,1
5
+ TCGA-2Y-A9GU-01,1,55.0,0
6
+ TCGA-2Y-A9GV-01,1,54.0,0
7
+ TCGA-2Y-A9GW-01,1,64.0,1
8
+ TCGA-2Y-A9GX-01,1,68.0,1
9
+ TCGA-2Y-A9GY-01,1,64.0,0
10
+ TCGA-2Y-A9GZ-01,1,82.0,0
11
+ TCGA-2Y-A9H0-01,1,49.0,1
12
+ TCGA-2Y-A9H1-01,1,58.0,1
13
+ TCGA-2Y-A9H2-01,1,64.0,0
14
+ TCGA-2Y-A9H3-01,1,45.0,1
15
+ TCGA-2Y-A9H4-01,1,68.0,1
16
+ TCGA-2Y-A9H5-01,1,59.0,0
17
+ TCGA-2Y-A9H6-01,1,68.0,0
18
+ TCGA-2Y-A9H7-01,1,81.0,0
19
+ TCGA-2Y-A9H8-01,1,85.0,0
20
+ TCGA-2Y-A9H9-01,1,70.0,1
21
+ TCGA-2Y-A9HA-01,1,70.0,1
22
+ TCGA-2Y-A9HB-01,1,66.0,1
23
+ TCGA-3K-AAZ8-01,1,65.0,1
24
+ TCGA-4R-AA8I-01,1,66.0,1
25
+ TCGA-5C-A9VG-01,1,58.0,1
26
+ TCGA-5C-A9VH-01,1,70.0,1
27
+ TCGA-5C-AAPD-01,1,61.0,1
28
+ TCGA-5R-AA1C-01,1,57.0,1
29
+ TCGA-5R-AA1D-01,1,17.0,0
30
+ TCGA-5R-AAAM-01,1,65.0,0
31
+ TCGA-BC-4072-01,1,74.0,0
32
+ TCGA-BC-4073-01,1,73.0,1
33
+ TCGA-BC-A10Q-01,1,72.0,0
34
+ TCGA-BC-A10Q-11,0,72.0,0
35
+ TCGA-BC-A10R-01,1,66.0,0
36
+ TCGA-BC-A10R-11,0,66.0,0
37
+ TCGA-BC-A10S-01,1,81.0,1
38
+ TCGA-BC-A10S-11,0,81.0,1
39
+ TCGA-BC-A10T-01,1,76.0,1
40
+ TCGA-BC-A10T-11,0,76.0,1
41
+ TCGA-BC-A10U-01,1,69.0,1
42
+ TCGA-BC-A10U-11,0,69.0,1
43
+ TCGA-BC-A10W-01,1,50.0,1
44
+ TCGA-BC-A10W-11,0,50.0,1
45
+ TCGA-BC-A10X-01,1,52.0,0
46
+ TCGA-BC-A10X-11,0,52.0,0
47
+ TCGA-BC-A10Y-01,1,76.0,1
48
+ TCGA-BC-A10Y-11,0,76.0,1
49
+ TCGA-BC-A10Z-01,1,62.0,0
50
+ TCGA-BC-A10Z-11,0,62.0,0
51
+ TCGA-BC-A110-01,1,51.0,0
52
+ TCGA-BC-A110-11,0,51.0,0
53
+ TCGA-BC-A112-01,1,80.0,1
54
+ TCGA-BC-A112-11,0,80.0,1
55
+ TCGA-BC-A216-01,1,62.0,0
56
+ TCGA-BC-A216-11,0,62.0,0
57
+ TCGA-BC-A217-01,1,75.0,0
58
+ TCGA-BC-A3KF-01,1,66.0,0
59
+ TCGA-BC-A3KG-01,1,68.0,0
60
+ TCGA-BC-A5W4-01,1,69.0,1
61
+ TCGA-BC-A69H-01,1,64.0,1
62
+ TCGA-BC-A69I-01,1,69.0,1
63
+ TCGA-BC-A8YO-01,1,66.0,0
64
+ TCGA-BD-A2L6-01,1,69.0,1
65
+ TCGA-BD-A2L6-11,0,69.0,1
66
+ TCGA-BD-A3EP-01,1,75.0,0
67
+ TCGA-BD-A3EP-11,0,75.0,0
68
+ TCGA-BD-A3ER-01,1,62.0,1
69
+ TCGA-BW-A5NO-01,1,50.0,1
70
+ TCGA-BW-A5NP-01,1,26.0,0
71
+ TCGA-BW-A5NQ-01,1,63.0,1
72
+ TCGA-CC-5258-01,1,48.0,1
73
+ TCGA-CC-5259-01,1,60.0,0
74
+ TCGA-CC-5260-01,1,61.0,0
75
+ TCGA-CC-5261-01,1,44.0,1
76
+ TCGA-CC-5262-01,1,67.0,1
77
+ TCGA-CC-5263-01,1,35.0,1
78
+ TCGA-CC-5264-01,1,71.0,1
79
+ TCGA-CC-A123-01,1,24.0,0
80
+ TCGA-CC-A1HT-01,1,50.0,1
81
+ TCGA-CC-A3M9-01,1,45.0,1
82
+ TCGA-CC-A3MA-01,1,61.0,1
83
+ TCGA-CC-A3MB-01,1,36.0,1
84
+ TCGA-CC-A3MC-01,1,54.0,1
85
+ TCGA-CC-A5UC-01,1,63.0,1
86
+ TCGA-CC-A5UD-01,1,45.0,1
87
+ TCGA-CC-A5UE-01,1,48.0,1
88
+ TCGA-CC-A7IE-01,1,57.0,1
89
+ TCGA-CC-A7IF-01,1,59.0,1
90
+ TCGA-CC-A7IG-01,1,47.0,1
91
+ TCGA-CC-A7IH-01,1,58.0,1
92
+ TCGA-CC-A7II-01,1,54.0,1
93
+ TCGA-CC-A7IJ-01,1,56.0,1
94
+ TCGA-CC-A7IK-01,1,59.0,1
95
+ TCGA-CC-A7IL-01,1,61.0,1
96
+ TCGA-CC-A8HS-01,1,18.0,1
97
+ TCGA-CC-A8HT-01,1,74.0,1
98
+ TCGA-CC-A8HU-01,1,39.0,0
99
+ TCGA-CC-A8HV-01,1,51.0,0
100
+ TCGA-CC-A9FS-01,1,55.0,1
101
+ TCGA-CC-A9FU-01,1,52.0,0
102
+ TCGA-CC-A9FV-01,1,57.0,1
103
+ TCGA-CC-A9FW-01,1,68.0,1
104
+ TCGA-DD-A113-01,1,55.0,0
105
+ TCGA-DD-A113-11,0,55.0,0
106
+ TCGA-DD-A114-01,1,42.0,1
107
+ TCGA-DD-A114-11,0,42.0,1
108
+ TCGA-DD-A115-01,1,53.0,1
109
+ TCGA-DD-A115-11,0,53.0,1
110
+ TCGA-DD-A116-01,1,68.0,1
111
+ TCGA-DD-A116-11,0,68.0,1
112
+ TCGA-DD-A118-01,1,77.0,0
113
+ TCGA-DD-A118-11,0,77.0,0
114
+ TCGA-DD-A119-01,1,40.0,1
115
+ TCGA-DD-A119-11,0,40.0,1
116
+ TCGA-DD-A11A-01,1,67.0,1
117
+ TCGA-DD-A11A-11,0,67.0,1
118
+ TCGA-DD-A11B-01,1,73.0,1
119
+ TCGA-DD-A11B-11,0,73.0,1
120
+ TCGA-DD-A11C-01,1,69.0,1
121
+ TCGA-DD-A11C-11,0,69.0,1
122
+ TCGA-DD-A11D-01,1,57.0,0
123
+ TCGA-DD-A11D-11,0,57.0,0
124
+ TCGA-DD-A1E9-01,1,70.0,1
125
+ TCGA-DD-A1E9-11,0,70.0,1
126
+ TCGA-DD-A1EA-01,1,68.0,1
127
+ TCGA-DD-A1EB-01,1,72.0,0
128
+ TCGA-DD-A1EB-11,0,72.0,0
129
+ TCGA-DD-A1EC-01,1,20.0,0
130
+ TCGA-DD-A1EC-11,0,20.0,0
131
+ TCGA-DD-A1ED-01,1,68.0,1
132
+ TCGA-DD-A1ED-11,0,68.0,1
133
+ TCGA-DD-A1EE-01,1,73.0,1
134
+ TCGA-DD-A1EE-11,0,73.0,1
135
+ TCGA-DD-A1EF-01,1,57.0,0
136
+ TCGA-DD-A1EF-11,0,57.0,0
137
+ TCGA-DD-A1EG-01,1,76.0,1
138
+ TCGA-DD-A1EG-11,0,76.0,1
139
+ TCGA-DD-A1EH-01,1,23.0,1
140
+ TCGA-DD-A1EH-11,0,23.0,1
141
+ TCGA-DD-A1EI-01,1,46.0,1
142
+ TCGA-DD-A1EI-11,0,46.0,1
143
+ TCGA-DD-A1EJ-01,1,71.0,0
144
+ TCGA-DD-A1EJ-11,0,71.0,0
145
+ TCGA-DD-A1EK-01,1,64.0,0
146
+ TCGA-DD-A1EL-01,1,23.0,1
147
+ TCGA-DD-A1EL-11,0,23.0,1
148
+ TCGA-DD-A39V-01,1,77.0,1
149
+ TCGA-DD-A39V-11,0,77.0,1
150
+ TCGA-DD-A39W-01,1,29.0,0
151
+ TCGA-DD-A39W-11,0,29.0,0
152
+ TCGA-DD-A39X-01,1,78.0,0
153
+ TCGA-DD-A39X-11,0,78.0,0
154
+ TCGA-DD-A39Y-01,1,67.0,1
155
+ TCGA-DD-A39Z-01,1,43.0,0
156
+ TCGA-DD-A39Z-11,0,43.0,0
157
+ TCGA-DD-A3A0-01,1,70.0,1
158
+ TCGA-DD-A3A1-01,1,65.0,1
159
+ TCGA-DD-A3A1-11,0,65.0,1
160
+ TCGA-DD-A3A2-01,1,76.0,0
161
+ TCGA-DD-A3A2-11,0,76.0,0
162
+ TCGA-DD-A3A3-01,1,45.0,1
163
+ TCGA-DD-A3A3-11,0,45.0,1
164
+ TCGA-DD-A3A4-01,1,37.0,1
165
+ TCGA-DD-A3A4-11,0,37.0,1
166
+ TCGA-DD-A3A5-01,1,66.0,0
167
+ TCGA-DD-A3A5-11,0,66.0,0
168
+ TCGA-DD-A3A6-01,1,72.0,0
169
+ TCGA-DD-A3A6-11,0,72.0,0
170
+ TCGA-DD-A3A7-01,1,67.0,1
171
+ TCGA-DD-A3A8-01,1,75.0,1
172
+ TCGA-DD-A3A8-11,0,75.0,1
173
+ TCGA-DD-A3A9-01,1,64.0,0
174
+ TCGA-DD-A4NA-01,1,67.0,0
175
+ TCGA-DD-A4NB-01,1,25.0,1
176
+ TCGA-DD-A4ND-01,1,56.0,0
177
+ TCGA-DD-A4NE-01,1,75.0,0
178
+ TCGA-DD-A4NF-01,1,72.0,1
179
+ TCGA-DD-A4NG-01,1,77.0,1
180
+ TCGA-DD-A4NH-01,1,65.0,0
181
+ TCGA-DD-A4NI-01,1,67.0,1
182
+ TCGA-DD-A4NJ-01,1,54.0,0
183
+ TCGA-DD-A4NK-01,1,80.0,0
184
+ TCGA-DD-A4NL-01,1,46.0,1
185
+ TCGA-DD-A4NN-01,1,56.0,0
186
+ TCGA-DD-A4NO-01,1,65.0,1
187
+ TCGA-DD-A4NP-01,1,32.0,1
188
+ TCGA-DD-A4NQ-01,1,60.0,1
189
+ TCGA-DD-A4NR-01,1,85.0,0
190
+ TCGA-DD-A4NS-01,1,61.0,0
191
+ TCGA-DD-A4NV-01,1,61.0,1
192
+ TCGA-DD-A73A-01,1,71.0,1
193
+ TCGA-DD-A73B-01,1,72.0,0
194
+ TCGA-DD-A73C-01,1,65.0,0
195
+ TCGA-DD-A73D-01,1,68.0,0
196
+ TCGA-DD-A73E-01,1,66.0,1
197
+ TCGA-DD-A73F-01,1,77.0,0
198
+ TCGA-DD-A73G-01,1,73.0,0
199
+ TCGA-DD-AA3A-01,1,81.0,0
200
+ TCGA-DD-AAC8-01,1,72.0,1
201
+ TCGA-DD-AAC9-01,1,51.0,1
202
+ TCGA-DD-AACA-01,1,65.0,1
203
+ TCGA-DD-AACA-02,1,65.0,1
204
+ TCGA-DD-AACB-01,1,74.0,0
205
+ TCGA-DD-AACC-01,1,61.0,1
206
+ TCGA-DD-AACD-01,1,48.0,1
207
+ TCGA-DD-AACE-01,1,62.0,1
208
+ TCGA-DD-AACF-01,1,68.0,1
209
+ TCGA-DD-AACG-01,1,52.0,1
210
+ TCGA-DD-AACH-01,1,69.0,1
211
+ TCGA-DD-AACI-01,1,69.0,1
212
+ TCGA-DD-AACJ-01,1,75.0,1
213
+ TCGA-DD-AACK-01,1,70.0,1
214
+ TCGA-DD-AACL-01,1,66.0,0
215
+ TCGA-DD-AACM-01,1,48.0,1
216
+ TCGA-DD-AACN-01,1,32.0,1
217
+ TCGA-DD-AACO-01,1,40.0,1
218
+ TCGA-DD-AACP-01,1,64.0,1
219
+ TCGA-DD-AACQ-01,1,50.0,1
220
+ TCGA-DD-AACS-01,1,39.0,1
221
+ TCGA-DD-AACT-01,1,69.0,0
222
+ TCGA-DD-AACU-01,1,59.0,1
223
+ TCGA-DD-AACV-01,1,53.0,1
224
+ TCGA-DD-AACW-01,1,43.0,1
225
+ TCGA-DD-AACX-01,1,66.0,1
226
+ TCGA-DD-AACY-01,1,61.0,1
227
+ TCGA-DD-AACZ-01,1,63.0,0
228
+ TCGA-DD-AAD0-01,1,73.0,0
229
+ TCGA-DD-AAD1-01,1,51.0,0
230
+ TCGA-DD-AAD2-01,1,66.0,1
231
+ TCGA-DD-AAD3-01,1,43.0,1
232
+ TCGA-DD-AAD5-01,1,54.0,1
233
+ TCGA-DD-AAD6-01,1,66.0,1
234
+ TCGA-DD-AAD8-01,1,73.0,0
235
+ TCGA-DD-AADA-01,1,66.0,0
236
+ TCGA-DD-AADB-01,1,51.0,1
237
+ TCGA-DD-AADC-01,1,53.0,1
238
+ TCGA-DD-AADD-01,1,51.0,1
239
+ TCGA-DD-AADE-01,1,50.0,1
240
+ TCGA-DD-AADF-01,1,64.0,0
241
+ TCGA-DD-AADG-01,1,70.0,1
242
+ TCGA-DD-AADI-01,1,43.0,0
243
+ TCGA-DD-AADJ-01,1,70.0,0
244
+ TCGA-DD-AADK-01,1,68.0,0
245
+ TCGA-DD-AADL-01,1,58.0,1
246
+ TCGA-DD-AADM-01,1,58.0,1
247
+ TCGA-DD-AADN-01,1,59.0,1
248
+ TCGA-DD-AADO-01,1,55.0,1
249
+ TCGA-DD-AADP-01,1,45.0,1
250
+ TCGA-DD-AADQ-01,1,59.0,1
251
+ TCGA-DD-AADR-01,1,58.0,1
252
+ TCGA-DD-AADS-01,1,63.0,1
253
+ TCGA-DD-AADU-01,1,60.0,1
254
+ TCGA-DD-AADV-01,1,50.0,1
255
+ TCGA-DD-AADW-01,1,48.0,1
256
+ TCGA-DD-AADY-01,1,55.0,0
257
+ TCGA-DD-AAE0-01,1,45.0,0
258
+ TCGA-DD-AAE1-01,1,52.0,1
259
+ TCGA-DD-AAE2-01,1,51.0,1
260
+ TCGA-DD-AAE3-01,1,50.0,1
261
+ TCGA-DD-AAE4-01,1,49.0,0
262
+ TCGA-DD-AAE6-01,1,59.0,0
263
+ TCGA-DD-AAE7-01,1,72.0,1
264
+ TCGA-DD-AAE8-01,1,45.0,1
265
+ TCGA-DD-AAE9-01,1,69.0,1
266
+ TCGA-DD-AAEA-01,1,65.0,1
267
+ TCGA-DD-AAEB-01,1,60.0,1
268
+ TCGA-DD-AAED-01,1,51.0,1
269
+ TCGA-DD-AAEE-01,1,55.0,1
270
+ TCGA-DD-AAEG-01,1,59.0,0
271
+ TCGA-DD-AAEH-01,1,73.0,1
272
+ TCGA-DD-AAEI-01,1,72.0,1
273
+ TCGA-DD-AAEK-01,1,51.0,1
274
+ TCGA-DD-AAVP-01,1,48.0,1
275
+ TCGA-DD-AAVQ-01,1,38.0,1
276
+ TCGA-DD-AAVR-01,1,44.0,1
277
+ TCGA-DD-AAVS-01,1,56.0,1
278
+ TCGA-DD-AAVU-01,1,46.0,1
279
+ TCGA-DD-AAVV-01,1,56.0,1
280
+ TCGA-DD-AAVW-01,1,35.0,1
281
+ TCGA-DD-AAVX-01,1,38.0,1
282
+ TCGA-DD-AAVY-01,1,56.0,1
283
+ TCGA-DD-AAVZ-01,1,38.0,1
284
+ TCGA-DD-AAW0-01,1,54.0,1
285
+ TCGA-DD-AAW1-01,1,55.0,1
286
+ TCGA-DD-AAW2-01,1,69.0,1
287
+ TCGA-DD-AAW3-01,1,69.0,1
288
+ TCGA-ED-A459-01,1,47.0,1
289
+ TCGA-ED-A4XI-01,1,58.0,1
290
+ TCGA-ED-A5KG-01,1,60.0,0
291
+ TCGA-ED-A627-01,1,74.0,1
292
+ TCGA-ED-A66X-01,1,35.0,1
293
+ TCGA-ED-A66Y-01,1,51.0,0
294
+ TCGA-ED-A7PX-01,1,48.0,0
295
+ TCGA-ED-A7PY-01,1,20.0,0
296
+ TCGA-ED-A7PZ-01,1,61.0,1
297
+ TCGA-ED-A7XO-01,1,29.0,1
298
+ TCGA-ED-A7XP-01,1,53.0,0
299
+ TCGA-ED-A82E-01,1,60.0,0
300
+ TCGA-ED-A8O5-01,1,59.0,0
301
+ TCGA-ED-A8O6-01,1,50.0,0
302
+ TCGA-ED-A97K-01,1,54.0,1
303
+ TCGA-EP-A12J-01,1,62.0,1
304
+ TCGA-EP-A12J-11,0,62.0,1
305
+ TCGA-EP-A26S-01,1,70.0,1
306
+ TCGA-EP-A26S-11,0,70.0,1
307
+ TCGA-EP-A2KA-01,1,52.0,0
308
+ TCGA-EP-A2KB-01,1,46.0,0
309
+ TCGA-EP-A2KC-01,1,62.0,1
310
+ TCGA-EP-A3JL-01,1,76.0,1
311
+ TCGA-EP-A3RK-01,1,73.0,1
312
+ TCGA-EP-A3RK-11,0,73.0,1
313
+ TCGA-ES-A2HS-01,1,80.0,1
314
+ TCGA-ES-A2HS-11,0,80.0,1
315
+ TCGA-ES-A2HT-01,1,54.0,1
316
+ TCGA-ES-A2HT-11,0,54.0,1
317
+ TCGA-FV-A23B-01,1,70.0,0
318
+ TCGA-FV-A23B-11,0,70.0,0
319
+ TCGA-FV-A2QQ-01,1,80.0,1
320
+ TCGA-FV-A2QR-01,1,75.0,1
321
+ TCGA-FV-A2QR-11,0,75.0,1
322
+ TCGA-FV-A3I0-01,1,76.0,0
323
+ TCGA-FV-A3I0-11,0,76.0,0
324
+ TCGA-FV-A3I1-01,1,81.0,0
325
+ TCGA-FV-A3I1-11,0,81.0,0
326
+ TCGA-FV-A3R2-01,1,75.0,1
327
+ TCGA-FV-A3R2-11,0,75.0,1
328
+ TCGA-FV-A3R3-01,1,38.0,0
329
+ TCGA-FV-A495-01,1,51.0,0
330
+ TCGA-FV-A496-01,1,84.0,0
331
+ TCGA-FV-A4ZP-01,1,78.0,1
332
+ TCGA-FV-A4ZQ-01,1,52.0,1
333
+ TCGA-G3-A25S-01,1,64.0,1
334
+ TCGA-G3-A25T-01,1,45.0,0
335
+ TCGA-G3-A25U-01,1,63.0,0
336
+ TCGA-G3-A25V-01,1,68.0,1
337
+ TCGA-G3-A25W-01,1,79.0,0
338
+ TCGA-G3-A25W-11,0,79.0,0
339
+ TCGA-G3-A25X-01,1,73.0,1
340
+ TCGA-G3-A25X-11,0,73.0,1
341
+ TCGA-G3-A25Y-01,1,52.0,0
342
+ TCGA-G3-A25Z-01,1,58.0,1
343
+ TCGA-G3-A3CG-01,1,80.0,1
344
+ TCGA-G3-A3CH-01,1,53.0,1
345
+ TCGA-G3-A3CH-11,0,53.0,1
346
+ TCGA-G3-A3CI-01,1,71.0,1
347
+ TCGA-G3-A3CJ-01,1,52.0,1
348
+ TCGA-G3-A3CK-01,1,61.0,1
349
+ TCGA-G3-A5SI-01,1,44.0,1
350
+ TCGA-G3-A5SJ-01,1,59.0,1
351
+ TCGA-G3-A5SK-01,1,58.0,1
352
+ TCGA-G3-A5SL-01,1,70.0,1
353
+ TCGA-G3-A5SM-01,1,58.0,1
354
+ TCGA-G3-A6UC-01,1,65.0,1
355
+ TCGA-G3-A7M5-01,1,76.0,1
356
+ TCGA-G3-A7M6-01,1,60.0,0
357
+ TCGA-G3-A7M7-01,1,65.0,1
358
+ TCGA-G3-A7M8-01,1,31.0,1
359
+ TCGA-G3-A7M9-01,1,70.0,1
360
+ TCGA-G3-AAUZ-01,1,48.0,1
361
+ TCGA-G3-AAV0-01,1,58.0,1
362
+ TCGA-G3-AAV1-01,1,51.0,1
363
+ TCGA-G3-AAV2-01,1,50.0,1
364
+ TCGA-G3-AAV3-01,1,58.0,0
365
+ TCGA-G3-AAV4-01,1,83.0,0
366
+ TCGA-G3-AAV5-01,1,67.0,1
367
+ TCGA-G3-AAV6-01,1,53.0,0
368
+ TCGA-G3-AAV7-01,1,38.0,1
369
+ TCGA-GJ-A3OU-01,1,59.0,1
370
+ TCGA-GJ-A6C0-01,1,75.0,0
371
+ TCGA-GJ-A9DB-01,1,68.0,1
372
+ TCGA-HP-A5MZ-01,1,78.0,1
373
+ TCGA-HP-A5N0-01,1,90.0,0
374
+ TCGA-K7-A5RF-01,1,64.0,1
375
+ TCGA-K7-A5RG-01,1,66.0,1
376
+ TCGA-K7-A6G5-01,1,66.0,1
377
+ TCGA-K7-AAU7-01,1,61.0,1
378
+ TCGA-KR-A7K0-01,1,65.0,1
379
+ TCGA-KR-A7K2-01,1,64.0,1
380
+ TCGA-KR-A7K7-01,1,61.0,0
381
+ TCGA-KR-A7K8-01,1,57.0,1
382
+ TCGA-LG-A6GG-01,1,79.0,0
383
+ TCGA-LG-A9QC-01,1,48.0,1
384
+ TCGA-LG-A9QD-01,1,68.0,1
385
+ TCGA-MI-A75C-01,1,64.0,1
386
+ TCGA-MI-A75E-01,1,61.0,1
387
+ TCGA-MI-A75G-01,1,63.0,1
388
+ TCGA-MI-A75H-01,1,77.0,1
389
+ TCGA-MI-A75I-01,1,61.0,1
390
+ TCGA-MR-A520-01,1,58.0,1
391
+ TCGA-MR-A8JO-01,1,34.0,1
392
+ TCGA-NI-A4U2-01,1,71.0,1
393
+ TCGA-NI-A8LF-01,1,74.0,1
394
+ TCGA-O8-A75V-01,1,54.0,1
395
+ TCGA-PD-A5DF-01,1,58.0,0
396
+ TCGA-QA-A7B7-01,1,48.0,1
397
+ TCGA-RC-A6M3-01,1,24.0,1
398
+ TCGA-RC-A6M4-01,1,74.0,0
399
+ TCGA-RC-A6M5-01,1,20.0,0
400
+ TCGA-RC-A6M6-01,1,75.0,1
401
+ TCGA-RC-A7S9-01,1,47.0,0
402
+ TCGA-RC-A7SB-01,1,53.0,1
403
+ TCGA-RC-A7SF-01,1,66.0,1
404
+ TCGA-RC-A7SH-01,1,42.0,1
405
+ TCGA-RC-A7SK-01,1,59.0,1
406
+ TCGA-RG-A7D4-01,1,69.0,1
407
+ TCGA-T1-A6J8-01,1,68.0,1
408
+ TCGA-UB-A7MA-01,1,62.0,0
409
+ TCGA-UB-A7MB-01,1,24.0,1
410
+ TCGA-UB-A7MC-01,1,59.0,1
411
+ TCGA-UB-A7MD-01,1,67.0,1
412
+ TCGA-UB-A7ME-01,1,51.0,1
413
+ TCGA-UB-A7MF-01,1,56.0,1
414
+ TCGA-UB-AA0U-01,1,60.0,1
415
+ TCGA-UB-AA0V-01,1,69.0,0
416
+ TCGA-WJ-A86L-01,1,68.0,0
417
+ TCGA-WQ-A9G7-01,1,71.0,0
418
+ TCGA-WQ-AB4B-01,1,62.0,1
419
+ TCGA-WX-AA44-01,1,64.0,0
420
+ TCGA-WX-AA46-01,1,61.0,1
421
+ TCGA-WX-AA47-01,1,33.0,0
422
+ TCGA-XR-A8TC-01,1,43.0,0
423
+ TCGA-XR-A8TD-01,1,49.0,0
424
+ TCGA-XR-A8TE-01,1,16.0,1
425
+ TCGA-XR-A8TF-01,1,74.0,1
426
+ TCGA-XR-A8TG-01,1,58.0,1
427
+ TCGA-YA-A8S7-01,1,68.0,1
428
+ TCGA-ZP-A9CV-01,1,59.0,1
429
+ TCGA-ZP-A9CY-01,1,66.0,0
430
+ TCGA-ZP-A9CZ-01,1,72.0,1
431
+ TCGA-ZP-A9D0-01,1,67.0,0
432
+ TCGA-ZP-A9D1-01,1,56.0,0
433
+ TCGA-ZP-A9D2-01,1,51.0,1
434
+ TCGA-ZP-A9D4-01,1,64.0,0
435
+ TCGA-ZS-A9CD-01,1,73.0,1
436
+ TCGA-ZS-A9CE-01,1,79.0,0
437
+ TCGA-ZS-A9CF-01,1,64.0,1
438
+ TCGA-ZS-A9CF-02,1,64.0,1
439
+ TCGA-ZS-A9CG-01,1,55.0,1
p3/preprocess/Liver_Cancer/code/GSE148346.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Liver_Cancer"
6
+ cohort = "GSE148346"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Liver_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Liver_Cancer/GSE148346"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Liver_Cancer/GSE148346.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Liver_Cancer/gene_data/GSE148346.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Liver_Cancer/clinical_data/GSE148346.csv"
16
+ json_path = "./output/preprocess/3/Liver_Cancer/cohort_info.json"
17
+
18
+ # Step 1: Get file paths
19
+ soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Step 2: Extract background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
23
+
24
+ # Step 3: Get dictionary of unique values for each clinical feature
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Step 4: Print background info and sample characteristics
28
+ print("Dataset Background Information:")
29
+ print("-" * 80)
30
+ print(background_info)
31
+ print("\nSample Characteristics:")
32
+ print("-" * 80)
33
+ print(json.dumps(unique_values_dict, indent=2))
34
+ # 1. Gene Expression Data Availability
35
+ # Based on the background information, this appears to be a biopsy study with gene expression analysis
36
+ is_gene_available = True
37
+
38
+ # 2. Variable Availability and Data Type Conversion
39
+ # For trait, we can use tissue disease state (key 3) which indicates lesional (LS) vs non-lesional (NL) liver tissue
40
+ trait_row = 3
41
+ def convert_trait(x: str) -> Optional[int]:
42
+ if not isinstance(x, str):
43
+ return None
44
+ value = x.split(': ')[-1]
45
+ if value == 'LS':
46
+ return 1 # Lesional
47
+ elif value == 'NL':
48
+ return 0 # Non-lesional
49
+ return None
50
+
51
+ # No age information available
52
+ age_row = None
53
+ convert_age = None
54
+
55
+ # No gender information available
56
+ gender_row = None
57
+ convert_gender = None
58
+
59
+ # 3. Save metadata
60
+ is_trait_available = trait_row is not None
61
+ _ = 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=is_trait_available
67
+ )
68
+
69
+ # 4. Clinical feature extraction
70
+ if trait_row is not None:
71
+ selected_clinical = 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 data
83
+ print(preview_df(selected_clinical))
84
+
85
+ # Save to file
86
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
87
+ selected_clinical.to_csv(out_clinical_data_file)
88
+ # 1. Extract gene expression data from matrix file
89
+ genetic_data = get_genetic_data(matrix_file_path)
90
+
91
+ # 2. Print first 20 row IDs
92
+ print("First 20 gene/probe identifiers:")
93
+ print(genetic_data.index[:20])
94
+ # Those are Affymetrix probe IDs (_at suffix is characteristic of Affy arrays)
95
+ # They need to be mapped to gene symbols for consistency and interpretability
96
+ requires_gene_mapping = True
97
+ # 1. Extract gene annotation data from SOFT file
98
+ gene_annotation = get_gene_annotation(soft_file_path)
99
+
100
+ # 2. Preview annotation data
101
+ print("Column names and first few values in gene annotation data:")
102
+ print(preview_df(gene_annotation))
103
+ # 1. Get gene mapping dataframe from annotation
104
+ mapping_df = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Gene Symbol')
105
+
106
+ # 2. Apply mapping to convert probe level data to gene level data
107
+ gene_data = apply_gene_mapping(genetic_data, mapping_df)
108
+
109
+ # Preview gene data
110
+ print("\nFirst 5 genes and 5 samples of gene expression data:")
111
+ print(gene_data.iloc[:5, :5])
112
+ # 1. Normalize gene symbols and save gene data
113
+ gene_data = normalize_gene_symbols_in_index(gene_data)
114
+ gene_data.to_csv(out_gene_data_file)
115
+
116
+ # 2. Link clinical and genetic data
117
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
118
+
119
+ # 3. Handle missing values
120
+ linked_data = handle_missing_values(linked_data, trait)
121
+
122
+ # 4. Judge if features are biased
123
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
124
+
125
+ # 5. Save cohort information
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=trait_biased,
133
+ df=linked_data,
134
+ note="Expression array data of NASH-HCC patients and NASH controls. No age/gender information available."
135
+ )
136
+
137
+ # 6. Save linked data if usable
138
+ if is_usable:
139
+ linked_data.to_csv(out_data_file)
p3/preprocess/Liver_Cancer/code/GSE164760.py ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Liver_Cancer"
6
+ cohort = "GSE164760"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Liver_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Liver_Cancer/GSE164760"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Liver_Cancer/GSE164760.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Liver_Cancer/gene_data/GSE164760.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Liver_Cancer/clinical_data/GSE164760.csv"
16
+ json_path = "./output/preprocess/3/Liver_Cancer/cohort_info.json"
17
+
18
+ # Step 1: Get file paths
19
+ soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Step 2: Extract background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
23
+
24
+ # Step 3: Get dictionary of unique values for each clinical feature
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Step 4: Print background info and sample characteristics
28
+ print("Dataset Background Information:")
29
+ print("-" * 80)
30
+ print(background_info)
31
+ print("\nSample Characteristics:")
32
+ print("-" * 80)
33
+ print(json.dumps(unique_values_dict, indent=2))
34
+ # 1. Gene Expression Data Availability
35
+ # According to the series title and summary, this dataset focuses on molecular characterization with expression arrays
36
+ is_gene_available = True
37
+
38
+ # 2.1 Data Availability
39
+ # - Trait (NASH-HCC vs non-tumoral) can be inferred from tissue type at row 0
40
+ trait_row = 0
41
+ # - Age is not available in sample characteristics
42
+ age_row = None
43
+ # - Gender is not available in sample characteristics
44
+ gender_row = None
45
+
46
+ # 2.2 Data Type Conversion Functions
47
+ def convert_trait(value: str) -> Optional[int]:
48
+ """Convert tissue type to binary trait value.
49
+ 1: NASH-HCC tumor (case)
50
+ 0: NASH liver, non-tumoral NASH liver (control)
51
+ None: Healthy liver, cirrhotic liver (excluded)
52
+ """
53
+ if not value or ':' not in value:
54
+ return None
55
+ tissue = value.split(':', 1)[1].strip().lower()
56
+ if 'nash-hcc tumor' in tissue:
57
+ return 1
58
+ elif 'nash liver' in tissue:
59
+ return 0
60
+ else:
61
+ return None
62
+
63
+ def convert_age(value: str) -> Optional[float]:
64
+ return None # Not used
65
+
66
+ def convert_gender(value: str) -> Optional[int]:
67
+ return None # Not used
68
+
69
+ # 3. Save Metadata
70
+ validate_and_save_cohort_info(
71
+ is_final=False,
72
+ cohort=cohort,
73
+ info_path=json_path,
74
+ is_gene_available=is_gene_available,
75
+ is_trait_available=(trait_row is not None)
76
+ )
77
+
78
+ # 4. Clinical Feature Extraction
79
+ if trait_row is not None:
80
+ clinical_data_processed = geo_select_clinical_features(
81
+ clinical_df=clinical_data,
82
+ trait=trait,
83
+ trait_row=trait_row,
84
+ convert_trait=convert_trait
85
+ )
86
+
87
+ # Preview the processed data
88
+ print("Preview of processed clinical data:")
89
+ print(preview_df(clinical_data_processed))
90
+
91
+ # Save to CSV
92
+ clinical_data_processed.to_csv(out_clinical_data_file)
93
+ # 1. Extract gene expression data from matrix file
94
+ genetic_data = get_genetic_data(matrix_file_path)
95
+
96
+ # 2. Print first 20 row IDs
97
+ print("First 20 gene/probe identifiers:")
98
+ print(genetic_data.index[:20])
99
+ # The identifiers in format '11715100_at' appear to be Affymetrix probeset IDs
100
+ # rather than standard human gene symbols. They will need to be mapped to gene symbols.
101
+ requires_gene_mapping = True
102
+ # 1. Extract gene annotation data from SOFT file
103
+ gene_annotation = get_gene_annotation(soft_file_path)
104
+
105
+ # 2. Preview annotation data
106
+ print("Column names and first few values in gene annotation data:")
107
+ print(preview_df(gene_annotation))
108
+ # 1. Identify columns for mapping
109
+ # In the annotation data, 'ID' contains the same probe IDs as in gene_expression data
110
+ # 'Gene Symbol' contains the corresponding gene symbols
111
+ prob_col = 'ID'
112
+ gene_col = 'Gene Symbol'
113
+
114
+ # 2. Get mapping between probe IDs and gene symbols
115
+ mapping_data = get_gene_mapping(gene_annotation, prob_col, gene_col)
116
+
117
+ # 3. Apply mapping to convert probe-level data to gene-level data
118
+ gene_data = apply_gene_mapping(genetic_data, mapping_data)
119
+ # 1. Normalize gene symbols and save gene data
120
+ gene_data = normalize_gene_symbols_in_index(gene_data)
121
+ gene_data.to_csv(out_gene_data_file)
122
+
123
+ # 2. Link clinical and genetic data
124
+ linked_data = geo_link_clinical_genetic_data(clinical_data_processed, gene_data)
125
+
126
+ # 3. Handle missing values
127
+ linked_data = handle_missing_values(linked_data, trait)
128
+
129
+ # 4. Judge if features are biased
130
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
131
+
132
+ # 5. Save cohort information
133
+ is_usable = validate_and_save_cohort_info(
134
+ is_final=True,
135
+ cohort=cohort,
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="Expression array data of NASH-HCC patients and NASH controls. No age/gender information available."
142
+ )
143
+
144
+ # 6. Save linked data if usable
145
+ if is_usable:
146
+ linked_data.to_csv(out_data_file)
p3/preprocess/Liver_Cancer/code/GSE174570.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Liver_Cancer"
6
+ cohort = "GSE174570"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Liver_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Liver_Cancer/GSE174570"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Liver_Cancer/GSE174570.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Liver_Cancer/gene_data/GSE174570.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Liver_Cancer/clinical_data/GSE174570.csv"
16
+ json_path = "./output/preprocess/3/Liver_Cancer/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Yes - using Affymetrix Human Genome U219 Array
34
+ is_gene_available = True
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # Disease state (trait) is in row 0, has two values (HCC vs control)
38
+ trait_row = 0
39
+
40
+ # Age and gender not available in characteristics
41
+ age_row = None
42
+ gender_row = None
43
+
44
+ # Convert disease state to binary (HCC = 1, Non-tumour/control = 0)
45
+ def convert_trait(value):
46
+ if not isinstance(value, str):
47
+ return None
48
+ value = value.lower().split(': ')[-1]
49
+ if 'hcc' in value:
50
+ return 1
51
+ return 0
52
+
53
+ def convert_age(value):
54
+ return None
55
+
56
+ def convert_gender(value):
57
+ return None
58
+
59
+ # 3. Save metadata
60
+ is_trait_available = trait_row is not None
61
+ validate_and_save_cohort_info(is_final=False,
62
+ cohort=cohort,
63
+ info_path=json_path,
64
+ is_gene_available=is_gene_available,
65
+ is_trait_available=is_trait_available)
66
+
67
+ # 4. Extract clinical features
68
+ if trait_row is not None:
69
+ selected_clinical = geo_select_clinical_features(clinical_data,
70
+ trait=trait,
71
+ trait_row=trait_row,
72
+ convert_trait=convert_trait,
73
+ age_row=age_row,
74
+ convert_age=convert_age,
75
+ gender_row=gender_row,
76
+ convert_gender=convert_gender)
77
+
78
+ print("Preview of selected clinical features:")
79
+ print(preview_df(selected_clinical))
80
+
81
+ selected_clinical.to_csv(out_clinical_data_file)
p3/preprocess/Liver_Cancer/code/GSE178201.py ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Liver_Cancer"
6
+ cohort = "GSE178201"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Liver_Cancer"
10
+ in_cohort_dir = "../DATA/GEO/Liver_Cancer/GSE178201"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Liver_Cancer/GSE178201.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Liver_Cancer/gene_data/GSE178201.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Liver_Cancer/clinical_data/GSE178201.csv"
16
+ json_path = "./output/preprocess/3/Liver_Cancer/cohort_info.json"
17
+
18
+ # Get file paths for soft and matrix files
19
+ soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Get background info and clinical data from matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file)
23
+
24
+ # Get unique values for each clinical feature row
25
+ clinical_features = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print(background_info)
30
+ print("\nClinical Features and Sample Values:")
31
+ print(json.dumps(clinical_features, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on background info, this dataset does contain gene expression data (L1000 platform)
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # Looking at sample characteristics, there is no trait (cancer status), age or gender info
38
+ # These are cell line experiments, not patient samples
39
+ trait_row = None
40
+ age_row = None
41
+ gender_row = None
42
+
43
+ # 2.2 Data Type Conversion Functions
44
+ # Not needed since we have no clinical data, but defining empty functions to satisfy interface
45
+ def convert_trait(x):
46
+ return None
47
+
48
+ def convert_age(x):
49
+ return None
50
+
51
+ def convert_gender(x):
52
+ return None
53
+
54
+ # 3. Save Metadata
55
+ # Initial filtering - trait data not available (cell lines)
56
+ _ = validate_and_save_cohort_info(
57
+ is_final=False,
58
+ cohort=cohort,
59
+ info_path=json_path,
60
+ is_gene_available=is_gene_available,
61
+ is_trait_available=False
62
+ )
63
+
64
+ # 4. Clinical Feature Extraction
65
+ # Skip since trait_row is None (no clinical data available)
66
+ # Extract gene expression data from matrix file
67
+ genetic_data = get_genetic_data(matrix_file)
68
+
69
+ # Print DataFrame info and dimensions to verify data structure
70
+ print("DataFrame info:")
71
+ print(genetic_data.info())
72
+ print("\nDataFrame dimensions:", genetic_data.shape)
73
+
74
+ # Print an excerpt of the data to inspect row/column structure
75
+ print("\nFirst few rows and columns of data:")
76
+ print(genetic_data.head().iloc[:, :5])
77
+
78
+ # Print first 20 row IDs
79
+ print("\nFirst 20 gene/probe IDs:")
80
+ print(genetic_data.index[:20].tolist())
81
+ # The row index values appear to be Entrez Gene IDs
82
+ # These are numerical identifiers that need to be mapped to human gene symbols
83
+ requires_gene_mapping = True
84
+ # Extract gene annotation data
85
+ gene_annotation = get_gene_annotation(soft_file)
86
+
87
+ # Preview the annotation data structure
88
+ print("Gene Annotation Preview:")
89
+ print("\nColumns:", gene_annotation.columns.tolist())
90
+ preview = preview_df(gene_annotation)
91
+ print(json.dumps(preview, indent=2))
92
+
93
+ # Get mapping between probe IDs and gene symbols
94
+ prob_col = 'ID' # Column containing probe IDs
95
+ gene_col = 'pr_gene_symbol' # Column containing gene symbols
96
+ mapping_df = get_gene_mapping(gene_annotation, prob_col, gene_col)
97
+
98
+ # Preview the mapping
99
+ print("\nGene Mapping Preview:")
100
+ mapping_preview = preview_df(mapping_df)
101
+ print(json.dumps(mapping_preview, indent=2))
102
+ # Apply gene mapping to convert probe IDs to gene symbols
103
+ gene_data = apply_gene_mapping(genetic_data, mapping_df)
104
+
105
+ # Print DataFrame info and preview to verify mapping result
106
+ print("Gene Expression Data After Mapping:")
107
+ print("\nDataFrame info:")
108
+ print(gene_data.info())
109
+ print("\nDataFrame dimensions:", gene_data.shape)
110
+ print("\nFirst few rows and columns:")
111
+ print(gene_data.head().iloc[:, :5])
112
+ print("\nFirst 20 gene symbols:")
113
+ print(gene_data.index[:20].tolist())
114
+ # 1. Normalize gene symbols and save gene data
115
+ gene_data = normalize_gene_symbols_in_index(gene_data)
116
+ gene_data.to_csv(out_gene_data_file)
117
+
118
+ # Create an empty DataFrame for mock validation
119
+ mock_df = pd.DataFrame({
120
+ trait: [0,1], # Mock trait values
121
+ 'GENE1': [0,0] # Mock gene values
122
+ })
123
+
124
+ # Mark dataset as not usable in final validation due to lack of trait data
125
+ is_usable = validate_and_save_cohort_info(
126
+ is_final=True,
127
+ cohort=cohort,
128
+ info_path=json_path,
129
+ is_gene_available=True,
130
+ is_trait_available=False,
131
+ is_biased=True, # Consider lack of trait data as biased
132
+ df=mock_df,
133
+ note="Cell line data without clinical trait information - not suitable for trait association analysis"
134
+ )
135
+
136
+ # No linked data to save since data is not usable