Liu-Hy commited on
Commit
06befd3
·
verified ·
1 Parent(s): 54d4d57

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 +22 -0
  2. p3/preprocess/Atherosclerosis/gene_data/GSE90074.csv +3 -0
  3. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE162635.csv +3 -0
  4. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE212331.csv +3 -0
  5. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE21359.csv +3 -0
  6. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE175616.csv +4 -0
  7. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE208662.csv +2 -0
  8. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE210272.csv +4 -0
  9. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE212331.csv +4 -0
  10. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE21359.csv +4 -0
  11. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE32030.csv +2 -0
  12. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE64593.csv +2 -0
  13. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE64599.csv +2 -0
  14. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE162635.py +151 -0
  15. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE175616.py +171 -0
  16. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE208662.py +157 -0
  17. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE210272.py +214 -0
  18. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE212331.py +167 -0
  19. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE21359.py +171 -0
  20. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE32030.py +176 -0
  21. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE64593.py +145 -0
  22. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE64599.py +154 -0
  23. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE84046.py +134 -0
  24. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/TCGA.py +35 -0
  25. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE162635.csv +3 -0
  26. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE175616.csv +0 -0
  27. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE208662.csv +0 -0
  28. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE210272.csv +1 -0
  29. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE212331.csv +3 -0
  30. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE21359.csv +3 -0
  31. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE32030.csv +3 -0
  32. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE64593.csv +0 -0
  33. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE64599.csv +0 -0
  34. p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE84046.csv +3 -0
  35. p3/preprocess/Fibromyalgia/GSE67311.csv +3 -0
  36. p3/preprocess/Fibromyalgia/clinical_data/GSE67311.csv +2 -0
  37. p3/preprocess/Fibromyalgia/code/GSE67311.py +174 -0
  38. p3/preprocess/Fibromyalgia/code/TCGA.py +29 -0
  39. p3/preprocess/Fibromyalgia/cohort_info.json +1 -0
  40. p3/preprocess/Fibromyalgia/gene_data/GSE67311.csv +3 -0
  41. p3/preprocess/Hypertension/GSE117261.csv +3 -0
  42. p3/preprocess/Hypertension/GSE128381.csv +3 -0
  43. p3/preprocess/Hypertension/GSE149256.csv +0 -0
  44. p3/preprocess/Hypertension/GSE151158.csv +0 -0
  45. p3/preprocess/Hypertension/GSE161533.csv +3 -0
  46. p3/preprocess/Hypertension/GSE181339.csv +0 -0
  47. p3/preprocess/Hypertension/GSE256539.csv +3 -0
  48. p3/preprocess/Hypertension/GSE71994.csv +3 -0
  49. p3/preprocess/Hypertension/GSE74144.csv +0 -0
  50. p3/preprocess/Hypertension/GSE77627.csv +3 -0
.gitattributes CHANGED
@@ -1760,3 +1760,25 @@ p3/preprocess/Hemochromatosis/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1760
  p3/preprocess/Atherosclerosis/gene_data/GSE57691.csv filter=lfs diff=lfs merge=lfs -text
1761
  p3/preprocess/Head_and_Neck_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1762
  p3/preprocess/Hemochromatosis/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1760
  p3/preprocess/Atherosclerosis/gene_data/GSE57691.csv filter=lfs diff=lfs merge=lfs -text
1761
  p3/preprocess/Head_and_Neck_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1762
  p3/preprocess/Hemochromatosis/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
1763
+ p3/preprocess/Atherosclerosis/gene_data/GSE90074.csv filter=lfs diff=lfs merge=lfs -text
1764
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE212331.csv filter=lfs diff=lfs merge=lfs -text
1765
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE21359.csv filter=lfs diff=lfs merge=lfs -text
1766
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE162635.csv filter=lfs diff=lfs merge=lfs -text
1767
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE84046.csv filter=lfs diff=lfs merge=lfs -text
1768
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE212331.csv filter=lfs diff=lfs merge=lfs -text
1769
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE21359.csv filter=lfs diff=lfs merge=lfs -text
1770
+ p3/preprocess/Hypertension/GSE128381.csv filter=lfs diff=lfs merge=lfs -text
1771
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE32030.csv filter=lfs diff=lfs merge=lfs -text
1772
+ p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE162635.csv filter=lfs diff=lfs merge=lfs -text
1773
+ p3/preprocess/Hypertension/GSE161533.csv filter=lfs diff=lfs merge=lfs -text
1774
+ p3/preprocess/Hypertension/GSE256539.csv filter=lfs diff=lfs merge=lfs -text
1775
+ p3/preprocess/Hypertension/GSE77627.csv filter=lfs diff=lfs merge=lfs -text
1776
+ p3/preprocess/Hypertension/GSE71994.csv filter=lfs diff=lfs merge=lfs -text
1777
+ p3/preprocess/Fibromyalgia/GSE67311.csv filter=lfs diff=lfs merge=lfs -text
1778
+ p3/preprocess/Fibromyalgia/gene_data/GSE67311.csv filter=lfs diff=lfs merge=lfs -text
1779
+ p3/preprocess/Hypertension/GSE117261.csv filter=lfs diff=lfs merge=lfs -text
1780
+ p3/preprocess/Hypertension/gene_data/GSE71994.csv filter=lfs diff=lfs merge=lfs -text
1781
+ p3/preprocess/Hypertension/gene_data/GSE128381.csv filter=lfs diff=lfs merge=lfs -text
1782
+ p3/preprocess/Hypertension/gene_data/GSE77627.csv filter=lfs diff=lfs merge=lfs -text
1783
+ p3/preprocess/Hypertension/gene_data/GSE117261.csv filter=lfs diff=lfs merge=lfs -text
1784
+ p3/preprocess/Hypertension/gene_data/GSE161533.csv filter=lfs diff=lfs merge=lfs -text
p3/preprocess/Atherosclerosis/gene_data/GSE90074.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:224d258e645e8bd8e27d1a587af1d76c984d1cfa8c52b622b453d856ab0b3f72
3
+ size 31441827
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE162635.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49d303a31c8ba1d6368ff378e87e6b815f32abf266e8d9751f3f4ea43b6e19b6
3
+ size 45984037
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE212331.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6066a5b8bd07cff45e504dd0131c29d77f948593e2ad8500981cb22d2df4b06
3
+ size 22262575
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/GSE21359.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba7450fc67ee50cb7c2d08f0b714336059d09cd9bb664432157a417c4b0f56e7
3
+ size 27474937
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE175616.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM5342551,GSM5342552,GSM5342553,GSM5342554,GSM5342555,GSM5342556,GSM5342557,GSM5342558,GSM5342559,GSM5342560,GSM5342561,GSM5342562,GSM5342563,GSM5342564,GSM5342565,GSM5342566,GSM5342567,GSM5342568,GSM5342569,GSM5342570,GSM5342571,GSM5342572,GSM5342573,GSM5342574,GSM5342575,GSM5342576,GSM5342577,GSM5342578,GSM5342579,GSM5342580,GSM5342581,GSM5342582,GSM5342583,GSM5342584,GSM5342585,GSM5342586,GSM5342587,GSM5342588,GSM5342589,GSM5342590,GSM5342591,GSM5342592,GSM5342593,GSM5342594,GSM5342595,GSM5342596,GSM5342597,GSM5342598,GSM5342599,GSM5342600,GSM5342601,GSM5342602,GSM5342603,GSM5342604,GSM5342605,GSM5342606,GSM5342607,GSM5342608,GSM5342609,GSM5342610,GSM5342611,GSM5342612,GSM5342613,GSM5342614,GSM5342615,GSM5342616,GSM5342617,GSM5342618,GSM5342619,GSM5342620,GSM5342621,GSM5342622,GSM5342623,GSM5342624,GSM5342625,GSM5342626,GSM5342627,GSM5342628,GSM5342629,GSM5342630,GSM5342631,GSM5342632,GSM5342633,GSM5342634,GSM5342635,GSM5342636,GSM5342637,GSM5342638,GSM5342639,GSM5342640,GSM5342641,GSM5342642,GSM5342643,GSM5342644,GSM5342645,GSM5342646,GSM5342647,GSM5342648,GSM5342649,GSM5342650,GSM5342651,GSM5342652,GSM5342653,GSM5342654,GSM5342655,GSM5342656,GSM5342657,GSM5342658,GSM5342659,GSM5342660,GSM5342661,GSM5342662,GSM5342663,GSM5342664,GSM5342665,GSM5342666,GSM5342667,GSM5342668,GSM5342669,GSM5342670,GSM5342671,GSM5342672,GSM5342673
2
+ Chronic_obstructive_pulmonary_disease_(COPD),1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
3
+ Age,35.0,35.0,35.0,63.0,63.0,63.0,50.0,50.0,50.0,60.0,60.0,60.0,52.0,52.0,52.0,45.0,45.0,45.0,71.0,71.0,71.0,46.0,46.0,46.0,65.0,52.0,52.0,52.0,45.0,45.0,45.0,46.0,46.0,46.0,52.0,52.0,52.0,52.0,52.0,52.0,53.0,53.0,53.0,47.0,47.0,44.0,44.0,44.0,55.0,55.0,55.0,54.0,54.0,54.0,48.0,48.0,48.0,51.0,51.0,51.0,37.0,37.0,58.0,58.0,58.0,52.0,52.0,52.0,54.0,54.0,54.0,54.0,54.0,54.0,56.0,56.0,56.0,51.0,51.0,51.0,38.0,38.0,38.0,48.0,48.0,48.0,45.0,45.0,45.0,64.0,64.0,69.0,69.0,69.0,38.0,38.0,38.0,66.0,66.0,66.0,66.0,66.0,66.0,57.0,57.0,57.0,72.0,72.0,72.0,49.0,49.0,49.0,57.0,57.0,63.0,63.0,63.0,50.0,50.0,50.0,55.0,55.0,55.0
4
+ Gender,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.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,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,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,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,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE208662.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM6360778,GSM6360779,GSM6360780,GSM6360781,GSM6360782,GSM6360783,GSM6360784,GSM6360785,GSM6360786,GSM6360787,GSM6360788,GSM6360789,GSM6360790,GSM6360791,GSM6360792,GSM6360793,GSM6360794,GSM6360795,GSM6360796,GSM6360797,GSM6360798,GSM6360799,GSM6360800,GSM6360801,GSM6360802,GSM6360803,GSM6360804,GSM6360805,GSM6360806,GSM6360807,GSM6360808,GSM6360809
2
+ Chronic_obstructive_pulmonary_disease_(COPD),1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE210272.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM6427241,GSM6427242,GSM6427243,GSM6427244,GSM6427245,GSM6427246,GSM6427247,GSM6427248,GSM6427249,GSM6427250,GSM6427251,GSM6427252,GSM6427253,GSM6427254,GSM6427255,GSM6427256,GSM6427257,GSM6427258,GSM6427259,GSM6427260,GSM6427261,GSM6427262,GSM6427263,GSM6427264,GSM6427265,GSM6427266,GSM6427267,GSM6427268,GSM6427269,GSM6427270,GSM6427271,GSM6427272,GSM6427273,GSM6427274,GSM6427275,GSM6427276,GSM6427277,GSM6427278,GSM6427279,GSM6427280,GSM6427281,GSM6427282,GSM6427283,GSM6427284,GSM6427285,GSM6427286,GSM6427287,GSM6427288,GSM6427289,GSM6427290,GSM6427291,GSM6427292,GSM6427293,GSM6427294,GSM6427295,GSM6427296,GSM6427297,GSM6427298,GSM6427299,GSM6427300,GSM6427301,GSM6427302,GSM6427303,GSM6427304,GSM6427305,GSM6427306,GSM6427307,GSM6427308,GSM6427309,GSM6427310,GSM6427311,GSM6427312,GSM6427313,GSM6427314,GSM6427315,GSM6427316,GSM6427317,GSM6427318,GSM6427319,GSM6427320,GSM6427321,GSM6427322,GSM6427323,GSM6427324,GSM6427325,GSM6427326,GSM6427327,GSM6427328,GSM6427329,GSM6427330,GSM6427331,GSM6427332,GSM6427333,GSM6427334,GSM6427335,GSM6427336,GSM6427337,GSM6427338,GSM6427339,GSM6427340,GSM6427341,GSM6427342,GSM6427343,GSM6427344,GSM6427345,GSM6427346,GSM6427347,GSM6427348,GSM6427349,GSM6427350,GSM6427351,GSM6427352,GSM6427353,GSM6427354,GSM6427355,GSM6427356,GSM6427357,GSM6427358,GSM6427359,GSM6427360,GSM6427361,GSM6427362,GSM6427363,GSM6427364,GSM6427365,GSM6427366,GSM6427367,GSM6427368,GSM6427369,GSM6427370,GSM6427371,GSM6427372,GSM6427373,GSM6427374,GSM6427375,GSM6427376,GSM6427377,GSM6427378,GSM6427379,GSM6427380,GSM6427381,GSM6427382,GSM6427383,GSM6427384,GSM6427385,GSM6427386,GSM6427387,GSM6427388,GSM6427389,GSM6427390,GSM6427391,GSM6427392,GSM6427393,GSM6427394,GSM6427395,GSM6427396,GSM6427397,GSM6427398,GSM6427399,GSM6427400,GSM6427401,GSM6427402,GSM6427403,GSM6427404,GSM6427405,GSM6427406,GSM6427407,GSM6427408,GSM6427409,GSM6427410,GSM6427411,GSM6427412,GSM6427413,GSM6427414,GSM6427415,GSM6427416,GSM6427417,GSM6427418,GSM6427419,GSM6427420,GSM6427421,GSM6427422,GSM6427423,GSM6427424,GSM6427425,GSM6427426,GSM6427427,GSM6427428,GSM6427429,GSM6427430,GSM6427431,GSM6427432,GSM6427433,GSM6427434,GSM6427435,GSM6427436,GSM6427437,GSM6427438,GSM6427439,GSM6427440,GSM6427441,GSM6427442,GSM6427443,GSM6427444,GSM6427445,GSM6427446,GSM6427447,GSM6427448,GSM6427449,GSM6427450,GSM6427451,GSM6427452,GSM6427453,GSM6427454,GSM6427455,GSM6427456,GSM6427457,GSM6427458,GSM6427459,GSM6427460,GSM6427461,GSM6427462,GSM6427463,GSM6427464,GSM6427465,GSM6427466,GSM6427467,GSM6427468,GSM6427469,GSM6427470,GSM6427471,GSM6427472,GSM6427473,GSM6427474,GSM6427475,GSM6427476,GSM6427477,GSM6427478
2
+ Chronic_obstructive_pulmonary_disease_(COPD),1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.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,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.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,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,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,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,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
3
+ Age,57.6,61.0,66.3,71.5,63.4,50.3,60.3,60.3,66.6,57.0,68.9,59.2,66.9,51.9,63.7,67.2,62.3,59.1,66.2,56.6,65.1,63.3,61.3,71.4,60.4,73.2,67.8,71.2,62.7,71.5,72.4,68.8,71.8,57.8,72.8,66.2,71.0,67.2,66.2,65.0,73.9,59.8,64.1,63.4,71.9,61.8,74.6,54.2,73.3,64.3,67.8,61.3,69.8,70.7,73.0,68.4,56.0,58.8,68.7,54.7,58.4,75.2,69.6,72.8,69.4,66.7,63.0,57.4,64.3,73.8,58.5,73.3,65.8,52.4,73.2,66.2,68.7,64.3,72.9,56.2,54.2,66.4,66.1,61.4,70.8,61.4,68.9,73.3,67.4,55.1,63.7,67.3,60.8,66.3,55.4,72.3,70.8,71.9,65.6,60.6,60.4,70.3,53.5,71.7,61.2,71.0,60.8,56.9,60.0,62.6,67.8,62.7,64.8,59.8,64.7,64.6,69.2,59.6,56.6,72.4,71.1,69.0,64.0,61.5,62.6,57.3,64.8,68.3,70.3,70.6,65.8,65.4,64.0,70.0,68.7,58.8,57.3,73.0,63.8,66.3,63.8,66.8,62.9,66.8,61.5,62.6,50.9,64.3,70.9,57.3,61.8,58.5,62.8,66.1,67.2,67.5,62.9,65.3,61.4,58.2,66.9,62.1,73.3,77.2,69.1,72.3,73.1,67.9,56.2,61.4,51.9,67.6,60.3,70.5,72.5,57.1,50.8,58.8,70.6,62.3,64.8,60.6,59.7,60.8,54.5,71.3,69.9,63.4,47.9,64.7,66.4,60.8,58.1,61.6,69.3,65.1,56.6,74.1,49.3,66.2,75.6,66.8,67.5,68.2,57.3,73.2,62.1,62.0,73.1,62.8,66.2,62.3,61.2,68.8,64.9,58.5,62.9,62.3,61.8,69.9,65.4,55.7,60.2,75.0,69.9,60.8,65.8,62.7,60.8,65.9,56.1,64.8,58.9,67.3,65.3,72.5,61.0,57.4
4
+ Gender,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,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.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,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,0.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,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.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,1.0,0.0,1.0,1.0,0.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,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE212331.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM6524456,GSM6524458,GSM6524459,GSM6524460,GSM6524462,GSM6524463,GSM6524465,GSM6524466,GSM6524468,GSM6524469,GSM6524470,GSM6524472,GSM6524473,GSM6524475,GSM6524476,GSM6524478,GSM6524479,GSM6524481,GSM6524482,GSM6524484,GSM6524485,GSM6524486,GSM6524488,GSM6524489,GSM6524490,GSM6524492,GSM6524493,GSM6524495,GSM6524496,GSM6524498,GSM6524499,GSM6524501,GSM6524502,GSM6524504,GSM6524505,GSM6524507,GSM6524508,GSM6524510,GSM6524511,GSM6524512,GSM6524514,GSM6524515,GSM6524517,GSM6524518,GSM6524520,GSM6524521,GSM6524523,GSM6524524,GSM6524525,GSM6524527,GSM6524528,GSM6524529,GSM6524531,GSM6524532,GSM6524534,GSM6524535,GSM6524537,GSM6524538,GSM6524540,GSM6524541,GSM6524543,GSM6524544,GSM6524545,GSM6524547,GSM6524548,GSM6524549,GSM6524551,GSM6524552,GSM6524554,GSM6524555,GSM6524557,GSM6524558,GSM6524560,GSM6524561,GSM6524563,GSM6524564,GSM6524566,GSM6524567,GSM6524568,GSM6524569,GSM6524571,GSM6524573,GSM6524574,GSM6524576,GSM6524577,GSM6524579,GSM6524580
2
+ Chronic_obstructive_pulmonary_disease_(COPD),1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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
3
+ Age,75.0,66.0,83.0,70.0,61.0,77.0,70.0,64.0,81.0,60.0,62.0,80.0,65.0,74.0,64.0,70.0,73.0,81.0,54.0,64.0,65.0,67.0,75.0,72.0,71.0,61.0,60.0,65.0,61.0,77.0,74.0,82.0,69.0,75.0,67.0,63.0,77.0,76.0,60.0,62.0,69.0,69.0,81.0,66.0,73.0,73.0,70.0,64.0,65.0,61.0,76.0,70.0,72.0,68.0,63.0,78.0,71.0,78.0,60.0,69.0,72.0,68.0,84.0,78.0,81.0,62.0,71.0,64.0,69.0,62.0,88.0,79.0,24.0,76.0,64.0,65.0,62.0,66.0,61.0,21.0,20.0,69.0,27.0,41.0,25.0,27.0,27.0
4
+ Gender,0.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.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,0.0,1.0,0.0,0.0,0.0,0.0,1.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,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE21359.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ ,GSM101095,GSM101096,GSM101097,GSM101098,GSM101100,GSM101101,GSM101102,GSM101103,GSM101104,GSM101105,GSM101106,GSM101107,GSM101111,GSM101113,GSM101114,GSM101115,GSM101116,GSM114089,GSM114090,GSM190149,GSM190150,GSM190151,GSM190152,GSM190153,GSM190154,GSM190155,GSM190156,GSM252828,GSM252829,GSM252830,GSM252831,GSM252833,GSM252835,GSM252836,GSM252837,GSM252838,GSM252839,GSM252841,GSM252871,GSM252876,GSM252879,GSM252880,GSM252881,GSM252882,GSM252884,GSM252885,GSM254149,GSM254150,GSM254151,GSM254152,GSM254157,GSM254158,GSM254159,GSM254160,GSM254161,GSM254163,GSM254169,GSM254172,GSM254173,GSM254174,GSM254175,GSM254176,GSM298219,GSM298220,GSM298221,GSM298222,GSM298223,GSM298224,GSM298225,GSM298226,GSM298227,GSM298228,GSM298229,GSM298230,GSM298231,GSM298232,GSM298233,GSM298234,GSM298235,GSM298236,GSM298237,GSM298238,GSM298239,GSM298240,GSM298241,GSM298242,GSM298243,GSM298244,GSM298245,GSM298246,GSM298247,GSM300859,GSM302396,GSM302397,GSM302399,GSM350871,GSM350873,GSM350874,GSM350955,GSM350956,GSM350957,GSM350958,GSM364037,GSM364038,GSM364041,GSM364045,GSM364046,GSM364048,GSM410161,GSM410162,GSM410163,GSM410164,GSM410165,GSM434049,GSM434050,GSM434051,GSM434052,GSM434053,GSM434054,GSM434055,GSM434056,GSM434057,GSM434058,GSM434059,GSM434060,GSM434061,GSM434062,GSM434063,GSM434064,GSM458579,GSM458580,GSM458581,GSM458582,GSM469991,GSM470000
2
+ Chronic_obstructive_pulmonary_disease_(COPD),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,1.0,0.0,0.0,0.0,0.0,0.0,0.0
3
+ Age,41.0,35.0,61.0,37.0,47.0,38.0,49.0,45.0,36.0,38.0,35.0,46.0,37.0,45.0,48.0,50.0,46.0,56.0,59.0,49.0,34.0,44.0,45.0,45.0,29.0,42.0,56.0,47.0,47.0,50.0,55.0,59.0,51.0,46.0,56.0,60.0,46.0,52.0,40.0,45.0,41.0,47.0,41.0,48.0,43.0,41.0,41.0,35.0,37.0,31.0,45.0,50.0,46.0,49.0,40.0,51.0,48.0,53.0,42.0,36.0,44.0,62.0,44.0,60.0,49.0,36.0,38.0,73.0,49.0,22.0,29.0,39.0,48.0,39.0,54.0,43.0,36.0,41.0,46.0,47.0,41.0,42.0,46.0,41.0,32.0,27.0,35.0,40.0,48.0,47.0,41.0,62.0,47.0,39.0,27.0,24.0,31.0,43.0,26.0,33.0,45.0,48.0,57.0,66.0,45.0,45.0,48.0,47.0,21.0,45.0,55.0,47.0,39.0,68.0,26.0,45.0,40.0,40.0,46.0,47.0,29.0,30.0,47.0,43.0,48.0,24.0,27.0,54.0,73.0,27.0,34.0,27.0,47.0,37.0,48.0
4
+ Gender,1.0,1.0,1.0,0.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,0.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,1.0,1.0,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,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.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,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE32030.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM549645,GSM549646,GSM549647,GSM549648,GSM549649,GSM549650,GSM549651,GSM549652,GSM549653,GSM549654,GSM549655,GSM549656,GSM549657,GSM549658,GSM549659,GSM549660,GSM549661,GSM549662,GSM549663,GSM549664,GSM549665,GSM549666,GSM549667,GSM549668,GSM549669,GSM549670,GSM549671,GSM549672,GSM549673,GSM549674,GSM549675,GSM549676,GSM549677,GSM549678,GSM549679,GSM549680,GSM549681,GSM549682,GSM549683,GSM549684,GSM549685,GSM549686,GSM549687,GSM549688,GSM549689,GSM549690,GSM549691,GSM549692,GSM549693,GSM549694,GSM549695,GSM549696,GSM549697,GSM549698,GSM549699,GSM549700,GSM549701,GSM549702,GSM549703,GSM549704,GSM549705,GSM549706,GSM549707,GSM549708,GSM549709,GSM549710,GSM549711,GSM549712,GSM549713,GSM549714,GSM549715,GSM549716,GSM549717,GSM549718,GSM549719,GSM549720,GSM549721,GSM549722,GSM549723,GSM549724,GSM549725,GSM549726,GSM549727,GSM549728,GSM549729,GSM549730,GSM549731,GSM549732,GSM549733,GSM549734,GSM549735,GSM549736,GSM549737,GSM549738,GSM549739,GSM549740,GSM549742,GSM549743,GSM549744,GSM549745,GSM549746,GSM549747,GSM549748,GSM549749,GSM549751,GSM549752,GSM549753,GSM549754,GSM549755,GSM549756,GSM549757,GSM549758,GSM549759,GSM549760,GSM549761,GSM549762,GSM549763,GSM549764,GSM549765,GSM549766,GSM549767,GSM549768,GSM549769,GSM549770,GSM549771,GSM549772,GSM549773,GSM549774,GSM549775,GSM549776,GSM549777,GSM549778,GSM549779,GSM549780,GSM549781,GSM549783,GSM549784,GSM549785,GSM549786,GSM549787,GSM549788,GSM549789,GSM549790,GSM549791,GSM549792,GSM549793,GSM549794,GSM549795,GSM549796,GSM549797,GSM549798,GSM549799,GSM549800,GSM549801,GSM549802,GSM549803,GSM549804,GSM549805,GSM549806,GSM549807,GSM549808,GSM549809,GSM549810,GSM549811,GSM549812,GSM549813,GSM549814,GSM549815,GSM549816,GSM549817,GSM549818,GSM549819,GSM549820,GSM549821,GSM569911,GSM569912,GSM569913,GSM569914,GSM569915,GSM569916,GSM569917,GSM569918,GSM569919,GSM569920,GSM569921,GSM569922,GSM569923,GSM569924,GSM569925,GSM569926,GSM599910,GSM599911,GSM599912,GSM599913,GSM599914,GSM599915,GSM599916,GSM599917,GSM599918,GSM599919,GSM599920,GSM599921,GSM631346,GSM631347,GSM631349,GSM631351,GSM631353,GSM631354,GSM631356,GSM631357,GSM631359,GSM631361,GSM631362,GSM631363,GSM631364,GSM631365,GSM631366,GSM631367,GSM631368,GSM631369,GSM631370,GSM631371,GSM631372,GSM631373,GSM631374,GSM631375,GSM631376,GSM631377,GSM631378,GSM631379,GSM631380,GSM631381,GSM631382,GSM631383,GSM631384,GSM631385,GSM631386,GSM631387,GSM631388,GSM631389,GSM631390,GSM631391,GSM794191,GSM794192,GSM794193,GSM794194,GSM794195,GSM794196,GSM794197,GSM794198,GSM794199,GSM794200,GSM794201,GSM794202,GSM794203,GSM794204,GSM794205,GSM794206,GSM794207,GSM794208,GSM794209,GSM794210,GSM794211,GSM794212,GSM794214,GSM794215,GSM794216,GSM794217,GSM794218,GSM794219
2
+ Chronic_obstructive_pulmonary_disease_(COPD),1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,,,,,,,,,,,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,,1.0,1.0,1.0,1.0,1.0,1.0,,1.0,1.0,1.0,,1.0,,1.0,,1.0,,,1.0,1.0,,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,,,,,,1.0,,,,,,,,,,,,,,,,,,,,,,,,,,,1.0,1.0,,1.0,,,1.0,1.0,1.0,1.0,1.0,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/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE64593.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1575085,GSM1575086,GSM1575087,GSM1575088,GSM1575089,GSM1575090,GSM1575091,GSM1575092,GSM1575093,GSM1575094,GSM1575095,GSM1575096,GSM1575097,GSM1575098,GSM1575099,GSM1575100,GSM1575101,GSM1575102,GSM1575103,GSM1575104,GSM1575105,GSM1575106,GSM1575107,GSM1575108,GSM1575109,GSM1575110,GSM1575111,GSM1575112,GSM1575113,GSM1575114,GSM1575115,GSM1575116,GSM1575117,GSM1575118
2
+ Chronic_obstructive_pulmonary_disease_(COPD),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
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE64599.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1575085,GSM1575086,GSM1575087,GSM1575088,GSM1575089,GSM1575090,GSM1575091,GSM1575092,GSM1575093,GSM1575094,GSM1575095,GSM1575096,GSM1575097,GSM1575098,GSM1575099,GSM1575100,GSM1575101,GSM1575102,GSM1575103,GSM1575104,GSM1575105,GSM1575106,GSM1575107,GSM1575108,GSM1575109,GSM1575110,GSM1575111,GSM1575112,GSM1575113,GSM1575114,GSM1575115,GSM1575116,GSM1575117,GSM1575118
2
+ Chronic_obstructive_pulmonary_disease_(COPD),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
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE162635.py ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE162635"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE162635"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE162635.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE162635.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE162635.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Yes, as the background info mentions gene expression profiling and analysis in lung tissue samples
34
+ is_gene_available = True
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # 2.1 Data Availability
38
+
39
+ # For trait (COPD): Found in field 2 as GOLD stages
40
+ trait_row = 2 # GOLD stages indicate COPD severity
41
+
42
+ # Age and gender not found in characteristics
43
+ age_row = None
44
+ gender_row = None
45
+
46
+ # 2.2 Data Type Conversion Functions
47
+
48
+ def convert_trait(value: str) -> int:
49
+ """Convert GOLD stages to binary COPD status"""
50
+ if value is None or not isinstance(value, str):
51
+ return None
52
+ # Extract value after colon and strip whitespace
53
+ value = value.split(':')[-1].strip().upper()
54
+ # Healthy = 0, any GOLD stage (O/I/II/III/IV) = 1
55
+ if value == 'HEALTHY':
56
+ return 0
57
+ elif value in ['O', 'I', 'II', 'III', 'IV']:
58
+ return 1
59
+ return None
60
+
61
+ # No need for age/gender conversion functions since data not available
62
+
63
+ # 3. Save metadata about dataset usability
64
+ is_usable = validate_and_save_cohort_info(
65
+ is_final=False,
66
+ cohort=cohort,
67
+ info_path=json_path,
68
+ is_gene_available=is_gene_available,
69
+ is_trait_available=trait_row is not None
70
+ )
71
+
72
+ # 4. Extract clinical features
73
+ if trait_row is not None:
74
+ selected_clinical_df = geo_select_clinical_features(
75
+ clinical_df=clinical_data,
76
+ trait=trait,
77
+ trait_row=trait_row,
78
+ convert_trait=convert_trait
79
+ )
80
+
81
+ # Preview the processed clinical data
82
+ preview = preview_df(selected_clinical_df)
83
+ print("Preview of processed clinical data:")
84
+ print(preview)
85
+
86
+ # Save to CSV
87
+ selected_clinical_df.to_csv(out_clinical_data_file)
88
+ # Extract gene expression data from matrix file
89
+ genetic_df = get_genetic_data(matrix_file)
90
+
91
+ # Print DataFrame shape and first 20 row IDs
92
+ print("DataFrame shape:", genetic_df.shape)
93
+ print("\nFirst 20 row IDs:")
94
+ print(genetic_df.index[:20])
95
+
96
+ print("\nPreview of first few rows and columns:")
97
+ print(genetic_df.head().iloc[:, :5])
98
+ # From the gene identifiers shown (e.g., '121_at', '1316_at', '1438_at', '1494_f_at'),
99
+ # these appear to be Affymetrix probe IDs rather than standard human gene symbols.
100
+ # They need to be mapped to proper gene symbols for analysis.
101
+ requires_gene_mapping = True
102
+ # Extract gene annotation data, excluding control probe lines
103
+ gene_metadata = get_gene_annotation(soft_file)
104
+
105
+ # Preview filtered annotation data
106
+ print("Column names:")
107
+ print(gene_metadata.columns)
108
+ print("\nPreview of gene annotation data:")
109
+ print(preview_df(gene_metadata))
110
+ # Extract mapping between probe IDs and gene symbols
111
+ mapping_data = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Gene Symbol')
112
+
113
+ # Apply gene mapping to convert probe-level data to gene-level data
114
+ gene_data = apply_gene_mapping(genetic_df, mapping_data)
115
+
116
+ print("\nGene data shape:", gene_data.shape)
117
+ print("\nFirst few rows and columns of gene data:")
118
+ print(gene_data.head().iloc[:, :5])
119
+ # 1. Normalize gene symbols and save
120
+ gene_data = normalize_gene_symbols_in_index(gene_data)
121
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
122
+ gene_data.to_csv(out_gene_data_file)
123
+
124
+ # Load previously saved clinical data
125
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
126
+
127
+ # 2. Link clinical and genetic data
128
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
129
+
130
+ # 3. Handle missing values
131
+ linked_data = handle_missing_values(linked_data, trait)
132
+
133
+ # 4. Check for biased features
134
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
135
+
136
+ # 5. Final validation and metadata saving
137
+ is_usable = validate_and_save_cohort_info(
138
+ is_final=True,
139
+ cohort=cohort,
140
+ info_path=json_path,
141
+ is_gene_available=is_gene_available,
142
+ is_trait_available=True,
143
+ is_biased=trait_biased,
144
+ df=linked_data,
145
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD"
146
+ )
147
+
148
+ # 6. Save linked data if usable
149
+ if is_usable:
150
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
151
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE175616.py ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE175616"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE175616"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE175616.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE175616.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE175616.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on Series_summary and Series_title, this appears to be gene expression data from nasal epithelium
34
+ # studying gene signatures, not just miRNA or methylation
35
+ is_gene_available = True
36
+
37
+ # 2.1 Data Availability
38
+ # Since these are all current smokers (based on Series_summary and characteristics row 7),
39
+ # we can use this cohort to study COPD. The smoking status is a good proxy for COPD risk.
40
+ trait_row = 7
41
+
42
+ # Age information available in row 6
43
+ age_row = 6
44
+
45
+ # Gender information available in row 5
46
+ gender_row = 5
47
+
48
+ # 2.2 Data Type Conversion Functions
49
+ def convert_trait(value):
50
+ if not value:
51
+ return None
52
+ # All subjects are current smokers, which is a risk factor for COPD
53
+ if "current smoker" in value.lower():
54
+ return 1
55
+ return None
56
+
57
+ def convert_age(value):
58
+ if not value:
59
+ return None
60
+ try:
61
+ # Extract number after "age: "
62
+ age = int(value.split(": ")[1])
63
+ return age
64
+ except:
65
+ return None
66
+
67
+ def convert_gender(value):
68
+ if not value:
69
+ return None
70
+ # Extract value after "Sex: "
71
+ gender = value.split(": ")[1].lower()
72
+ if "female" in gender:
73
+ return 0
74
+ elif "male" in gender:
75
+ return 1
76
+ return None
77
+
78
+ # 3. Save initial metadata
79
+ validate_and_save_cohort_info(is_final=False,
80
+ cohort=cohort,
81
+ info_path=json_path,
82
+ is_gene_available=is_gene_available,
83
+ is_trait_available=trait_row is not None)
84
+
85
+ # 4. Clinical Feature Extraction
86
+ # Since trait_row is not None, extract clinical features
87
+ selected_clinical_df = geo_select_clinical_features(clinical_df=clinical_data,
88
+ trait=trait,
89
+ trait_row=trait_row,
90
+ convert_trait=convert_trait,
91
+ age_row=age_row,
92
+ convert_age=convert_age,
93
+ gender_row=gender_row,
94
+ convert_gender=convert_gender)
95
+
96
+ # Preview the extracted features
97
+ preview_result = preview_df(selected_clinical_df)
98
+ print("Preview of clinical features:")
99
+ print(preview_result)
100
+
101
+ # Save to CSV
102
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
103
+ selected_clinical_df.to_csv(out_clinical_data_file)
104
+ # Extract gene expression data from matrix file
105
+ genetic_df = get_genetic_data(matrix_file)
106
+
107
+ # Print DataFrame shape and first 20 row IDs
108
+ print("DataFrame shape:", genetic_df.shape)
109
+ print("\nFirst 20 row IDs:")
110
+ print(genetic_df.index[:20])
111
+
112
+ print("\nPreview of first few rows and columns:")
113
+ print(genetic_df.head().iloc[:, :5])
114
+ # These identifiers end with "_at" which indicates they are Affymetrix probe IDs
115
+ # They need to be mapped to human gene symbols for proper analysis
116
+ requires_gene_mapping = True
117
+ # Extract gene annotation data
118
+ gene_metadata = get_gene_annotation(soft_file)
119
+
120
+ # Preview the data
121
+ print("Column names:")
122
+ print(gene_metadata.columns)
123
+ print("\nPreview of first few gene annotations including all columns:")
124
+ print(gene_metadata.head().to_dict('list'))
125
+ # 1. From column names, 'ID' contains probe IDs (matching gene expression data)
126
+ # From DESCRIPTION field, it contains human gene symbols
127
+ # So we will use ID and DESCRIPTION for mapping
128
+
129
+ # 2. Extract probe ID and gene symbol columns
130
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='DESCRIPTION')
131
+
132
+ # 3. Convert probe measurements to gene expression using the mapping
133
+ # This handles probes mapping to multiple genes by dividing values equally
134
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
135
+
136
+ # Save gene expression data
137
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
138
+ gene_data.to_csv(out_gene_data_file)
139
+ # 1. Normalize gene symbols and save
140
+ gene_data = normalize_gene_symbols_in_index(gene_data)
141
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
142
+ gene_data.to_csv(out_gene_data_file)
143
+
144
+ # Load previously saved clinical data
145
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
146
+
147
+ # 2. Link clinical and genetic data
148
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
149
+
150
+ # 3. Handle missing values
151
+ linked_data = handle_missing_values(linked_data, trait)
152
+
153
+ # 4. Check for biased features
154
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
155
+
156
+ # 5. Final validation and metadata saving
157
+ is_usable = validate_and_save_cohort_info(
158
+ is_final=True,
159
+ cohort=cohort,
160
+ info_path=json_path,
161
+ is_gene_available=is_gene_available,
162
+ is_trait_available=True,
163
+ is_biased=trait_biased,
164
+ df=linked_data,
165
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD"
166
+ )
167
+
168
+ # 6. Save linked data if usable
169
+ if is_usable:
170
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
171
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE208662.py ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE208662"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE208662"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE208662.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE208662.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE208662.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the series title and summary mentioning gene expression microarray analysis
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # Trait (COPD status) is in row 0 with binary values (COPD-IV vs control)
38
+ trait_row = 0
39
+
40
+ # Age and gender are not recorded in the characteristics
41
+ age_row = None
42
+ gender_row = None
43
+
44
+ # 2.2 Data Type Conversion Functions
45
+ def convert_trait(x):
46
+ if x is None:
47
+ return None
48
+ # Extract value after colon and strip whitespace
49
+ value = x.split(':')[1].strip().lower()
50
+ # Convert to binary: 1 for COPD-IV, 0 for control
51
+ if 'copd-iv' in value:
52
+ return 1
53
+ elif 'control' in value:
54
+ return 0
55
+ return None
56
+
57
+ def convert_age(x):
58
+ return None # Not available
59
+
60
+ def convert_gender(x):
61
+ return None # Not available
62
+
63
+ # 3. Save Metadata - Initial Filtering
64
+ is_trait_available = trait_row is not None
65
+ validate_and_save_cohort_info(is_final=False,
66
+ cohort=cohort,
67
+ info_path=json_path,
68
+ is_gene_available=is_gene_available,
69
+ is_trait_available=is_trait_available)
70
+
71
+ # 4. Clinical Feature Extraction
72
+ if trait_row is not None:
73
+ # Extract clinical features
74
+ clinical_features = geo_select_clinical_features(
75
+ clinical_df=clinical_data,
76
+ trait=trait,
77
+ trait_row=trait_row,
78
+ convert_trait=convert_trait,
79
+ age_row=age_row,
80
+ convert_age=convert_age,
81
+ gender_row=gender_row,
82
+ convert_gender=convert_gender
83
+ )
84
+
85
+ # Preview the extracted features
86
+ print(preview_df(clinical_features))
87
+
88
+ # Save to CSV
89
+ clinical_features.to_csv(out_clinical_data_file)
90
+ # Extract gene expression data from matrix file
91
+ genetic_df = get_genetic_data(matrix_file)
92
+
93
+ # Print DataFrame shape and first 20 row IDs
94
+ print("DataFrame shape:", genetic_df.shape)
95
+ print("\nFirst 20 row IDs:")
96
+ print(genetic_df.index[:20])
97
+
98
+ print("\nPreview of first few rows and columns:")
99
+ print(genetic_df.head().iloc[:, :5])
100
+ # These appear to be probe IDs from the Affymetrix Clariom S Human platform
101
+ # They are not standard human gene symbols and will need to be mapped
102
+ requires_gene_mapping = True
103
+ # Extract gene annotation data, excluding control probe lines
104
+ gene_metadata = get_gene_annotation(soft_file)
105
+
106
+ # Preview filtered annotation data
107
+ print("Column names:")
108
+ print(gene_metadata.columns)
109
+ print("\nPreview of gene annotation data:")
110
+ print(preview_df(gene_metadata))
111
+ # Extract gene symbols from the long description in SPOT_ID.1 column
112
+ gene_metadata['Gene_Symbol'] = gene_metadata['SPOT_ID.1'].apply(extract_human_gene_symbols)
113
+ gene_metadata['Gene_Symbol'] = gene_metadata['Gene_Symbol'].apply(lambda x: x[0] if isinstance(x, list) and len(x) > 0 else None)
114
+
115
+ # Create mapping dataframe between probe IDs and gene symbols
116
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Gene_Symbol')
117
+
118
+ # Convert probe-level measurements to gene expression data
119
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
120
+
121
+ # Preview the results
122
+ print("Gene Expression Data Shape:", gene_data.shape)
123
+ print("\nPreview of Gene Expression Data:")
124
+ print(preview_df(gene_data))
125
+ # 1. Normalize gene symbols and save
126
+ gene_data = normalize_gene_symbols_in_index(gene_data)
127
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
128
+ gene_data.to_csv(out_gene_data_file)
129
+
130
+ # Load previously saved clinical data
131
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
132
+
133
+ # 2. Link clinical and genetic data
134
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
135
+
136
+ # 3. Handle missing values
137
+ linked_data = handle_missing_values(linked_data, trait)
138
+
139
+ # 4. Check for biased features
140
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
141
+
142
+ # 5. Final validation and metadata saving
143
+ is_usable = validate_and_save_cohort_info(
144
+ is_final=True,
145
+ cohort=cohort,
146
+ info_path=json_path,
147
+ is_gene_available=is_gene_available,
148
+ is_trait_available=True,
149
+ is_biased=trait_biased,
150
+ df=linked_data,
151
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD"
152
+ )
153
+
154
+ # 6. Save linked data if usable
155
+ if is_usable:
156
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
157
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE210272.py ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE210272"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE210272"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE210272.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE210272.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE210272.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on background info, this dataset uses Affymetrix Human Gene Arrays for mRNA expression profiling
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # COPD can be inferred from FEV1% predicted values - FEV1 < 80% indicates COPD
38
+ trait_row = 4 # fev1 % predicted row
39
+ age_row = 2 # age row
40
+ gender_row = 1 # Sex row
41
+
42
+ # 2.2 Data Type Conversion Functions
43
+ def convert_trait(value):
44
+ # Extract numeric FEV1 value after colon
45
+ try:
46
+ fev1 = float(value.split(': ')[1])
47
+ # FEV1 < 80% indicates COPD
48
+ return 1 if fev1 < 80 else 0
49
+ except:
50
+ return None
51
+
52
+ def convert_age(value):
53
+ try:
54
+ # Extract numeric age after colon
55
+ return float(value.split(': ')[1])
56
+ except:
57
+ return None
58
+
59
+ def convert_gender(value):
60
+ try:
61
+ # Extract gender after colon and convert to binary
62
+ gender = value.split(': ')[1].lower()
63
+ if 'female' in gender:
64
+ return 0
65
+ elif 'male' in gender:
66
+ return 1
67
+ return None
68
+ except:
69
+ return None
70
+
71
+ # 3. Save Metadata
72
+ is_trait_available = trait_row is not None
73
+ validate_and_save_cohort_info(is_final=False,
74
+ cohort=cohort,
75
+ info_path=json_path,
76
+ is_gene_available=is_gene_available,
77
+ is_trait_available=is_trait_available)
78
+
79
+ # 4. Extract Clinical Features
80
+ clinical_features_df = geo_select_clinical_features(clinical_data,
81
+ trait=trait,
82
+ trait_row=trait_row,
83
+ convert_trait=convert_trait,
84
+ age_row=age_row,
85
+ convert_age=convert_age,
86
+ gender_row=gender_row,
87
+ convert_gender=convert_gender)
88
+
89
+ # Preview the extracted features
90
+ preview = preview_df(clinical_features_df)
91
+ print("Preview of clinical features:")
92
+ print(preview)
93
+
94
+ # Save clinical features
95
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
96
+ clinical_features_df.to_csv(out_clinical_data_file)
97
+ # Extract gene expression data from matrix file
98
+ genetic_df = get_genetic_data(matrix_file)
99
+
100
+ # Print DataFrame shape and first 20 row IDs
101
+ print("DataFrame shape:", genetic_df.shape)
102
+ print("\nFirst 20 row IDs:")
103
+ print(genetic_df.index[:20])
104
+
105
+ print("\nPreview of first few rows and columns:")
106
+ print(genetic_df.head().iloc[:, :5])
107
+ # ENSG identifiers are Ensembl gene IDs, not gene symbols, so they need mapping
108
+ requires_gene_mapping = True
109
+ # Extract gene annotation data, excluding control probe lines
110
+ gene_metadata = get_gene_annotation(soft_file)
111
+
112
+ # Preview filtered annotation data
113
+ print("Column names:")
114
+ print(gene_metadata.columns)
115
+ print("\nPreview of gene annotation data:")
116
+ print(preview_df(gene_metadata))
117
+
118
+ print("\nNote: The annotation data contains Ensembl gene IDs in the 'ORF' column, which can be used for mapping to gene symbols")
119
+ # 1. Read the SOFT file first to see its content
120
+ with gzip.open(soft_file, 'rt') as f:
121
+ for i, line in enumerate(f):
122
+ if i < 10: # Preview first 10 lines
123
+ print(line.strip())
124
+ if i > 10:
125
+ break
126
+
127
+ # 2. Get gene annotation with additional prefixes to capture platform info
128
+ prefixes = ['^', '!', '#', '!Platform_organism', '!Platform_title', '!Platform_technology']
129
+ gene_metadata = get_gene_annotation(soft_file, prefixes)
130
+
131
+ print("\nColumns in gene metadata:")
132
+ print(gene_metadata.columns.tolist())
133
+ print("\nFirst few rows:")
134
+ print(gene_metadata.head().to_string())
135
+
136
+ # 3. Since the SOFT file format is complex, let's write a custom parser
137
+ def parse_gene_info(soft_file):
138
+ gene_info = []
139
+ capture = False
140
+ with gzip.open(soft_file, 'rt') as f:
141
+ for line in f:
142
+ if line.startswith('^PLATFORM'):
143
+ capture = True
144
+ continue
145
+ if line.startswith('!platform_table_end'):
146
+ break
147
+ if capture and line.startswith('!'):
148
+ continue
149
+ if capture and not line.startswith('#') and len(line.strip()) > 0:
150
+ parts = line.strip().split('\t')
151
+ if len(parts) >= 2:
152
+ gene_info.append(parts)
153
+ return pd.DataFrame(gene_info[1:], columns=gene_info[0])
154
+
155
+ gene_metadata = parse_gene_info(soft_file)
156
+ print("\nColumns from custom parser:")
157
+ print(gene_metadata.columns.tolist())
158
+ print("\nFirst few rows from custom parser:")
159
+ print(gene_metadata.head().to_string())
160
+
161
+ # 4. Now proceed with mapping after confirming which columns to use
162
+ mapping_df = pd.DataFrame({
163
+ 'ID': genetic_df.index,
164
+ 'Gene': [x.split('_')[0] for x in genetic_df.index] # Extract ENSG ID without '_at'
165
+ })
166
+
167
+ # 5. Map probes to genes and aggregate values
168
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
169
+
170
+ # 6. Normalize gene symbols
171
+ gene_data = normalize_gene_symbols_in_index(gene_data)
172
+
173
+ print("\nShape of gene expression data after mapping:", gene_data.shape)
174
+ print("\nFirst few gene symbols after mapping:")
175
+ print(gene_data.index[:10])
176
+ print("\nPreview of gene expression values:")
177
+ print(gene_data.head().iloc[:, :5])
178
+
179
+ # Save gene expression data
180
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
181
+ gene_data.to_csv(out_gene_data_file)
182
+ # Load previously saved clinical data
183
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
184
+
185
+ # Link clinical and genetic data using original ENSEMBL IDs
186
+ linked_data = pd.concat([selected_clinical, gene_data]).T
187
+
188
+ # Handle missing values
189
+ linked_data = handle_missing_values(linked_data, trait)
190
+
191
+ # Check for biased features
192
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
193
+
194
+ # Final validation and metadata saving
195
+ is_usable = validate_and_save_cohort_info(
196
+ is_final=True,
197
+ cohort=cohort,
198
+ info_path=json_path,
199
+ is_gene_available=is_gene_available,
200
+ is_trait_available=True,
201
+ is_biased=trait_biased,
202
+ df=linked_data,
203
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD. Using ENSEMBL gene IDs."
204
+ )
205
+
206
+ # Save data files if usable
207
+ if is_usable:
208
+ # Save gene data separately
209
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
210
+ gene_data.to_csv(out_gene_data_file)
211
+
212
+ # Save linked data
213
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
214
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE212331.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE212331"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE212331"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE212331.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE212331.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE212331.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # The series summary mentions generating gene expression profiles from sputum samples
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # trait - available in disease group (row 1)
38
+ # age - available in age (row 3)
39
+ # gender - available in gender (row 4)
40
+ trait_row = 1
41
+ age_row = 3
42
+ gender_row = 4
43
+
44
+ # 2.2 Data Type Conversion Functions
45
+ def convert_trait(x):
46
+ """Convert COPD/Control status to binary"""
47
+ if not x or ':' not in x:
48
+ return None
49
+ value = x.split(':')[1].strip().lower()
50
+ if 'copd' in value:
51
+ return 1
52
+ elif 'control' in value or 'healthy' in value:
53
+ return 0
54
+ return None
55
+
56
+ def convert_age(x):
57
+ """Convert age to continuous value"""
58
+ if not x or ':' not in x:
59
+ return None
60
+ try:
61
+ return float(x.split(':')[1].strip())
62
+ except:
63
+ return None
64
+
65
+ def convert_gender(x):
66
+ """Convert gender to binary (0=female, 1=male)"""
67
+ if not x or ':' not in x:
68
+ return None
69
+ value = x.split(':')[1].strip().lower()
70
+ if 'female' in value:
71
+ return 0
72
+ elif 'male' in value:
73
+ return 1
74
+ return None
75
+
76
+ # 3. Save Metadata
77
+ validate_and_save_cohort_info(
78
+ is_final=False,
79
+ cohort=cohort,
80
+ info_path=json_path,
81
+ is_gene_available=is_gene_available,
82
+ is_trait_available=(trait_row is not None)
83
+ )
84
+
85
+ # 4. Clinical Feature Extraction
86
+ clinical_features = geo_select_clinical_features(
87
+ clinical_df=clinical_data,
88
+ trait=trait,
89
+ trait_row=trait_row,
90
+ convert_trait=convert_trait,
91
+ age_row=age_row,
92
+ convert_age=convert_age,
93
+ gender_row=gender_row,
94
+ convert_gender=convert_gender
95
+ )
96
+
97
+ print("Preview of extracted clinical features:")
98
+ print(preview_df(clinical_features))
99
+
100
+ # Save clinical features
101
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
102
+ clinical_features.to_csv(out_clinical_data_file)
103
+ # Extract gene expression data from matrix file
104
+ genetic_df = get_genetic_data(matrix_file)
105
+
106
+ # Print DataFrame shape and first 20 row IDs
107
+ print("DataFrame shape:", genetic_df.shape)
108
+ print("\nFirst 20 row IDs:")
109
+ print(genetic_df.index[:20])
110
+
111
+ print("\nPreview of first few rows and columns:")
112
+ print(genetic_df.head().iloc[:, :5])
113
+ # IDs beginning with 'ILMN_' indicate these are Illumina probe IDs, not gene symbols
114
+ requires_gene_mapping = True
115
+ # Extract gene annotation data, excluding control probe lines
116
+ gene_metadata = get_gene_annotation(soft_file)
117
+
118
+ # Preview filtered annotation data
119
+ print("Column names:")
120
+ print(gene_metadata.columns)
121
+ print("\nPreview of gene annotation data:")
122
+ print(preview_df(gene_metadata))
123
+ # Get mapping between probe IDs and gene symbols
124
+ # The 'ID' column in annotation matches the probe IDs in expression data
125
+ # The 'Symbol' column contains gene symbols
126
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Symbol')
127
+
128
+ # Apply the mapping to convert probe-level data to gene expression data
129
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
130
+
131
+ # Print shape and preview to verify the mapping result
132
+ print("Gene expression data shape:", gene_data.shape)
133
+ print("\nPreview of gene expression data:")
134
+ print(gene_data.head().iloc[:, :5])
135
+ # 1. Normalize gene symbols and save
136
+ gene_data = normalize_gene_symbols_in_index(gene_data)
137
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
138
+ gene_data.to_csv(out_gene_data_file)
139
+
140
+ # Load previously saved clinical data
141
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
142
+
143
+ # 2. Link clinical and genetic data
144
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
145
+
146
+ # 3. Handle missing values
147
+ linked_data = handle_missing_values(linked_data, trait)
148
+
149
+ # 4. Check for biased features
150
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
151
+
152
+ # 5. Final validation and metadata saving
153
+ is_usable = validate_and_save_cohort_info(
154
+ is_final=True,
155
+ cohort=cohort,
156
+ info_path=json_path,
157
+ is_gene_available=is_gene_available,
158
+ is_trait_available=True,
159
+ is_biased=trait_biased,
160
+ df=linked_data,
161
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD"
162
+ )
163
+
164
+ # 6. Save linked data if usable
165
+ if is_usable:
166
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
167
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE21359.py ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE21359"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE21359"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE21359.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE21359.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE21359.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Check gene expression data availability
33
+ # From background info, this is an Affymetrix array gene expression study
34
+ is_gene_available = True
35
+
36
+ # 2. Variable availability and data type conversion
37
+ # 2.1 Check availability and identify rows
38
+ trait_row = 3 # Smoking status row contains COPD info
39
+ age_row = 0 # Age data available
40
+ gender_row = 1 # Gender data available
41
+
42
+ # 2.2 Define conversion functions
43
+ def convert_trait(x: str) -> float:
44
+ """Convert trait values to binary: 1 for COPD, 0 for non-COPD"""
45
+ if pd.isna(x):
46
+ return None
47
+ value = x.split(": ")[-1].lower()
48
+ if "copd" in value:
49
+ return 1.0
50
+ elif "non-smoker" in value or "smoker" in value and "copd" not in value:
51
+ return 0.0
52
+ return None
53
+
54
+ def convert_age(x: str) -> float:
55
+ """Convert age to continuous values"""
56
+ if pd.isna(x):
57
+ return None
58
+ try:
59
+ # Extract number after colon and convert to float
60
+ return float(x.split(": ")[-1])
61
+ except:
62
+ return None
63
+
64
+ def convert_gender(x: str) -> float:
65
+ """Convert gender to binary: 0 for female, 1 for male"""
66
+ if pd.isna(x):
67
+ return None
68
+ value = x.split(": ")[-1].lower()
69
+ if value == 'f':
70
+ return 0.0
71
+ elif value == 'm':
72
+ return 1.0
73
+ return None
74
+
75
+ # 3. Save metadata for initial filtering
76
+ validate_and_save_cohort_info(
77
+ is_final=False,
78
+ cohort=cohort,
79
+ info_path=json_path,
80
+ is_gene_available=is_gene_available,
81
+ is_trait_available=True
82
+ )
83
+
84
+ # 4. Extract clinical features
85
+ clinical_df = geo_select_clinical_features(
86
+ clinical_df=clinical_data,
87
+ trait=trait,
88
+ trait_row=trait_row,
89
+ convert_trait=convert_trait,
90
+ age_row=age_row,
91
+ convert_age=convert_age,
92
+ gender_row=gender_row,
93
+ convert_gender=convert_gender
94
+ )
95
+
96
+ # Preview the extracted features
97
+ preview_result = preview_df(clinical_df)
98
+ print("Preview of clinical features:")
99
+ print(preview_result)
100
+
101
+ # Save clinical data
102
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
103
+ clinical_df.to_csv(out_clinical_data_file)
104
+ # Extract gene expression data from matrix file
105
+ genetic_df = get_genetic_data(matrix_file)
106
+
107
+ # Print DataFrame shape and first 20 row IDs
108
+ print("DataFrame shape:", genetic_df.shape)
109
+ print("\nFirst 20 row IDs:")
110
+ print(genetic_df.index[:20])
111
+
112
+ print("\nPreview of first few rows and columns:")
113
+ print(genetic_df.head().iloc[:, :5])
114
+ # The IDs like '1007_s_at', '1053_at' appear to be Affymetrix probe IDs rather than standard human gene symbols
115
+ # These probe IDs will need to be mapped to their corresponding gene symbols for downstream analysis
116
+ requires_gene_mapping = True
117
+ # Extract gene annotation data, excluding control probe lines
118
+ gene_metadata = get_gene_annotation(soft_file)
119
+
120
+ # Preview filtered annotation data
121
+ print("Column names:")
122
+ print(gene_metadata.columns)
123
+ print("\nPreview of gene annotation data:")
124
+ print(preview_df(gene_metadata))
125
+ # 1. In gene annotation data, 'ID' column has probe IDs and 'Gene Symbol' has gene symbols
126
+ prob_col = 'ID'
127
+ gene_col = 'Gene Symbol'
128
+
129
+ # 2. Get mapping between probe IDs and gene symbols
130
+ mapping_df = get_gene_mapping(gene_metadata, prob_col, gene_col)
131
+
132
+ # 3. Apply mapping to convert probe-level data to gene expression
133
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
134
+
135
+ # Print dimensions and preview
136
+ print("Dimensions of gene expression data:", gene_data.shape)
137
+ print("\nPreview of gene expression data:")
138
+ print(gene_data.head().iloc[:, :5])
139
+ # 1. Normalize gene symbols and save
140
+ gene_data = normalize_gene_symbols_in_index(gene_data)
141
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
142
+ gene_data.to_csv(out_gene_data_file)
143
+
144
+ # Load previously saved clinical data
145
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
146
+
147
+ # 2. Link clinical and genetic data
148
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
149
+
150
+ # 3. Handle missing values
151
+ linked_data = handle_missing_values(linked_data, trait)
152
+
153
+ # 4. Check for biased features
154
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
155
+
156
+ # 5. Final validation and metadata saving
157
+ is_usable = validate_and_save_cohort_info(
158
+ is_final=True,
159
+ cohort=cohort,
160
+ info_path=json_path,
161
+ is_gene_available=is_gene_available,
162
+ is_trait_available=True,
163
+ is_biased=trait_biased,
164
+ df=linked_data,
165
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD"
166
+ )
167
+
168
+ # 6. Save linked data if usable
169
+ if is_usable:
170
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
171
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE32030.py ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE32030"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE32030"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE32030.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE32030.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE32030.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the background info, this is a microarray study of gene expression data
34
+ is_gene_available = True
35
+
36
+ # 2. Variable Availability and Data Type Conversion
37
+ # 2.1 Data Availability
38
+ trait_row = [2, 3] # 'copd status' appears in both rows 2 and 3
39
+ age_row = None # Age data not available
40
+ gender_row = None # Gender data not available
41
+
42
+ # 2.2 Data Type Conversion Functions
43
+ def convert_trait(x):
44
+ if pd.isna(x):
45
+ return None
46
+ x = x.lower()
47
+ # Check if it's an explicit COPD status
48
+ if 'copd status' in x:
49
+ val = x.split(': ')[-1]
50
+ if val == 'yes':
51
+ return 1
52
+ elif val == 'no':
53
+ return 0
54
+ # For rows without explicit COPD label, check other indicators
55
+ if 'smoking status' in x:
56
+ val = x.split(': ')[-1]
57
+ if val == 's': # Smokers
58
+ return 1
59
+ elif val == 'ns': # Non-smokers
60
+ return 0
61
+ return None
62
+
63
+ def convert_age(x):
64
+ return None # Not used since age data not available
65
+
66
+ def convert_gender(x):
67
+ return None # Not used since gender data not available
68
+
69
+ # 3. Save Metadata
70
+ is_trait_available = trait_row is not None
71
+ validate_and_save_cohort_info(is_final=False,
72
+ cohort=cohort,
73
+ info_path=json_path,
74
+ is_gene_available=is_gene_available,
75
+ is_trait_available=is_trait_available)
76
+
77
+ # 4. Clinical Feature Extraction
78
+ if trait_row is not None:
79
+ # Extract features from both rows where COPD status appears
80
+ clinical_features_1 = geo_select_clinical_features(
81
+ clinical_df=clinical_data,
82
+ trait=trait,
83
+ trait_row=trait_row[0],
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
+ clinical_features_2 = geo_select_clinical_features(
92
+ clinical_df=clinical_data,
93
+ trait=trait,
94
+ trait_row=trait_row[1],
95
+ convert_trait=convert_trait,
96
+ age_row=age_row,
97
+ convert_age=convert_age,
98
+ gender_row=gender_row,
99
+ convert_gender=convert_gender
100
+ )
101
+
102
+ # Combine trait values, preferring non-null values
103
+ clinical_features = clinical_features_1.combine_first(clinical_features_2)
104
+
105
+ # Preview the extracted features
106
+ preview = preview_df(clinical_features)
107
+ print("Preview of clinical features:")
108
+ print(preview)
109
+
110
+ # Save to CSV
111
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
112
+ clinical_features.to_csv(out_clinical_data_file)
113
+ # Extract gene expression data from matrix file
114
+ genetic_df = get_genetic_data(matrix_file)
115
+
116
+ # Print DataFrame shape and first 20 row IDs
117
+ print("DataFrame shape:", genetic_df.shape)
118
+ print("\nFirst 20 row IDs:")
119
+ print(genetic_df.index[:20])
120
+
121
+ print("\nPreview of first few rows and columns:")
122
+ print(genetic_df.head().iloc[:, :5])
123
+ # These are Affymetrix probe IDs that need to be mapped to human gene symbols
124
+ # They have the characteristic format of Affymetrix probe IDs (e.g. '1007_s_at')
125
+ # and are not standard HGNC gene symbols
126
+ requires_gene_mapping = True
127
+ # Extract gene annotation data, excluding control probe lines
128
+ gene_metadata = get_gene_annotation(soft_file)
129
+
130
+ # Preview filtered annotation data
131
+ print("Column names:")
132
+ print(gene_metadata.columns)
133
+ print("\nPreview of gene annotation data:")
134
+ print(preview_df(gene_metadata))
135
+ # 1. The 'ID' column in gene_metadata matches gene expression indices, and 'Gene Symbol' contains gene symbols
136
+ mapping_df = get_gene_mapping(gene_metadata, 'ID', 'Gene Symbol')
137
+
138
+ # 2. Apply the mapping to convert probe-level measurements to gene-level expression
139
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
140
+
141
+ # 3. Save gene expression data
142
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
143
+ gene_data.to_csv(out_gene_data_file)
144
+ # 1. Normalize gene symbols and save
145
+ gene_data = normalize_gene_symbols_in_index(gene_data)
146
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
147
+ gene_data.to_csv(out_gene_data_file)
148
+
149
+ # Load previously saved clinical data
150
+ selected_clinical = pd.read_csv(out_clinical_data_file, index_col=0)
151
+
152
+ # 2. Link clinical and genetic data
153
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
154
+
155
+ # 3. Handle missing values
156
+ linked_data = handle_missing_values(linked_data, trait)
157
+
158
+ # 4. Check for biased features
159
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
160
+
161
+ # 5. Final validation and metadata saving
162
+ is_usable = validate_and_save_cohort_info(
163
+ is_final=True,
164
+ cohort=cohort,
165
+ info_path=json_path,
166
+ is_gene_available=is_gene_available,
167
+ is_trait_available=True,
168
+ is_biased=trait_biased,
169
+ df=linked_data,
170
+ note="Dataset contains gene expression data comparing healthy nonsmokers, healthy smokers and smokers with COPD"
171
+ )
172
+
173
+ # 6. Save linked data if usable
174
+ if is_usable:
175
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
176
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE64593.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE64593"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE64593"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE64593.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE64593.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE64593.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # This is a gene expression dataset using Affymetrix microarray platform, so:
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability and 2.2 Data Type Conversion
37
+ # Trait (COPD) - Not directly measured but can be inferred from HIV status and smoking
38
+ trait_row = 1 # Using disease state row for inferring COPD risk groups
39
+ def convert_trait(x):
40
+ if ':' in x:
41
+ x = x.split(':')[1].strip()
42
+ # HIV+ smokers have highest COPD risk, followed by HIV- smokers
43
+ if x == 'HIV+':
44
+ return 1 # High risk group
45
+ elif x == 'HIV-':
46
+ return 0 # Low risk group
47
+ return None
48
+
49
+ # Age - Not available
50
+ age_row = None
51
+ convert_age = None
52
+
53
+ # Gender - Not available
54
+ gender_row = None
55
+ convert_gender = None
56
+
57
+ # 3. Save Metadata
58
+ is_trait_available = trait_row is not None
59
+ validate_and_save_cohort_info(is_final=False,
60
+ cohort=cohort,
61
+ info_path=json_path,
62
+ is_gene_available=is_gene_available,
63
+ is_trait_available=is_trait_available)
64
+
65
+ # 4. Clinical Feature Extraction
66
+ if trait_row is not None:
67
+ selected_clinical_df = geo_select_clinical_features(
68
+ clinical_df=clinical_data,
69
+ trait=trait,
70
+ trait_row=trait_row,
71
+ convert_trait=convert_trait,
72
+ age_row=age_row,
73
+ convert_age=convert_age,
74
+ gender_row=gender_row,
75
+ convert_gender=convert_gender
76
+ )
77
+
78
+ # Preview the processed clinical data
79
+ print("Preview of processed clinical data:")
80
+ print(preview_df(selected_clinical_df))
81
+
82
+ # Save to CSV
83
+ os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
84
+ selected_clinical_df.to_csv(out_clinical_data_file)
85
+ # Extract gene expression data from matrix file
86
+ genetic_df = get_genetic_data(matrix_file)
87
+
88
+ # Print DataFrame shape and first 20 row IDs
89
+ print("DataFrame shape:", genetic_df.shape)
90
+ print("\nFirst 20 row IDs:")
91
+ print(genetic_df.index[:20])
92
+
93
+ print("\nPreview of first few rows and columns:")
94
+ print(genetic_df.head().iloc[:, :5])
95
+ # These appear to be probe IDs from Affymetrix microarray platform (format like "1007_s_at")
96
+ # They need to be mapped to standard human gene symbols for analysis
97
+ requires_gene_mapping = True
98
+ # Extract gene annotation data, excluding control probe lines
99
+ gene_metadata = get_gene_annotation(soft_file)
100
+
101
+ # Preview filtered annotation data
102
+ print("Column names:")
103
+ print(gene_metadata.columns)
104
+ print("\nPreview of gene annotation data:")
105
+ print(preview_df(gene_metadata))
106
+ # Identify mapping columns: 'ID' for probe IDs matches gene expression index, 'Gene Symbol' for gene symbols
107
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Gene Symbol')
108
+
109
+ # Apply gene mapping to convert probe-level data to gene-level data
110
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
111
+
112
+ # Print shape and preview first few rows to verify conversion
113
+ print("Shape of gene expression data after mapping:", gene_data.shape)
114
+ print("\nPreview of gene expression data:")
115
+ print(gene_data.head().iloc[:, :5])
116
+ # 1. Normalize gene symbols and save
117
+ gene_data = normalize_gene_symbols_in_index(gene_data)
118
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
119
+ gene_data.to_csv(out_gene_data_file)
120
+
121
+ # 2. Link clinical and genetic data
122
+ linked_data = geo_link_clinical_genetic_data(selected_clinical_df, gene_data)
123
+
124
+ # 3. Handle missing values
125
+ linked_data = handle_missing_values(linked_data, trait)
126
+
127
+ # 4. Check for biased features
128
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
129
+
130
+ # 5. Final validation and metadata saving
131
+ is_usable = validate_and_save_cohort_info(
132
+ is_final=True,
133
+ cohort=cohort,
134
+ info_path=json_path,
135
+ is_gene_available=is_gene_available,
136
+ is_trait_available=True,
137
+ is_biased=trait_biased,
138
+ df=linked_data,
139
+ note="Dataset contains gene expression data from alveolar macrophages comparing HIV- vs HIV+ smokers"
140
+ )
141
+
142
+ # 6. Save linked data if usable
143
+ if is_usable:
144
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
145
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE64599.py ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE64599"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE64599"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE64599.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE64599.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE64599.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # Based on the series title and background, this dataset likely contains gene expression data for studying
34
+ # interleukin-23 and emphysema development in alveolar macrophages
35
+ is_gene_available = True
36
+
37
+ # 2.1 Data Availability and Location
38
+ # COPD/Emphysema trait can be inferred from HIV status (non-HIV subjects are control)
39
+ trait_row = 1
40
+
41
+ # Age and gender not available in characteristics
42
+ age_row = None
43
+ gender_row = None
44
+
45
+ # 2.2 Data Type Conversion Functions
46
+ def convert_trait(x):
47
+ # Extract value after colon
48
+ if ':' in str(x):
49
+ value = str(x).split(':')[1].strip().lower()
50
+ # HIV- subjects are control (0), HIV+ subjects are cases (1)
51
+ if 'hiv-' in value:
52
+ return 0
53
+ elif 'hiv+' in value:
54
+ return 1
55
+ return None
56
+
57
+ def convert_age(x):
58
+ return None # Age data not available
59
+
60
+ def convert_gender(x):
61
+ return None # Gender data not available
62
+
63
+ # 3. Save metadata
64
+ is_trait_available = trait_row is not None
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=is_trait_available
71
+ )
72
+
73
+ # 4. Extract clinical features if available
74
+ if trait_row is not None:
75
+ selected_clinical = geo_select_clinical_features(
76
+ clinical_df=clinical_data,
77
+ trait=trait,
78
+ trait_row=trait_row,
79
+ convert_trait=convert_trait,
80
+ age_row=age_row,
81
+ convert_age=convert_age,
82
+ gender_row=gender_row,
83
+ convert_gender=convert_gender
84
+ )
85
+
86
+ # Preview the extracted features
87
+ preview = preview_df(selected_clinical)
88
+
89
+ # Save clinical data
90
+ selected_clinical.to_csv(out_clinical_data_file)
91
+ # Extract gene expression data from matrix file
92
+ genetic_df = get_genetic_data(matrix_file)
93
+
94
+ # Print DataFrame shape and first 20 row IDs
95
+ print("DataFrame shape:", genetic_df.shape)
96
+ print("\nFirst 20 row IDs:")
97
+ print(genetic_df.index[:20])
98
+
99
+ print("\nPreview of first few rows and columns:")
100
+ print(genetic_df.head().iloc[:, :5])
101
+ # These appear to be Affymetrix probe IDs (e.g. '1007_s_at') rather than gene symbols
102
+ # They will need to be mapped to HGNC gene symbols for standardization
103
+
104
+ requires_gene_mapping = True
105
+ # Extract gene annotation data, excluding control probe lines
106
+ gene_metadata = get_gene_annotation(soft_file)
107
+
108
+ # Preview filtered annotation data
109
+ print("Column names:")
110
+ print(gene_metadata.columns)
111
+ print("\nPreview of gene annotation data:")
112
+ print(preview_df(gene_metadata))
113
+ # Get gene mapping dataframe from gene annotation
114
+ # 'ID' column stores probe IDs matching gene expression data identifiers
115
+ # 'Gene Symbol' column contains the target gene symbols
116
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Gene Symbol')
117
+
118
+ # Apply mapping to convert probe-level data to gene expression data
119
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
120
+
121
+ # Preview result
122
+ print("Gene expression data shape after mapping:", gene_data.shape)
123
+ print("\nFirst few rows and columns:")
124
+ print(gene_data.head().iloc[:, :5])
125
+ # 1. Normalize gene symbols and save
126
+ gene_data = normalize_gene_symbols_in_index(gene_data)
127
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
128
+ gene_data.to_csv(out_gene_data_file)
129
+
130
+ # 2. Link clinical and genetic data
131
+ linked_data = geo_link_clinical_genetic_data(selected_clinical, gene_data)
132
+
133
+ # 3. Handle missing values
134
+ linked_data = handle_missing_values(linked_data, trait)
135
+
136
+ # 4. Check for biased features
137
+ trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
138
+
139
+ # 5. Final validation and metadata saving
140
+ is_usable = validate_and_save_cohort_info(
141
+ is_final=True,
142
+ cohort=cohort,
143
+ info_path=json_path,
144
+ is_gene_available=is_gene_available,
145
+ is_trait_available=True,
146
+ is_biased=trait_biased,
147
+ df=linked_data,
148
+ note="Dataset contains gene expression data from PBMCs comparing healthy controls vs diabetic nephropathy vs ESRD"
149
+ )
150
+
151
+ # 6. Save linked data if usable
152
+ if is_usable:
153
+ os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
154
+ linked_data.to_csv(out_data_file)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/GSE84046.py ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+ cohort = "GSE84046"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)"
10
+ in_cohort_dir = "../DATA/GEO/Chronic_obstructive_pulmonary_disease_(COPD)/GSE84046"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/GSE84046.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE84046.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/GSE84046.csv"
16
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
17
+
18
+ # Get paths to the 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 feature (row) in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("=== Dataset Background Information ===")
29
+ print(background_info)
30
+ print("\n=== Sample Characteristics ===")
31
+ print(json.dumps(unique_values_dict, indent=2))
32
+ # 1. Gene Expression Data Availability
33
+ # From series summary, this is a gene expression study measuring mRNA in adipose tissue
34
+ is_gene_available = True
35
+
36
+ # 2.1 Data Availability
37
+ # From sample info, this cohort studied effects of protein restriction diet
38
+ # It's not a COPD study, so trait data is not available
39
+ trait_row = None
40
+
41
+ # Age row: Birth dates are in row 5, from which we can calculate age
42
+ age_row = 5
43
+
44
+ # Gender row: Sex data is in row 4
45
+ gender_row = 4
46
+
47
+ # 2.2 Data Type Conversion Functions
48
+ def convert_trait(x: str) -> Optional[int]:
49
+ return None
50
+
51
+ def convert_age(x: str) -> Optional[float]:
52
+ # Extract birth date after colon
53
+ if ":" not in x:
54
+ return None
55
+ birth_date_str = x.split(": ")[1]
56
+ try:
57
+ # Parse birth date. Study was conducted in 1997 (based on baseline ages)
58
+ birth_year = int(birth_date_str.split("-")[0])
59
+ age = 1997 - birth_year
60
+ return float(age)
61
+ except:
62
+ return None
63
+
64
+ def convert_gender(x: str) -> Optional[int]:
65
+ if ":" not in x:
66
+ return None
67
+ gender = x.split(": ")[1].lower()
68
+ if gender == "female":
69
+ return 0
70
+ elif gender == "male":
71
+ return 1
72
+ return None
73
+
74
+ # 3. Save Metadata
75
+ is_trait_available = trait_row is not None
76
+ validate_and_save_cohort_info(
77
+ is_final=False,
78
+ cohort=cohort,
79
+ info_path=json_path,
80
+ is_gene_available=is_gene_available,
81
+ is_trait_available=is_trait_available
82
+ )
83
+ # Extract gene expression data from matrix file
84
+ genetic_df = get_genetic_data(matrix_file)
85
+
86
+ # Print DataFrame shape and first 20 row IDs
87
+ print("DataFrame shape:", genetic_df.shape)
88
+ print("\nFirst 20 row IDs:")
89
+ print(genetic_df.index[:20])
90
+
91
+ print("\nPreview of first few rows and columns:")
92
+ print(genetic_df.head().iloc[:, :5])
93
+ # The IDs shown are numeric probe IDs (7892501, 7892502 etc) typical of microarray platforms
94
+ # These are not standard human gene symbols and will need mapping to gene symbols
95
+ requires_gene_mapping = True
96
+ # Extract gene annotation data, excluding control probe lines
97
+ gene_metadata = get_gene_annotation(soft_file)
98
+
99
+ # Preview filtered annotation data
100
+ print("Column names:")
101
+ print(gene_metadata.columns)
102
+ print("\nPreview of gene annotation data:")
103
+ print(preview_df(gene_metadata))
104
+ # Get mapping dataframe from probe IDs to gene symbols
105
+ mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='gene_assignment')
106
+
107
+ # Apply gene mapping to convert probe-level measurements to gene expression
108
+ gene_data = apply_gene_mapping(genetic_df, mapping_df)
109
+
110
+ # Print the shape and preview first few rows
111
+ print("Gene expression data shape:", gene_data.shape)
112
+ print("\nFirst few rows and columns:")
113
+ print(gene_data.head().iloc[:, :5])
114
+ # 1. Normalize gene symbols and save
115
+ gene_data = normalize_gene_symbols_in_index(gene_data)
116
+ os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
117
+ gene_data.to_csv(out_gene_data_file)
118
+
119
+ # 2-4. Skip linking and bias checks since no clinical data available
120
+
121
+ # 5. Final validation reflecting lack of trait data
122
+ # Pass gene_data as df and mark as biased since it lacks trait data
123
+ is_usable = validate_and_save_cohort_info(
124
+ is_final=True,
125
+ cohort=cohort,
126
+ info_path=json_path,
127
+ is_gene_available=is_gene_available,
128
+ is_trait_available=False,
129
+ is_biased=True, # No trait data means we can't use this for trait analysis
130
+ df=gene_data,
131
+ note="Dataset contains normalized gene expression data but lacks COPD trait information, so cannot be used for trait association analysis"
132
+ )
133
+
134
+ # 6. Skip saving linked data since dataset is not usable
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/code/TCGA.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Chronic_obstructive_pulmonary_disease_(COPD)"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/3/Chronic_obstructive_pulmonary_disease_(COPD)/cohort_info.json"
15
+
16
+ # Check available directories
17
+ available_dirs = os.listdir(tcga_root_dir)
18
+ available_dirs = [d for d in available_dirs if not d.startswith('.') and not d.endswith('.ipynb')]
19
+
20
+ # Check for COPD-related directories
21
+ copd_dirs = [d for d in available_dirs if any(term in d.lower() for term in ['copd', 'pulmonary', 'lung', 'respiratory'])]
22
+
23
+ # Print message if no suitable directory found
24
+ if len(copd_dirs) == 0:
25
+ # Use validate_and_save_cohort_info() to mark that gene data is not available for this trait
26
+ validate_and_save_cohort_info(is_final=False,
27
+ cohort='TCGA',
28
+ info_path=json_path,
29
+ is_gene_available=False,
30
+ is_trait_available=False)
31
+ print("No suitable TCGA cohort found for COPD. Skipping this trait.")
32
+ raise SystemExit()
33
+
34
+ # If we reach this point, suitable directories were found
35
+ # (Code to process data would go here, but we shouldn't reach this point for COPD)
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE162635.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:082997e1f591180b3c875e2e8f3ce10c7bf06f5751db4676fb85864b0fe2acb3
3
+ size 45983176
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE175616.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE208662.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE210272.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ Gene,GSM6427241,GSM6427242,GSM6427243,GSM6427244,GSM6427245,GSM6427246,GSM6427247,GSM6427248,GSM6427249,GSM6427250,GSM6427251,GSM6427252,GSM6427253,GSM6427254,GSM6427255,GSM6427256,GSM6427257,GSM6427258,GSM6427259,GSM6427260,GSM6427261,GSM6427262,GSM6427263,GSM6427264,GSM6427265,GSM6427266,GSM6427267,GSM6427268,GSM6427269,GSM6427270,GSM6427271,GSM6427272,GSM6427273,GSM6427274,GSM6427275,GSM6427276,GSM6427277,GSM6427278,GSM6427279,GSM6427280,GSM6427281,GSM6427282,GSM6427283,GSM6427284,GSM6427285,GSM6427286,GSM6427287,GSM6427288,GSM6427289,GSM6427290,GSM6427291,GSM6427292,GSM6427293,GSM6427294,GSM6427295,GSM6427296,GSM6427297,GSM6427298,GSM6427299,GSM6427300,GSM6427301,GSM6427302,GSM6427303,GSM6427304,GSM6427305,GSM6427306,GSM6427307,GSM6427308,GSM6427309,GSM6427310,GSM6427311,GSM6427312,GSM6427313,GSM6427314,GSM6427315,GSM6427316,GSM6427317,GSM6427318,GSM6427319,GSM6427320,GSM6427321,GSM6427322,GSM6427323,GSM6427324,GSM6427325,GSM6427326,GSM6427327,GSM6427328,GSM6427329,GSM6427330,GSM6427331,GSM6427332,GSM6427333,GSM6427334,GSM6427335,GSM6427336,GSM6427337,GSM6427338,GSM6427339,GSM6427340,GSM6427341,GSM6427342,GSM6427343,GSM6427344,GSM6427345,GSM6427346,GSM6427347,GSM6427348,GSM6427349,GSM6427350,GSM6427351,GSM6427352,GSM6427353,GSM6427354,GSM6427355,GSM6427356,GSM6427357,GSM6427358,GSM6427359,GSM6427360,GSM6427361,GSM6427362,GSM6427363,GSM6427364,GSM6427365,GSM6427366,GSM6427367,GSM6427368,GSM6427369,GSM6427370,GSM6427371,GSM6427372,GSM6427373,GSM6427374,GSM6427375,GSM6427376,GSM6427377,GSM6427378,GSM6427379,GSM6427380,GSM6427381,GSM6427382,GSM6427383,GSM6427384,GSM6427385,GSM6427386,GSM6427387,GSM6427388,GSM6427389,GSM6427390,GSM6427391,GSM6427392,GSM6427393,GSM6427394,GSM6427395,GSM6427396,GSM6427397,GSM6427398,GSM6427399,GSM6427400,GSM6427401,GSM6427402,GSM6427403,GSM6427404,GSM6427405,GSM6427406,GSM6427407,GSM6427408,GSM6427409,GSM6427410,GSM6427411,GSM6427412,GSM6427413,GSM6427414,GSM6427415,GSM6427416,GSM6427417,GSM6427418,GSM6427419,GSM6427420,GSM6427421,GSM6427422,GSM6427423,GSM6427424,GSM6427425,GSM6427426,GSM6427427,GSM6427428,GSM6427429,GSM6427430,GSM6427431,GSM6427432,GSM6427433,GSM6427434,GSM6427435,GSM6427436,GSM6427437,GSM6427438,GSM6427439,GSM6427440,GSM6427441,GSM6427442,GSM6427443,GSM6427444,GSM6427445,GSM6427446,GSM6427447,GSM6427448,GSM6427449,GSM6427450,GSM6427451,GSM6427452,GSM6427453,GSM6427454,GSM6427455,GSM6427456,GSM6427457,GSM6427458,GSM6427459,GSM6427460,GSM6427461,GSM6427462,GSM6427463,GSM6427464,GSM6427465,GSM6427466,GSM6427467,GSM6427468,GSM6427469,GSM6427470,GSM6427471,GSM6427472,GSM6427473,GSM6427474,GSM6427475,GSM6427476,GSM6427477,GSM6427478
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE212331.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:967fcad06150eef5443e19636e1b06db24f74f4d4fd127fa0ccec7133deb4f05
3
+ size 22261392
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE21359.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a449edf4d094d7479ffb0808221c001aecaab141df3e23788d9e6083a87d5b8a
3
+ size 27473130
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE32030.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93ddebab0c0d764da823fcc3341c93271f75ef43390e3ed99bba86d40fed528f
3
+ size 42395312
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE64593.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE64599.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Chronic_obstructive_pulmonary_disease_(COPD)/gene_data/GSE84046.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d28cbd17a3b8fde7cad97fdd235a4eb7f60a848d6819c231ae2f861172439408
3
+ size 12843969
p3/preprocess/Fibromyalgia/GSE67311.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11c8d40a52cd9eea5a300fd608b53b476b0e9df60aab092539a162387bc03ddb
3
+ size 33089399
p3/preprocess/Fibromyalgia/clinical_data/GSE67311.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ,GSM1644447,GSM1644448,GSM1644449,GSM1644450,GSM1644451,GSM1644452,GSM1644453,GSM1644454,GSM1644455,GSM1644456,GSM1644457,GSM1644458,GSM1644459,GSM1644460,GSM1644461,GSM1644462,GSM1644463,GSM1644464,GSM1644465,GSM1644466,GSM1644467,GSM1644468,GSM1644469,GSM1644470,GSM1644471,GSM1644472,GSM1644473,GSM1644474,GSM1644475,GSM1644476,GSM1644477,GSM1644478,GSM1644479,GSM1644480,GSM1644481,GSM1644482,GSM1644483,GSM1644484,GSM1644485,GSM1644486,GSM1644487,GSM1644488,GSM1644489,GSM1644490,GSM1644491,GSM1644492,GSM1644493,GSM1644494,GSM1644495,GSM1644496,GSM1644497,GSM1644498,GSM1644499,GSM1644500,GSM1644501,GSM1644502,GSM1644503,GSM1644504,GSM1644505,GSM1644506,GSM1644507,GSM1644508,GSM1644509,GSM1644510,GSM1644511,GSM1644512,GSM1644513,GSM1644514,GSM1644515,GSM1644516,GSM1644517,GSM1644518,GSM1644519,GSM1644520,GSM1644521,GSM1644522,GSM1644523,GSM1644524,GSM1644525,GSM1644526,GSM1644527,GSM1644528,GSM1644529,GSM1644530,GSM1644531,GSM1644532,GSM1644533,GSM1644534,GSM1644535,GSM1644536,GSM1644537,GSM1644538,GSM1644539,GSM1644540,GSM1644541,GSM1644542,GSM1644543,GSM1644544,GSM1644545,GSM1644546,GSM1644547,GSM1644548,GSM1644549,GSM1644550,GSM1644551,GSM1644552,GSM1644553,GSM1644554,GSM1644555,GSM1644556,GSM1644557,GSM1644558,GSM1644559,GSM1644560,GSM1644561,GSM1644562,GSM1644563,GSM1644564,GSM1644565,GSM1644566,GSM1644567,GSM1644568,GSM1644569,GSM1644570,GSM1644571,GSM1644572,GSM1644573,GSM1644574,GSM1644575,GSM1644576,GSM1644577,GSM1644578,GSM1644579,GSM1644580,GSM1644581,GSM1644582,GSM1644583,GSM1644584,GSM1644585,GSM1644586,GSM1644587,GSM1644588
2
+ Fibromyalgia,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
p3/preprocess/Fibromyalgia/code/GSE67311.py ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Fibromyalgia"
6
+ cohort = "GSE67311"
7
+
8
+ # Input paths
9
+ in_trait_dir = "../DATA/GEO/Fibromyalgia"
10
+ in_cohort_dir = "../DATA/GEO/Fibromyalgia/GSE67311"
11
+
12
+ # Output paths
13
+ out_data_file = "./output/preprocess/3/Fibromyalgia/GSE67311.csv"
14
+ out_gene_data_file = "./output/preprocess/3/Fibromyalgia/gene_data/GSE67311.csv"
15
+ out_clinical_data_file = "./output/preprocess/3/Fibromyalgia/clinical_data/GSE67311.csv"
16
+ json_path = "./output/preprocess/3/Fibromyalgia/cohort_info.json"
17
+
18
+ # Get relevant file paths
19
+ soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
20
+
21
+ # Extract background info and clinical data from the matrix file
22
+ background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
23
+
24
+ # Get dictionary of unique values per row in clinical data
25
+ unique_values_dict = get_unique_values_by_row(clinical_data)
26
+
27
+ # Print background info
28
+ print("Background Information:")
29
+ print("-" * 50)
30
+ print(background_info)
31
+ print("\n")
32
+
33
+ # Print clinical data unique values
34
+ print("Sample Characteristics:")
35
+ print("-" * 50)
36
+ for row, values in unique_values_dict.items():
37
+ print(f"{row}:")
38
+ print(f" {values}")
39
+ print()
40
+ # 1. Gene Expression Data Availability
41
+ # Yes, this dataset contains gene expression data from Affymetrix Human Gene arrays
42
+ is_gene_available = True
43
+
44
+ # 2.1 Data Availability
45
+
46
+ # trait_row = 0 - diagnosis information is in row 0
47
+ trait_row = 0
48
+
49
+ # Age information is not available in the sample characteristics
50
+ age_row = None
51
+
52
+ # Gender information is not available in the sample characteristics
53
+ gender_row = None
54
+
55
+ # 2.2 Data Type Conversion Functions
56
+
57
+ def convert_trait(x):
58
+ if pd.isna(x):
59
+ return None
60
+ # Extract value after colon and strip whitespace
61
+ value = x.split(':')[1].strip().lower()
62
+ # Convert to binary: fibromyalgia = 1, healthy control = 0
63
+ if 'fibromyalgia' in value:
64
+ return 1
65
+ elif 'healthy control' in value:
66
+ return 0
67
+ return None
68
+
69
+ # Age conversion function not needed since data not available
70
+ convert_age = None
71
+
72
+ # Gender conversion function not needed since data not available
73
+ convert_gender = None
74
+
75
+ # 3. Save Metadata
76
+ is_trait_available = trait_row is not None
77
+ validate_and_save_cohort_info(is_final=False,
78
+ cohort=cohort,
79
+ info_path=json_path,
80
+ is_gene_available=is_gene_available,
81
+ is_trait_available=is_trait_available)
82
+
83
+ # 4. Clinical Feature Extraction
84
+ # Since trait_row is not None, we need to extract clinical features
85
+ clinical_features = geo_select_clinical_features(clinical_df=clinical_data,
86
+ trait=trait,
87
+ trait_row=trait_row,
88
+ convert_trait=convert_trait,
89
+ age_row=age_row,
90
+ convert_age=convert_age,
91
+ gender_row=gender_row,
92
+ convert_gender=convert_gender)
93
+
94
+ # Preview the extracted features
95
+ print("Preview of clinical features:")
96
+ print(preview_df(clinical_features))
97
+
98
+ # Save clinical features
99
+ clinical_features.to_csv(out_clinical_data_file)
100
+ # Extract gene expression data
101
+ genetic_data = get_genetic_data(matrix_file_path)
102
+
103
+ # Print first 20 probe IDs
104
+ print("First 20 probe IDs:")
105
+ print(genetic_data.index[:20])
106
+ # Looking at the probe IDs (e.g. '7892501'), these are Illumina probe IDs, not human gene symbols.
107
+ # They need to be mapped to HGNC gene symbols for consistent analysis.
108
+
109
+ requires_gene_mapping = True
110
+ # Extract gene annotation from SOFT file
111
+ gene_annotation = get_gene_annotation(soft_file_path)
112
+
113
+ # Preview column names and first few values
114
+ preview_dict = preview_df(gene_annotation)
115
+ print("Column names and preview values:")
116
+ for col, values in preview_dict.items():
117
+ print(f"\n{col}:")
118
+ print(values)
119
+ # Identify columns for mapping: ID for probes and gene_assignment for gene symbols
120
+ prob_col = 'ID'
121
+ gene_col = 'gene_assignment'
122
+
123
+ # Filter out rows where gene_assignment is '---' as they won't map to genes
124
+ filtered_annotation = gene_annotation[gene_annotation['gene_assignment'] != '---']
125
+
126
+ # Get the mapping between probe IDs and gene symbols
127
+ mapping_data = get_gene_mapping(filtered_annotation, prob_col, gene_col)
128
+
129
+ # Apply the mapping to convert probe-level data to gene-level data
130
+ gene_data = apply_gene_mapping(genetic_data, mapping_data)
131
+
132
+ # Normalize gene symbols using the NCBI Gene database
133
+ gene_data = normalize_gene_symbols_in_index(gene_data)
134
+
135
+ # Preview results
136
+ print("\nFirst 5 rows of the gene mapping:")
137
+ print(mapping_data.head())
138
+
139
+ print("\nFirst 5 rows of the gene expression data:")
140
+ print(gene_data.head())
141
+ # 1. Normalize gene symbols and save normalized gene data
142
+ normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
143
+ normalized_gene_data.to_csv(out_gene_data_file)
144
+
145
+ # Read the processed clinical data file
146
+ clinical_df = pd.read_csv(out_clinical_data_file, index_col=0)
147
+
148
+ # Link clinical and genetic data using the normalized gene data
149
+ linked_data = geo_link_clinical_genetic_data(clinical_df, normalized_gene_data)
150
+
151
+ # Handle missing values systematically
152
+ linked_data = handle_missing_values(linked_data, trait)
153
+
154
+ # Detect bias in trait and demographic features, remove biased demographic features
155
+ is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
156
+
157
+ # Validate data quality and save cohort info
158
+ note = "Expression data comparing patients with Essential Thrombocythemia to controls with other myeloproliferative disorders (PMF, PV). No age or gender data available."
159
+ is_usable = validate_and_save_cohort_info(
160
+ is_final=True,
161
+ cohort=cohort,
162
+ info_path=json_path,
163
+ is_gene_available=True,
164
+ is_trait_available=True,
165
+ is_biased=is_biased,
166
+ df=linked_data,
167
+ note=note
168
+ )
169
+
170
+ # Save linked data if usable
171
+ if is_usable:
172
+ linked_data.to_csv(out_data_file)
173
+ else:
174
+ print(f"Dataset {cohort} did not pass quality validation and will not be saved.")
p3/preprocess/Fibromyalgia/code/TCGA.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Path Configuration
2
+ from tools.preprocess import *
3
+
4
+ # Processing context
5
+ trait = "Fibromyalgia"
6
+
7
+ # Input paths
8
+ tcga_root_dir = "../DATA/TCGA"
9
+
10
+ # Output paths
11
+ out_data_file = "./output/preprocess/3/Fibromyalgia/TCGA.csv"
12
+ out_gene_data_file = "./output/preprocess/3/Fibromyalgia/gene_data/TCGA.csv"
13
+ out_clinical_data_file = "./output/preprocess/3/Fibromyalgia/clinical_data/TCGA.csv"
14
+ json_path = "./output/preprocess/3/Fibromyalgia/cohort_info.json"
15
+
16
+ # Review TCGA directories for Fibromyalgia cohort
17
+ print("No suitable TCGA cohort found for Fibromyalgia")
18
+
19
+ # Mark task as completed by recording that gene/trait data is unavailable
20
+ validate_and_save_cohort_info(
21
+ is_final=False,
22
+ cohort="TCGA",
23
+ info_path=json_path,
24
+ is_gene_available=False,
25
+ is_trait_available=False
26
+ )
27
+
28
+ # Exit preprocessing since no suitable data was found
29
+ exit()
p3/preprocess/Fibromyalgia/cohort_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"GSE67311": {"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": 142, "note": "Expression data comparing patients with Essential Thrombocythemia to controls with other myeloproliferative disorders (PMF, PV). No age or gender data available."}, "TCGA": {"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}}
p3/preprocess/Fibromyalgia/gene_data/GSE67311.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdc80550137956d622d2ec9a5baefec581baacd4c28f983c456b9d007fbd70b7
3
+ size 33088822
p3/preprocess/Hypertension/GSE117261.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f85b20b6da8b7bd77ea58fa720978b06dab6958f632d6101b3c6cf2edb2594e9
3
+ size 27077398
p3/preprocess/Hypertension/GSE128381.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:141c9dbe68bf102c8779f548113c5308fad987f3be8fff1f1be35669d36e2639
3
+ size 20390631
p3/preprocess/Hypertension/GSE149256.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Hypertension/GSE151158.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Hypertension/GSE161533.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d558390140643951500b05678b79286e9e4e339e6a43694ab09897e2aeeda3e7
3
+ size 14213291
p3/preprocess/Hypertension/GSE181339.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Hypertension/GSE256539.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0faa68cba11047c7f58095d592e6a29210e3818394a9d5aa3be738faf72c3158
3
+ size 22919232
p3/preprocess/Hypertension/GSE71994.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e0876ea1a6824d67561d4c49293f8c7621665a622440f7a33683fcbd3eb1fe1
3
+ size 15229664
p3/preprocess/Hypertension/GSE74144.csv ADDED
The diff for this file is too large to render. See raw diff
 
p3/preprocess/Hypertension/GSE77627.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edc2f9ccf9e50af1e5befb3b18025052165e09a4440c7997b0e67e704b1a2cc7
3
+ size 13320988