Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +28 -0
- p1/preprocess/Cystic_Fibrosis/gene_data/GSE60690.csv +3 -0
- p1/preprocess/Endometrioid_Cancer/TCGA.csv +3 -0
- p1/preprocess/Endometrioid_Cancer/gene_data/TCGA.csv +3 -0
- p1/preprocess/Endometriosis/GSE51981.csv +3 -0
- p1/preprocess/Endometriosis/gene_data/GSE51981.csv +3 -0
- p1/preprocess/Epilepsy/GSE143272.csv +3 -0
- p1/preprocess/Epilepsy/GSE29796.csv +3 -0
- p1/preprocess/Epilepsy/gene_data/GSE123993.csv +3 -0
- p1/preprocess/Epilepsy/gene_data/GSE143272.csv +3 -0
- p1/preprocess/Epilepsy/gene_data/GSE29796.csv +3 -0
- p1/preprocess/Epilepsy/gene_data/GSE63808.csv +3 -0
- p1/preprocess/Epilepsy/gene_data/GSE65106.csv +3 -0
- p1/preprocess/Epilepsy/gene_data/GSE74571.csv +3 -0
- p1/preprocess/Esophageal_Cancer/GSE104958.csv +3 -0
- p1/preprocess/Esophageal_Cancer/GSE75241.csv +0 -0
- p1/preprocess/Esophageal_Cancer/clinical_data/GSE131027.csv +2 -0
- p1/preprocess/Esophageal_Cancer/clinical_data/GSE55857.csv +2 -0
- p1/preprocess/Esophageal_Cancer/clinical_data/GSE75241.csv +2 -0
- p1/preprocess/Esophageal_Cancer/clinical_data/GSE77790.csv +2 -0
- p1/preprocess/Esophageal_Cancer/code/GSE100843.py +171 -0
- p1/preprocess/Esophageal_Cancer/code/GSE104958.py +206 -0
- p1/preprocess/Esophageal_Cancer/code/GSE107754.py +223 -0
- p1/preprocess/Esophageal_Cancer/code/GSE131027.py +203 -0
- p1/preprocess/Esophageal_Cancer/code/GSE156915.py +71 -0
- p1/preprocess/Esophageal_Cancer/code/GSE218109.py +211 -0
- p1/preprocess/Esophageal_Cancer/code/GSE55857.py +89 -0
- p1/preprocess/Esophageal_Cancer/code/GSE66258.py +74 -0
- p1/preprocess/Esophageal_Cancer/code/GSE75241.py +204 -0
- p1/preprocess/Esophageal_Cancer/code/GSE77790.py +201 -0
- p1/preprocess/Esophageal_Cancer/code/TCGA.py +104 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE100843.csv +3 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE104958.csv +3 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE107754.csv +3 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE131027.csv +3 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE218109.csv +0 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE75241.csv +0 -0
- p1/preprocess/Esophageal_Cancer/gene_data/GSE77790.csv +0 -0
- p1/preprocess/Essential_Thrombocythemia/GSE103237.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/GSE12295.csv +0 -0
- p1/preprocess/Essential_Thrombocythemia/GSE159514.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/GSE174060.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/GSE55976.csv +0 -0
- p1/preprocess/Essential_Thrombocythemia/GSE57793.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/GSE61629.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE103176.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE103237.csv +3 -0
- p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE12295.csv +2 -0
- p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE159514.csv +2 -0
- p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE174060.csv +4 -0
.gitattributes
CHANGED
@@ -1076,3 +1076,31 @@ p1/preprocess/Endometrioid_Cancer/gene_data/GSE120490.csv filter=lfs diff=lfs me
|
|
1076 |
p1/preprocess/Chronic_kidney_disease/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1077 |
p1/preprocess/Endometriosis/gene_data/GSE165004.csv filter=lfs diff=lfs merge=lfs -text
|
1078 |
p1/preprocess/Endometriosis/gene_data/GSE73622.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1076 |
p1/preprocess/Chronic_kidney_disease/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1077 |
p1/preprocess/Endometriosis/gene_data/GSE165004.csv filter=lfs diff=lfs merge=lfs -text
|
1078 |
p1/preprocess/Endometriosis/gene_data/GSE73622.csv filter=lfs diff=lfs merge=lfs -text
|
1079 |
+
p1/preprocess/Endometriosis/GSE51981.csv filter=lfs diff=lfs merge=lfs -text
|
1080 |
+
p1/preprocess/Epilepsy/GSE29796.csv filter=lfs diff=lfs merge=lfs -text
|
1081 |
+
p1/preprocess/Epilepsy/gene_data/GSE29796.csv filter=lfs diff=lfs merge=lfs -text
|
1082 |
+
p1/preprocess/Epilepsy/gene_data/GSE123993.csv filter=lfs diff=lfs merge=lfs -text
|
1083 |
+
p1/preprocess/Epilepsy/GSE143272.csv filter=lfs diff=lfs merge=lfs -text
|
1084 |
+
p1/preprocess/Epilepsy/gene_data/GSE143272.csv filter=lfs diff=lfs merge=lfs -text
|
1085 |
+
p1/preprocess/Endometrioid_Cancer/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1086 |
+
p1/preprocess/Esophageal_Cancer/GSE104958.csv filter=lfs diff=lfs merge=lfs -text
|
1087 |
+
p1/preprocess/Epilepsy/gene_data/GSE74571.csv filter=lfs diff=lfs merge=lfs -text
|
1088 |
+
p1/preprocess/Endometriosis/gene_data/GSE51981.csv filter=lfs diff=lfs merge=lfs -text
|
1089 |
+
p1/preprocess/Endometrioid_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1090 |
+
p1/preprocess/Epilepsy/gene_data/GSE65106.csv filter=lfs diff=lfs merge=lfs -text
|
1091 |
+
p1/preprocess/Cystic_Fibrosis/gene_data/GSE60690.csv filter=lfs diff=lfs merge=lfs -text
|
1092 |
+
p1/preprocess/Esophageal_Cancer/gene_data/GSE104958.csv filter=lfs diff=lfs merge=lfs -text
|
1093 |
+
p1/preprocess/Essential_Thrombocythemia/GSE103237.csv filter=lfs diff=lfs merge=lfs -text
|
1094 |
+
p1/preprocess/Epilepsy/gene_data/GSE63808.csv filter=lfs diff=lfs merge=lfs -text
|
1095 |
+
p1/preprocess/Essential_Thrombocythemia/GSE61629.csv filter=lfs diff=lfs merge=lfs -text
|
1096 |
+
p1/preprocess/Esophageal_Cancer/gene_data/GSE107754.csv filter=lfs diff=lfs merge=lfs -text
|
1097 |
+
p1/preprocess/Esophageal_Cancer/gene_data/GSE131027.csv filter=lfs diff=lfs merge=lfs -text
|
1098 |
+
p1/preprocess/Essential_Thrombocythemia/GSE57793.csv filter=lfs diff=lfs merge=lfs -text
|
1099 |
+
p1/preprocess/Essential_Thrombocythemia/GSE174060.csv filter=lfs diff=lfs merge=lfs -text
|
1100 |
+
p1/preprocess/Essential_Thrombocythemia/GSE159514.csv filter=lfs diff=lfs merge=lfs -text
|
1101 |
+
p1/preprocess/Esophageal_Cancer/gene_data/GSE100843.csv filter=lfs diff=lfs merge=lfs -text
|
1102 |
+
p1/preprocess/Essential_Thrombocythemia/gene_data/GSE103237.csv filter=lfs diff=lfs merge=lfs -text
|
1103 |
+
p1/preprocess/Essential_Thrombocythemia/gene_data/GSE174060.csv filter=lfs diff=lfs merge=lfs -text
|
1104 |
+
p1/preprocess/Essential_Thrombocythemia/gene_data/GSE61629.csv filter=lfs diff=lfs merge=lfs -text
|
1105 |
+
p1/preprocess/Gastroesophageal_reflux_disease_(GERD)/GSE77563.csv filter=lfs diff=lfs merge=lfs -text
|
1106 |
+
p1/preprocess/Essential_Thrombocythemia/gene_data/GSE57793.csv filter=lfs diff=lfs merge=lfs -text
|
p1/preprocess/Cystic_Fibrosis/gene_data/GSE60690.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e128091a184991c399c08ec7096bd394cf9a2d6d02f54f4d228319c3cd78f9e2
|
3 |
+
size 119925885
|
p1/preprocess/Endometrioid_Cancer/TCGA.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:55f316c5dae0221d1ab50b0b07ad177d1be08555af114b396a1bed974702af8a
|
3 |
+
size 60336948
|
p1/preprocess/Endometrioid_Cancer/gene_data/TCGA.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:965772a8ddafe3b0baec55f80b0a37ac57d1cd394c3678a057598d5b214d2edd
|
3 |
+
size 60335341
|
p1/preprocess/Endometriosis/GSE51981.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:de007696482bc115aece4bc25168f6fac723e93985ece506a35b5404f174bcd9
|
3 |
+
size 38974242
|
p1/preprocess/Endometriosis/gene_data/GSE51981.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:048fb7b5686b2236d3a974895fdba0e8c8f39f28a5d03be84e611b41f63d78d7
|
3 |
+
size 38973640
|
p1/preprocess/Epilepsy/GSE143272.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c1974ef47a5f985df6efe680c2bfc644aff121b6a1963c83a72836efdeb1b6d9
|
3 |
+
size 15849794
|
p1/preprocess/Epilepsy/GSE29796.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f2633f250b30287d83725118636a9b02734c66f5d19db9b76ef651efa998b5cf
|
3 |
+
size 13410909
|
p1/preprocess/Epilepsy/gene_data/GSE123993.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6111dad1e9f5abfbe6f2768c0cd1c1fd1396db43109b545e718dd54b7561f133
|
3 |
+
size 15123583
|
p1/preprocess/Epilepsy/gene_data/GSE143272.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:11b9d688b7c816f77cf4cb2f913fd2d0be6ab7c38198dfa9f4153f033b3e7172
|
3 |
+
size 15847932
|
p1/preprocess/Epilepsy/gene_data/GSE29796.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4edf231b1d6038cad00622845fdb6c06ada9b682c6e46af24a4183d565ff6de6
|
3 |
+
size 13410616
|
p1/preprocess/Epilepsy/gene_data/GSE63808.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0bdac0043b2478db21da09fd00218c0f7d9f63bb25c5927b251c695c06e19eeb
|
3 |
+
size 34094852
|
p1/preprocess/Epilepsy/gene_data/GSE65106.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:08bb07f91bda98eadc3f24926d365682061405a5583febcd0f6ca3ad243f99c0
|
3 |
+
size 19365342
|
p1/preprocess/Epilepsy/gene_data/GSE74571.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e3535ea344d801f0a42c2294e42f2c4bbe0172e4fea404df54a5023c9f660e27
|
3 |
+
size 13432589
|
p1/preprocess/Esophageal_Cancer/GSE104958.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:205d603e58f6b10dbe0463fb8dc5e83082881ff216919a22383220960703a795
|
3 |
+
size 11772902
|
p1/preprocess/Esophageal_Cancer/GSE75241.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p1/preprocess/Esophageal_Cancer/clinical_data/GSE131027.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
GSM3759992,GSM3759993,GSM3759994,GSM3759995,GSM3759996,GSM3759997,GSM3759998,GSM3759999,GSM3760000,GSM3760001,GSM3760002,GSM3760003,GSM3760004,GSM3760005,GSM3760006,GSM3760007,GSM3760008,GSM3760009,GSM3760010,GSM3760011,GSM3760012,GSM3760013,GSM3760014,GSM3760015,GSM3760016,GSM3760017,GSM3760018,GSM3760019,GSM3760020,GSM3760021,GSM3760022,GSM3760023,GSM3760024,GSM3760025,GSM3760026,GSM3760027,GSM3760028,GSM3760029,GSM3760030,GSM3760031,GSM3760032,GSM3760033,GSM3760034,GSM3760035,GSM3760036,GSM3760037,GSM3760038,GSM3760039,GSM3760040,GSM3760041,GSM3760042,GSM3760043,GSM3760044,GSM3760045,GSM3760046,GSM3760047,GSM3760048,GSM3760049,GSM3760050,GSM3760051,GSM3760052,GSM3760053,GSM3760054,GSM3760055,GSM3760056,GSM3760057,GSM3760058,GSM3760059,GSM3760060,GSM3760061,GSM3760062,GSM3760063,GSM3760064,GSM3760065,GSM3760066,GSM3760067,GSM3760068,GSM3760069,GSM3760070,GSM3760071,GSM3760072,GSM3760073,GSM3760074,GSM3760075,GSM3760076,GSM3760077,GSM3760078,GSM3760079,GSM3760080,GSM3760081,GSM3760082,GSM3760083
|
2 |
+
0.0,0.0,0.0,0.0,,0.0,0.0,,0.0,0.0,0.0,,0.0,,0.0,,0.0,0.0,0.0,0.0,,0.0,0.0,0.0,0.0,0.0,0.0,,0.0,,0.0,,0.0,0.0,,0.0,0.0,0.0,,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
|
p1/preprocess/Esophageal_Cancer/clinical_data/GSE55857.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
GSM1347399,GSM1347400,GSM1347401,GSM1347402,GSM1347403,GSM1347404,GSM1347405,GSM1347406,GSM1347407,GSM1347408,GSM1347409,GSM1347410,GSM1347411,GSM1347412,GSM1347413,GSM1347414,GSM1347415,GSM1347416,GSM1347417,GSM1347418,GSM1347419,GSM1347420,GSM1347421,GSM1347422,GSM1347423,GSM1347424,GSM1347425,GSM1347426,GSM1347427,GSM1347428,GSM1347429,GSM1347430,GSM1347431,GSM1347432,GSM1347433,GSM1347434,GSM1347435,GSM1347436,GSM1347437,GSM1347438,GSM1347439,GSM1347440,GSM1347441,GSM1347442,GSM1347443,GSM1347444,GSM1347445,GSM1347446,GSM1347447,GSM1347448,GSM1347449,GSM1347450,GSM1347451,GSM1347452,GSM1347453,GSM1347454,GSM1347455,GSM1347456,GSM1347457,GSM1347458,GSM1347459,GSM1347460,GSM1347461,GSM1347462,GSM1347463,GSM1347464,GSM1347465,GSM1347466,GSM1347467,GSM1347468,GSM1347469,GSM1347470,GSM1347471,GSM1347472,GSM1347473,GSM1347474,GSM1347475,GSM1347476,GSM1347477,GSM1347478,GSM1347479,GSM1347480,GSM1347481,GSM1347482,GSM1347483,GSM1347484,GSM1347485,GSM1347486,GSM1347487,GSM1347488,GSM1347489,GSM1347490,GSM1347491,GSM1347492,GSM1347493,GSM1347494,GSM1347495,GSM1347496,GSM1347497,GSM1347498,GSM1347499,GSM1347500,GSM1347501,GSM1347502,GSM1347503,GSM1347504,GSM1347505,GSM1347506,GSM1347507,GSM1347508,GSM1347509,GSM1347510,GSM1347511,GSM1347512,GSM1347513,GSM1347514,GSM1347515,GSM1347516,GSM1347517,GSM1347518,GSM1347519,GSM1347520,GSM1347521,GSM1347522,GSM1347523,GSM1347524,GSM1347525,GSM1347526,GSM1347527,GSM1347528,GSM1347529,GSM1347530,GSM1347531,GSM1347532,GSM1347533,GSM1347534,GSM1347535,GSM1347536,GSM1347537,GSM1347538,GSM1347539,GSM1347540,GSM1347541,GSM1347542,GSM1347543,GSM1347544,GSM1347545,GSM1347546,GSM1347547,GSM1347548,GSM1347549,GSM1347550,GSM1347551,GSM1347552,GSM1347553,GSM1347554,GSM1347555,GSM1347556,GSM1347557,GSM1347558,GSM1347559,GSM1347560,GSM1347561,GSM1347562,GSM1347563,GSM1347564,GSM1347565,GSM1347566,GSM1347567,GSM1347568,GSM1347569,GSM1347570,GSM1347571,GSM1347572,GSM1347573,GSM1347574,GSM1347575,GSM1347576,GSM1347577,GSM1347578,GSM1347579,GSM1347580,GSM1347581,GSM1347582,GSM1347583,GSM1347584,GSM1347585,GSM1347586,GSM1347587,GSM1347588,GSM1347589,GSM1347590,GSM1347591,GSM1347592,GSM1347593,GSM1347594,GSM1347595,GSM1347596,GSM1347597,GSM1347598,GSM1347599,GSM1347600,GSM1347601,GSM1347602,GSM1347603,GSM1347604,GSM1347605,GSM1347606,GSM1347607,GSM1347608,GSM1347609,GSM1347610,GSM1347611,GSM1347612,GSM1347613,GSM1347614
|
2 |
+
0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0
|
p1/preprocess/Esophageal_Cancer/clinical_data/GSE75241.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
GSM1946756,GSM1946757,GSM1946758,GSM1946759,GSM1946760,GSM1946761,GSM1946762,GSM1946763,GSM1946764,GSM1946765,GSM1946766,GSM1946767,GSM1946768,GSM1946769,GSM1946770,GSM1946771,GSM1946772,GSM1946773,GSM1946774,GSM1946775,GSM1946776,GSM1946777,GSM1946778,GSM1946779,GSM1946780,GSM1946781,GSM1946782,GSM1946783,GSM1946784,GSM1946785
|
2 |
+
0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0
|
p1/preprocess/Esophageal_Cancer/clinical_data/GSE77790.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM2059404,GSM2059405,GSM2059406,GSM2059407,GSM2059408,GSM2059409,GSM2059410,GSM2059411,GSM2059412,GSM2059413,GSM2059414,GSM2059415,GSM2059416,GSM2059417,GSM2059418,GSM2059419,GSM2059420,GSM2059421,GSM2059422,GSM2059423,GSM2059424,GSM2059425,GSM2059426,GSM2059427,GSM2059428,GSM2059429,GSM2059430,GSM2059431,GSM2059432,GSM2059433,GSM2059434,GSM2059435
|
2 |
+
Esophageal_Cancer,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0
|
p1/preprocess/Esophageal_Cancer/code/GSE100843.py
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE100843"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE100843"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE100843.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE100843.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE100843.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1) Determine if gene expression data is available
|
37 |
+
is_gene_available = True # The design mentions microarray for global gene expression.
|
38 |
+
|
39 |
+
# 2.1) Identify data availability for 'trait', 'age', 'gender'
|
40 |
+
# From the sample characteristics dictionary, none of these variables are present.
|
41 |
+
trait_row = None
|
42 |
+
age_row = None
|
43 |
+
gender_row = None
|
44 |
+
|
45 |
+
# 2.2) Define data type conversion functions (they will return None here, as data is unavailable)
|
46 |
+
def convert_trait(value):
|
47 |
+
return None
|
48 |
+
|
49 |
+
def convert_age(value):
|
50 |
+
return None
|
51 |
+
|
52 |
+
def convert_gender(value):
|
53 |
+
return None
|
54 |
+
|
55 |
+
# 3) Initial filtering: trait data is considered unavailable because trait_row is None
|
56 |
+
is_trait_available = (trait_row is not None)
|
57 |
+
|
58 |
+
validate_and_save_cohort_info(
|
59 |
+
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 |
+
|
66 |
+
# 4) Since trait_row is None, we skip clinical feature extraction
|
67 |
+
# STEP3
|
68 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
69 |
+
gene_data = get_genetic_data(matrix_file)
|
70 |
+
|
71 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
72 |
+
print(gene_data.index[:20])
|
73 |
+
# Based on the numeric pattern, these identifiers (e.g., 7892501, 7892502, etc.) are not recognized human gene symbols.
|
74 |
+
# They appear to be probe IDs that should be mapped to gene symbols for downstream analysis.
|
75 |
+
print("requires_gene_mapping = True")
|
76 |
+
# STEP5
|
77 |
+
import pandas as pd
|
78 |
+
import io
|
79 |
+
|
80 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
81 |
+
annotation_text, _ = filter_content_by_prefix(
|
82 |
+
source=soft_file,
|
83 |
+
prefixes_a=['^', '!', '#'],
|
84 |
+
unselect=True,
|
85 |
+
source_type='file',
|
86 |
+
return_df_a=False,
|
87 |
+
return_df_b=False
|
88 |
+
)
|
89 |
+
|
90 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
91 |
+
gene_annotation = pd.read_csv(
|
92 |
+
io.StringIO(annotation_text),
|
93 |
+
delimiter='\t',
|
94 |
+
on_bad_lines='skip',
|
95 |
+
engine='python'
|
96 |
+
)
|
97 |
+
|
98 |
+
print("Gene annotation preview:")
|
99 |
+
print(preview_df(gene_annotation))
|
100 |
+
# STEP: Gene Identifier Mapping
|
101 |
+
|
102 |
+
# 1. Identify the columns in the annotation dataframe that correspond to the probe ID and the gene symbol.
|
103 |
+
# From the preview above, "ID" stores the probe identifier and "gene_assignment" stores the gene information.
|
104 |
+
|
105 |
+
# 2. Generate the mapping dataframe using the library function get_gene_mapping.
|
106 |
+
mapping_df = get_gene_mapping(
|
107 |
+
annotation=gene_annotation,
|
108 |
+
prob_col="ID",
|
109 |
+
gene_col="gene_assignment"
|
110 |
+
)
|
111 |
+
|
112 |
+
# 3. Apply the mapping to convert probe-level measurements in 'gene_data' to gene-level expression.
|
113 |
+
gene_data = apply_gene_mapping(expression_df=gene_data, mapping_df=mapping_df)
|
114 |
+
|
115 |
+
# (Optional) Inspect the resulting gene_data shape or columns if desired
|
116 |
+
print("Gene expression dataframe shape after mapping:", gene_data.shape)
|
117 |
+
print("First few genes:", gene_data.index[:10].tolist())
|
118 |
+
import os
|
119 |
+
import pandas as pd
|
120 |
+
|
121 |
+
# STEP7
|
122 |
+
|
123 |
+
# 1) Normalize gene symbols and save
|
124 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
125 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
126 |
+
|
127 |
+
# Check whether we actually have a clinical CSV file (i.e., trait data) from Step 2
|
128 |
+
if os.path.exists(out_clinical_data_file):
|
129 |
+
# 2) Link the clinical and gene expression data
|
130 |
+
# Load the single-row clinical CSV without forcing an index column
|
131 |
+
tmp_df = pd.read_csv(out_clinical_data_file, header=0)
|
132 |
+
# Rename the single row to the trait. Now columns = sample IDs, index = [trait].
|
133 |
+
tmp_df.index = [trait]
|
134 |
+
selected_clinical_df = tmp_df
|
135 |
+
|
136 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
137 |
+
|
138 |
+
# 3) Handle missing values
|
139 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
140 |
+
|
141 |
+
# 4) Evaluate bias in the trait (and remove biased demographics if any)
|
142 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
143 |
+
|
144 |
+
# 5) Final validation
|
145 |
+
is_usable = validate_and_save_cohort_info(
|
146 |
+
is_final=True,
|
147 |
+
cohort=cohort,
|
148 |
+
info_path=json_path,
|
149 |
+
is_gene_available=True,
|
150 |
+
is_trait_available=True,
|
151 |
+
is_biased=trait_biased,
|
152 |
+
df=final_data,
|
153 |
+
note="Trait data successfully extracted; row renamed to trait for linking."
|
154 |
+
)
|
155 |
+
|
156 |
+
# 6) If the dataset is usable, save
|
157 |
+
if is_usable:
|
158 |
+
final_data.to_csv(out_data_file)
|
159 |
+
else:
|
160 |
+
# If the clinical file does not exist, the trait is unavailable
|
161 |
+
empty_df = pd.DataFrame()
|
162 |
+
validate_and_save_cohort_info(
|
163 |
+
is_final=True,
|
164 |
+
cohort=cohort,
|
165 |
+
info_path=json_path,
|
166 |
+
is_gene_available=True,
|
167 |
+
is_trait_available=False,
|
168 |
+
is_biased=True,
|
169 |
+
df=empty_df,
|
170 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
171 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/GSE104958.py
ADDED
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE104958"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE104958"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE104958.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE104958.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE104958.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1) Determine if gene expression data is available for this dataset
|
37 |
+
is_gene_available = True # Based on the background info indicating DNA microarray data
|
38 |
+
|
39 |
+
# 2) Identify availability of trait, age, and gender, and define conversion functions
|
40 |
+
|
41 |
+
# From the sample characteristics dictionary:
|
42 |
+
# 0 => ['organ: esophagus']
|
43 |
+
# 1 => ['tissue: cancer tissue', 'tissue: normal tissue']
|
44 |
+
#
|
45 |
+
# Row 0 has only one unique value, so it's not useful for associative studies.
|
46 |
+
# Row 1 has two unique values ("cancer tissue" and "normal tissue"), which we can treat as a binary trait.
|
47 |
+
|
48 |
+
trait_row = 1
|
49 |
+
age_row = None
|
50 |
+
gender_row = None
|
51 |
+
|
52 |
+
def convert_trait(value: str) -> int:
|
53 |
+
# Extract the substring after colon
|
54 |
+
parts = value.split(':', 1)
|
55 |
+
val = parts[1].strip().lower() if len(parts) > 1 else ''
|
56 |
+
if val == 'cancer tissue':
|
57 |
+
return 1
|
58 |
+
elif val == 'normal tissue':
|
59 |
+
return 0
|
60 |
+
else:
|
61 |
+
return None
|
62 |
+
|
63 |
+
# Since age_row and gender_row are None, we define the following but won't use them:
|
64 |
+
def convert_age(value: str) -> float:
|
65 |
+
return None
|
66 |
+
|
67 |
+
def convert_gender(value: str) -> int:
|
68 |
+
return None
|
69 |
+
|
70 |
+
# 3) Save metadata with initial filtering
|
71 |
+
is_trait_available = (trait_row is not None)
|
72 |
+
is_usable = validate_and_save_cohort_info(
|
73 |
+
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 |
+
|
80 |
+
# 4) If trait_row is not None, extract clinical features
|
81 |
+
if trait_row is not None:
|
82 |
+
selected_clinical_df = geo_select_clinical_features(
|
83 |
+
clinical_data,
|
84 |
+
trait=trait,
|
85 |
+
trait_row=trait_row,
|
86 |
+
convert_trait=convert_trait,
|
87 |
+
age_row=age_row,
|
88 |
+
convert_age=convert_age,
|
89 |
+
gender_row=gender_row,
|
90 |
+
convert_gender=convert_gender
|
91 |
+
)
|
92 |
+
# Preview the resulting clinical DataFrame
|
93 |
+
preview = preview_df(selected_clinical_df)
|
94 |
+
print("Selected clinical feature preview:", preview)
|
95 |
+
|
96 |
+
# Save clinical data to CSV
|
97 |
+
selected_clinical_df.to_csv(out_clinical_data_file, index=False)
|
98 |
+
# STEP3
|
99 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
100 |
+
gene_data = get_genetic_data(matrix_file)
|
101 |
+
|
102 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
103 |
+
print(gene_data.index[:20])
|
104 |
+
# Based on observation, these IDs look like custom transcript/probe IDs rather than standard human gene symbols.
|
105 |
+
# Therefore, gene mapping is needed.
|
106 |
+
print("requires_gene_mapping = True")
|
107 |
+
# STEP5
|
108 |
+
import pandas as pd
|
109 |
+
import io
|
110 |
+
|
111 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
112 |
+
annotation_text, _ = filter_content_by_prefix(
|
113 |
+
source=soft_file,
|
114 |
+
prefixes_a=['^', '!', '#'],
|
115 |
+
unselect=True,
|
116 |
+
source_type='file',
|
117 |
+
return_df_a=False,
|
118 |
+
return_df_b=False
|
119 |
+
)
|
120 |
+
|
121 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
122 |
+
gene_annotation = pd.read_csv(
|
123 |
+
io.StringIO(annotation_text),
|
124 |
+
delimiter='\t',
|
125 |
+
on_bad_lines='skip',
|
126 |
+
engine='python'
|
127 |
+
)
|
128 |
+
|
129 |
+
print("Gene annotation preview:")
|
130 |
+
print(preview_df(gene_annotation))
|
131 |
+
# STEP: Gene Identifier Mapping
|
132 |
+
|
133 |
+
# 1) Decide which annotation columns correspond to the gene expression identifiers and gene symbols
|
134 |
+
# From the preview, the "ID" column in the annotation corresponds to the row IDs in the expression data,
|
135 |
+
# and the "GENE_SYMBOL" column contains the gene symbols.
|
136 |
+
|
137 |
+
# 2) Create the gene mapping dataframe using these columns
|
138 |
+
mapping_df = get_gene_mapping(
|
139 |
+
annotation=gene_annotation,
|
140 |
+
prob_col="ID",
|
141 |
+
gene_col="GENE_SYMBOL"
|
142 |
+
)
|
143 |
+
|
144 |
+
# 3) Convert the probe-level expression data to gene-level expression data
|
145 |
+
gene_data = apply_gene_mapping(
|
146 |
+
expression_df=gene_data,
|
147 |
+
mapping_df=mapping_df
|
148 |
+
)
|
149 |
+
|
150 |
+
# Print a summary of the resulting gene_data
|
151 |
+
print("Mapped gene_data shape:", gene_data.shape)
|
152 |
+
print("Mapped gene_data preview:", preview_df(gene_data))
|
153 |
+
import os
|
154 |
+
import pandas as pd
|
155 |
+
|
156 |
+
# STEP7
|
157 |
+
|
158 |
+
# 1) Normalize gene symbols and save
|
159 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
160 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
161 |
+
|
162 |
+
# Check whether we actually have a clinical CSV file (i.e., trait data) from Step 2
|
163 |
+
if os.path.exists(out_clinical_data_file):
|
164 |
+
# 2) Link the clinical and gene expression data
|
165 |
+
# Load the single-row clinical CSV without forcing an index column
|
166 |
+
tmp_df = pd.read_csv(out_clinical_data_file, header=0)
|
167 |
+
# Rename the single row to the trait. Now columns = sample IDs, index = [trait].
|
168 |
+
tmp_df.index = [trait]
|
169 |
+
selected_clinical_df = tmp_df
|
170 |
+
|
171 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
172 |
+
|
173 |
+
# 3) Handle missing values
|
174 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
175 |
+
|
176 |
+
# 4) Evaluate bias in the trait (and remove biased demographics if any)
|
177 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
178 |
+
|
179 |
+
# 5) Final validation
|
180 |
+
is_usable = validate_and_save_cohort_info(
|
181 |
+
is_final=True,
|
182 |
+
cohort=cohort,
|
183 |
+
info_path=json_path,
|
184 |
+
is_gene_available=True,
|
185 |
+
is_trait_available=True,
|
186 |
+
is_biased=trait_biased,
|
187 |
+
df=final_data,
|
188 |
+
note="Trait data successfully extracted; row renamed to trait for linking."
|
189 |
+
)
|
190 |
+
|
191 |
+
# 6) If the dataset is usable, save
|
192 |
+
if is_usable:
|
193 |
+
final_data.to_csv(out_data_file)
|
194 |
+
else:
|
195 |
+
# If the clinical file does not exist, the trait is unavailable
|
196 |
+
empty_df = pd.DataFrame()
|
197 |
+
validate_and_save_cohort_info(
|
198 |
+
is_final=True,
|
199 |
+
cohort=cohort,
|
200 |
+
info_path=json_path,
|
201 |
+
is_gene_available=True,
|
202 |
+
is_trait_available=False,
|
203 |
+
is_biased=True,
|
204 |
+
df=empty_df,
|
205 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
206 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/GSE107754.py
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE107754"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE107754"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE107754.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE107754.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE107754.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1. Determine if the dataset is likely to contain gene expression data.
|
37 |
+
# From the background information, this series uses "Whole human genome gene expression microarrays",
|
38 |
+
# so we set is_gene_available to True.
|
39 |
+
is_gene_available = True
|
40 |
+
|
41 |
+
# 2. Identify variable availability and define conversion functions.
|
42 |
+
|
43 |
+
# 2.1 Availability
|
44 |
+
# We see multiple tissue types including "Esophagus cancer" in row 2, so we'll treat that as the trait indicator.
|
45 |
+
# Gender is in row 0. Age is not found anywhere.
|
46 |
+
trait_row = 2
|
47 |
+
age_row = None
|
48 |
+
gender_row = 0
|
49 |
+
|
50 |
+
# 2.2 Data Type Conversions
|
51 |
+
def convert_trait(x: str):
|
52 |
+
"""
|
53 |
+
Convert a sample characteristic string into a binary value for Esophageal_Cancer.
|
54 |
+
Return 1 if 'Esophagus cancer' is mentioned, otherwise 0.
|
55 |
+
Return None if the string format is unexpected.
|
56 |
+
"""
|
57 |
+
parts = x.split(':', 1)
|
58 |
+
if len(parts) < 2:
|
59 |
+
return None
|
60 |
+
val = parts[1].strip().lower()
|
61 |
+
# Mark as 1 if it specifically contains 'esophagus cancer', else 0
|
62 |
+
return 1 if 'esophagus cancer' in val else 0
|
63 |
+
|
64 |
+
def convert_gender(x: str):
|
65 |
+
"""
|
66 |
+
Convert a gender string into binary value: 0 for female, 1 for male.
|
67 |
+
Return None if unknown.
|
68 |
+
"""
|
69 |
+
parts = x.split(':', 1)
|
70 |
+
if len(parts) < 2:
|
71 |
+
return None
|
72 |
+
val = parts[1].strip().lower()
|
73 |
+
if val == 'female':
|
74 |
+
return 0
|
75 |
+
elif val == 'male':
|
76 |
+
return 1
|
77 |
+
else:
|
78 |
+
return None
|
79 |
+
|
80 |
+
# Since age is not available, we won't define a convert_age function (or just pass None).
|
81 |
+
convert_age = None
|
82 |
+
|
83 |
+
# 3. Save metadata with initial filtering.
|
84 |
+
is_trait_available = (trait_row is not None)
|
85 |
+
validate_and_save_cohort_info(
|
86 |
+
is_final=False,
|
87 |
+
cohort=cohort,
|
88 |
+
info_path=json_path,
|
89 |
+
is_gene_available=is_gene_available,
|
90 |
+
is_trait_available=is_trait_available
|
91 |
+
)
|
92 |
+
|
93 |
+
# 4. If trait data is available, extract clinical features, preview, and save.
|
94 |
+
if trait_row is not None:
|
95 |
+
selected_clinical_df = geo_select_clinical_features(
|
96 |
+
clinical_df=clinical_data,
|
97 |
+
trait=trait,
|
98 |
+
trait_row=trait_row,
|
99 |
+
convert_trait=convert_trait,
|
100 |
+
age_row=age_row,
|
101 |
+
convert_age=convert_age,
|
102 |
+
gender_row=gender_row,
|
103 |
+
convert_gender=convert_gender
|
104 |
+
)
|
105 |
+
preview = preview_df(selected_clinical_df, n=5, max_items=200)
|
106 |
+
print("Preview of selected clinical features:\n", preview)
|
107 |
+
|
108 |
+
selected_clinical_df.to_csv(out_clinical_data_file, index=False)
|
109 |
+
# STEP3
|
110 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
111 |
+
gene_data = get_genetic_data(matrix_file)
|
112 |
+
|
113 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
114 |
+
print(gene_data.index[:20])
|
115 |
+
# These probe IDs (e.g., A_23_P100xxx) appear to be array-specific identifiers rather than standard human gene symbols.
|
116 |
+
# Therefore, mapping is needed to convert these identifiers to canonical gene symbols.
|
117 |
+
|
118 |
+
print("requires_gene_mapping = True")
|
119 |
+
# STEP5
|
120 |
+
import pandas as pd
|
121 |
+
import io
|
122 |
+
|
123 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
124 |
+
annotation_text, _ = filter_content_by_prefix(
|
125 |
+
source=soft_file,
|
126 |
+
prefixes_a=['^', '!', '#'],
|
127 |
+
unselect=True,
|
128 |
+
source_type='file',
|
129 |
+
return_df_a=False,
|
130 |
+
return_df_b=False
|
131 |
+
)
|
132 |
+
|
133 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
134 |
+
gene_annotation = pd.read_csv(
|
135 |
+
io.StringIO(annotation_text),
|
136 |
+
delimiter='\t',
|
137 |
+
on_bad_lines='skip',
|
138 |
+
engine='python'
|
139 |
+
)
|
140 |
+
|
141 |
+
print("Gene annotation preview:")
|
142 |
+
print(preview_df(gene_annotation))
|
143 |
+
# STEP: Gene Identifier Mapping
|
144 |
+
|
145 |
+
# 1. Determine which columns map the probe IDs in the gene expression data ("ID") to the gene symbols ("GENE_SYMBOL").
|
146 |
+
# 2. Create a mapping dataframe.
|
147 |
+
mapping_df = get_gene_mapping(
|
148 |
+
annotation=gene_annotation,
|
149 |
+
prob_col='ID',
|
150 |
+
gene_col='GENE_SYMBOL'
|
151 |
+
)
|
152 |
+
|
153 |
+
# 3. Apply the mapping to convert the probe-level data into gene-level data.
|
154 |
+
gene_data = apply_gene_mapping(
|
155 |
+
expression_df=gene_data,
|
156 |
+
mapping_df=mapping_df
|
157 |
+
)
|
158 |
+
|
159 |
+
# Optional: Preview the newly mapped gene expression data.
|
160 |
+
print("Preview of gene_data after applying gene symbol mapping:")
|
161 |
+
print(preview_df(gene_data, n=5))
|
162 |
+
import os
|
163 |
+
import pandas as pd
|
164 |
+
|
165 |
+
# STEP7
|
166 |
+
|
167 |
+
# 1) Normalize gene symbols in the gene expression data,
|
168 |
+
# remove unrecognized symbols, and aggregate duplicates.
|
169 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
170 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
171 |
+
|
172 |
+
# 2) Check whether we have a clinical CSV file from previous steps.
|
173 |
+
if os.path.exists(out_clinical_data_file):
|
174 |
+
# Read the CSV so that sample IDs become columns,
|
175 |
+
# and rename rows to [trait, 'Gender'] accordingly.
|
176 |
+
tmp_df = pd.read_csv(out_clinical_data_file, header=0)
|
177 |
+
|
178 |
+
# If there are 2 rows (trait and gender), rename them.
|
179 |
+
# If only 1 row (trait only), rename just that row.
|
180 |
+
if tmp_df.shape[0] == 2:
|
181 |
+
tmp_df.index = [trait, 'Gender']
|
182 |
+
else:
|
183 |
+
tmp_df.index = [trait]
|
184 |
+
|
185 |
+
selected_clinical_df = tmp_df
|
186 |
+
|
187 |
+
# Link clinical data (now with rows as trait/covariates) and gene data.
|
188 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
189 |
+
|
190 |
+
# 3) Handle missing values (drop incomplete samples/features, then impute).
|
191 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
192 |
+
|
193 |
+
# 4) Check trait bias, and remove biased demographics if needed.
|
194 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
195 |
+
|
196 |
+
# 5) Final validation and record dataset metadata.
|
197 |
+
is_usable = validate_and_save_cohort_info(
|
198 |
+
is_final=True,
|
199 |
+
cohort=cohort,
|
200 |
+
info_path=json_path,
|
201 |
+
is_gene_available=True,
|
202 |
+
is_trait_available=True,
|
203 |
+
is_biased=trait_biased,
|
204 |
+
df=final_data,
|
205 |
+
note="Trait and gender identified in two-row clinical file; indices renamed before linking."
|
206 |
+
)
|
207 |
+
|
208 |
+
# 6) If the dataset is usable, save the final linked data.
|
209 |
+
if is_usable:
|
210 |
+
final_data.to_csv(out_data_file)
|
211 |
+
else:
|
212 |
+
# If we have no clinical file, we cannot use the dataset.
|
213 |
+
empty_df = pd.DataFrame()
|
214 |
+
validate_and_save_cohort_info(
|
215 |
+
is_final=True,
|
216 |
+
cohort=cohort,
|
217 |
+
info_path=json_path,
|
218 |
+
is_gene_available=True,
|
219 |
+
is_trait_available=False,
|
220 |
+
is_biased=True,
|
221 |
+
df=empty_df,
|
222 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
223 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/GSE131027.py
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE131027"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE131027"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE131027.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE131027.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE131027.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1. Determine if gene expression data is available
|
37 |
+
is_gene_available = True # Based on the summary indicating "investigation of expression features"
|
38 |
+
|
39 |
+
# 2. Determine data availability for trait, age, and gender
|
40 |
+
# From the sample characteristics dictionary, trait appears at key=1 with multiple cancer types,
|
41 |
+
# including "Oesophageal cancer". Age and gender information are not present.
|
42 |
+
|
43 |
+
trait_row = 1
|
44 |
+
age_row = None
|
45 |
+
gender_row = None
|
46 |
+
|
47 |
+
# 2.2 Define data type conversion functions
|
48 |
+
def convert_trait(x: str):
|
49 |
+
"""
|
50 |
+
Convert string to binary indicator of trait ("Esophageal_Cancer").
|
51 |
+
1 = Oesophageal cancer; 0 = other cancer types; None = unknown
|
52 |
+
"""
|
53 |
+
parts = x.split(':', 1)
|
54 |
+
val = parts[1].strip().lower() if len(parts) > 1 else parts[0].strip().lower()
|
55 |
+
if 'oesophageal' in val:
|
56 |
+
return 1
|
57 |
+
elif 'cancer' in val:
|
58 |
+
return 0
|
59 |
+
else:
|
60 |
+
return None
|
61 |
+
|
62 |
+
def convert_age(x: str):
|
63 |
+
"""
|
64 |
+
Not used in this dataset (age_row = None). Dummy placeholder.
|
65 |
+
"""
|
66 |
+
return None
|
67 |
+
|
68 |
+
def convert_gender(x: str):
|
69 |
+
"""
|
70 |
+
Not used in this dataset (gender_row = None). Dummy placeholder.
|
71 |
+
"""
|
72 |
+
return None
|
73 |
+
|
74 |
+
# 3. Conduct initial filtering and save metadata
|
75 |
+
# Trait is available if trait_row is not None
|
76 |
+
is_trait_available = (trait_row is not None)
|
77 |
+
|
78 |
+
metadata_result = validate_and_save_cohort_info(
|
79 |
+
is_final=False,
|
80 |
+
cohort=cohort,
|
81 |
+
info_path=json_path,
|
82 |
+
is_gene_available=is_gene_available,
|
83 |
+
is_trait_available=is_trait_available
|
84 |
+
)
|
85 |
+
|
86 |
+
# 4. If trait data is available, extract clinical features
|
87 |
+
if trait_row is not None:
|
88 |
+
selected_clinical_df = geo_select_clinical_features(
|
89 |
+
clinical_df=clinical_data,
|
90 |
+
trait=trait,
|
91 |
+
trait_row=trait_row,
|
92 |
+
convert_trait=convert_trait,
|
93 |
+
age_row=age_row,
|
94 |
+
convert_age=convert_age,
|
95 |
+
gender_row=gender_row,
|
96 |
+
convert_gender=convert_gender
|
97 |
+
)
|
98 |
+
# Preview selected clinical features
|
99 |
+
preview_dict = preview_df(selected_clinical_df, n=5)
|
100 |
+
print("Preview of selected clinical features:", preview_dict)
|
101 |
+
|
102 |
+
# Save clinical dataframe
|
103 |
+
selected_clinical_df.to_csv(out_clinical_data_file, index=False)
|
104 |
+
# STEP3
|
105 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
106 |
+
gene_data = get_genetic_data(matrix_file)
|
107 |
+
|
108 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
109 |
+
print(gene_data.index[:20])
|
110 |
+
# These identifiers (e.g., '1007_s_at', '1053_at') indicate Affymetrix probe set IDs rather than official gene symbols.
|
111 |
+
# Therefore, mapping to human gene symbols is required.
|
112 |
+
|
113 |
+
print("requires_gene_mapping = True")
|
114 |
+
# STEP5
|
115 |
+
import pandas as pd
|
116 |
+
import io
|
117 |
+
|
118 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
119 |
+
annotation_text, _ = filter_content_by_prefix(
|
120 |
+
source=soft_file,
|
121 |
+
prefixes_a=['^', '!', '#'],
|
122 |
+
unselect=True,
|
123 |
+
source_type='file',
|
124 |
+
return_df_a=False,
|
125 |
+
return_df_b=False
|
126 |
+
)
|
127 |
+
|
128 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
129 |
+
gene_annotation = pd.read_csv(
|
130 |
+
io.StringIO(annotation_text),
|
131 |
+
delimiter='\t',
|
132 |
+
on_bad_lines='skip',
|
133 |
+
engine='python'
|
134 |
+
)
|
135 |
+
|
136 |
+
print("Gene annotation preview:")
|
137 |
+
print(preview_df(gene_annotation))
|
138 |
+
# STEP: Gene Identifier Mapping
|
139 |
+
|
140 |
+
# 1. Identify the columns for probe identifiers ("ID") and gene symbols ("Gene Symbol")
|
141 |
+
# 2. Create a mapping dataframe
|
142 |
+
mapping_df = get_gene_mapping(gene_annotation, prob_col="ID", gene_col="Gene Symbol")
|
143 |
+
|
144 |
+
# 3. Convert probe-level data to gene expression data
|
145 |
+
gene_data = apply_gene_mapping(gene_data, mapping_df)
|
146 |
+
|
147 |
+
# Print a quick check of the transformed gene_data
|
148 |
+
print("Mapped gene_data shape:", gene_data.shape)
|
149 |
+
print("Mapped gene_data preview:\n", gene_data.head(5))
|
150 |
+
import os
|
151 |
+
import pandas as pd
|
152 |
+
|
153 |
+
# STEP7
|
154 |
+
|
155 |
+
# 1) Normalize gene symbols and save
|
156 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
157 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
158 |
+
|
159 |
+
# Check whether we actually have a clinical CSV file (i.e., trait data) from Step 2
|
160 |
+
if os.path.exists(out_clinical_data_file):
|
161 |
+
# 2) Link the clinical and gene expression data
|
162 |
+
# Load the single-row clinical CSV without forcing an index column
|
163 |
+
tmp_df = pd.read_csv(out_clinical_data_file, header=0)
|
164 |
+
# Rename the single row to the trait. Now columns = sample IDs, index = [trait].
|
165 |
+
tmp_df.index = [trait]
|
166 |
+
selected_clinical_df = tmp_df
|
167 |
+
|
168 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
169 |
+
|
170 |
+
# 3) Handle missing values
|
171 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
172 |
+
|
173 |
+
# 4) Evaluate bias in the trait (and remove biased demographics if any)
|
174 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
175 |
+
|
176 |
+
# 5) Final validation
|
177 |
+
is_usable = validate_and_save_cohort_info(
|
178 |
+
is_final=True,
|
179 |
+
cohort=cohort,
|
180 |
+
info_path=json_path,
|
181 |
+
is_gene_available=True,
|
182 |
+
is_trait_available=True,
|
183 |
+
is_biased=trait_biased,
|
184 |
+
df=final_data,
|
185 |
+
note="Trait data successfully extracted; row renamed to trait for linking."
|
186 |
+
)
|
187 |
+
|
188 |
+
# 6) If the dataset is usable, save
|
189 |
+
if is_usable:
|
190 |
+
final_data.to_csv(out_data_file)
|
191 |
+
else:
|
192 |
+
# If the clinical file does not exist, the trait is unavailable
|
193 |
+
empty_df = pd.DataFrame()
|
194 |
+
validate_and_save_cohort_info(
|
195 |
+
is_final=True,
|
196 |
+
cohort=cohort,
|
197 |
+
info_path=json_path,
|
198 |
+
is_gene_available=True,
|
199 |
+
is_trait_available=False,
|
200 |
+
is_biased=True,
|
201 |
+
df=empty_df,
|
202 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
203 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/GSE156915.py
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE156915"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE156915"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE156915.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE156915.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE156915.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1. Gene Expression Data Availability
|
37 |
+
# Based on the background info stating "Whole transcriptome" data were used, we set is_gene_available to True.
|
38 |
+
is_gene_available = True
|
39 |
+
|
40 |
+
# 2. Variable Availability and Data Type Conversion
|
41 |
+
# The sample characteristics do not provide information for our trait ("Esophageal_Cancer"), nor age or gender.
|
42 |
+
# Hence, all rows are None.
|
43 |
+
trait_row = None
|
44 |
+
age_row = None
|
45 |
+
gender_row = None
|
46 |
+
|
47 |
+
# Define minimal conversion functions (they will not be used since all rows are None).
|
48 |
+
def convert_trait(value: str) -> float:
|
49 |
+
return None
|
50 |
+
|
51 |
+
def convert_age(value: str) -> float:
|
52 |
+
return None
|
53 |
+
|
54 |
+
def convert_gender(value: str) -> int:
|
55 |
+
return None
|
56 |
+
|
57 |
+
# 3. Save Metadata (initial filtering)
|
58 |
+
# Trait data availability is determined by whether trait_row is None.
|
59 |
+
is_trait_available = (trait_row is not None)
|
60 |
+
|
61 |
+
is_usable = validate_and_save_cohort_info(
|
62 |
+
is_final=False,
|
63 |
+
cohort=cohort,
|
64 |
+
info_path=json_path,
|
65 |
+
is_gene_available=is_gene_available,
|
66 |
+
is_trait_available=is_trait_available
|
67 |
+
)
|
68 |
+
print("is_usable:", is_usable)
|
69 |
+
|
70 |
+
# 4. Clinical Feature Extraction
|
71 |
+
# Since trait_row is None, we skip the clinical feature extraction step.
|
p1/preprocess/Esophageal_Cancer/code/GSE218109.py
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE218109"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE218109"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE218109.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE218109.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE218109.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1. Determine if this dataset is likely to contain gene expression data
|
37 |
+
is_gene_available = True # Based on "Transcriptional profiling" info
|
38 |
+
|
39 |
+
# 2.1 Identify availability of trait, age, and gender
|
40 |
+
# The dictionary shows "tissue" is constant (everyone has ESCC), so no variation => no valid trait data
|
41 |
+
trait_row = None
|
42 |
+
|
43 |
+
# Key 1 contains multiple ages
|
44 |
+
age_row = 1
|
45 |
+
|
46 |
+
# Key 0 contains sex categories (M, F)
|
47 |
+
gender_row = 0
|
48 |
+
|
49 |
+
# 2.2 Define data type conversion functions
|
50 |
+
|
51 |
+
def convert_trait(x: str):
|
52 |
+
# Trait data not available; always return None
|
53 |
+
return None
|
54 |
+
|
55 |
+
def convert_age(x: str):
|
56 |
+
# Example: "age: 45" -> 45 (int). Convert errors to None
|
57 |
+
parts = x.split(':', 1)
|
58 |
+
if len(parts) < 2:
|
59 |
+
return None
|
60 |
+
try:
|
61 |
+
return float(parts[1].strip())
|
62 |
+
except ValueError:
|
63 |
+
return None
|
64 |
+
|
65 |
+
def convert_gender(x: str):
|
66 |
+
# Example: "Sex: M" -> 1, "Sex: F" -> 0
|
67 |
+
parts = x.split(':', 1)
|
68 |
+
if len(parts) < 2:
|
69 |
+
return None
|
70 |
+
val = parts[1].strip().lower()
|
71 |
+
if val == 'm':
|
72 |
+
return 1
|
73 |
+
elif val == 'f':
|
74 |
+
return 0
|
75 |
+
else:
|
76 |
+
return None
|
77 |
+
|
78 |
+
# 3. Initial filtering and metadata saving
|
79 |
+
is_trait_available = (trait_row is not None)
|
80 |
+
is_usable = validate_and_save_cohort_info(
|
81 |
+
is_final=False,
|
82 |
+
cohort=cohort,
|
83 |
+
info_path=json_path,
|
84 |
+
is_gene_available=is_gene_available,
|
85 |
+
is_trait_available=is_trait_available
|
86 |
+
)
|
87 |
+
|
88 |
+
# 4. Clinical Feature Extraction (skip if trait_row is None)
|
89 |
+
if trait_row is not None:
|
90 |
+
selected_clinical_df = geo_select_clinical_features(
|
91 |
+
clinical_data, # assuming the DataFrame is available in variable 'clinical_data'
|
92 |
+
trait=trait,
|
93 |
+
trait_row=trait_row,
|
94 |
+
convert_trait=convert_trait,
|
95 |
+
age_row=age_row,
|
96 |
+
convert_age=convert_age,
|
97 |
+
gender_row=gender_row,
|
98 |
+
convert_gender=convert_gender
|
99 |
+
)
|
100 |
+
print("Preview of selected clinical features:")
|
101 |
+
print(preview_df(selected_clinical_df))
|
102 |
+
selected_clinical_df.to_csv(out_clinical_data_file, index=False)
|
103 |
+
# STEP3
|
104 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
105 |
+
gene_data = get_genetic_data(matrix_file)
|
106 |
+
|
107 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
108 |
+
print(gene_data.index[:20])
|
109 |
+
# Based on the provided index, these are numeric identifiers rather than typical human gene symbols.
|
110 |
+
|
111 |
+
# Conclude by indicating if gene mapping is required:
|
112 |
+
requires_gene_mapping = True
|
113 |
+
# STEP5
|
114 |
+
import pandas as pd
|
115 |
+
import io
|
116 |
+
|
117 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
118 |
+
annotation_text, _ = filter_content_by_prefix(
|
119 |
+
source=soft_file,
|
120 |
+
prefixes_a=['^', '!', '#'],
|
121 |
+
unselect=True,
|
122 |
+
source_type='file',
|
123 |
+
return_df_a=False,
|
124 |
+
return_df_b=False
|
125 |
+
)
|
126 |
+
|
127 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
128 |
+
gene_annotation = pd.read_csv(
|
129 |
+
io.StringIO(annotation_text),
|
130 |
+
delimiter='\t',
|
131 |
+
on_bad_lines='skip',
|
132 |
+
engine='python'
|
133 |
+
)
|
134 |
+
|
135 |
+
print("Gene annotation preview:")
|
136 |
+
print(preview_df(gene_annotation))
|
137 |
+
# STEP6: Gene Identifier Mapping
|
138 |
+
|
139 |
+
# 1. Decide which columns represent the probe IDs and the gene symbols
|
140 |
+
# From the dictionary preview, it seems "ID" is the probe identifier and "GENE_SYMBOL" holds the gene symbol field.
|
141 |
+
|
142 |
+
# 2. Create a gene mapping dataframe
|
143 |
+
mapping_df = get_gene_mapping(
|
144 |
+
annotation=gene_annotation,
|
145 |
+
prob_col="ID", # Probe identifier column
|
146 |
+
gene_col="GENE_SYMBOL" # Gene symbol column
|
147 |
+
)
|
148 |
+
|
149 |
+
# 3. Convert the probe-level measurements to gene-level expression data
|
150 |
+
gene_data = apply_gene_mapping(
|
151 |
+
expression_df=gene_data, # The probe-level DataFrame previously read
|
152 |
+
mapping_df=mapping_df
|
153 |
+
)
|
154 |
+
|
155 |
+
# For verification, let's inspect the updated gene_data
|
156 |
+
print("Mapped gene_data shape:", gene_data.shape)
|
157 |
+
print("First few gene symbols after mapping:", gene_data.index[:10].tolist())
|
158 |
+
import os
|
159 |
+
import pandas as pd
|
160 |
+
|
161 |
+
# STEP7
|
162 |
+
|
163 |
+
# 1) Normalize gene symbols and save
|
164 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
165 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
166 |
+
|
167 |
+
# Check whether we actually have a clinical CSV file (i.e., trait data) from Step 2
|
168 |
+
if os.path.exists(out_clinical_data_file):
|
169 |
+
# 2) Link the clinical and gene expression data
|
170 |
+
# Load the single-row clinical CSV without forcing an index column
|
171 |
+
tmp_df = pd.read_csv(out_clinical_data_file, header=0)
|
172 |
+
# Rename the single row to the trait. Now columns = sample IDs, index = [trait].
|
173 |
+
tmp_df.index = [trait]
|
174 |
+
selected_clinical_df = tmp_df
|
175 |
+
|
176 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
177 |
+
|
178 |
+
# 3) Handle missing values
|
179 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
180 |
+
|
181 |
+
# 4) Evaluate bias in the trait (and remove biased demographics if any)
|
182 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
183 |
+
|
184 |
+
# 5) Final validation
|
185 |
+
is_usable = validate_and_save_cohort_info(
|
186 |
+
is_final=True,
|
187 |
+
cohort=cohort,
|
188 |
+
info_path=json_path,
|
189 |
+
is_gene_available=True,
|
190 |
+
is_trait_available=True,
|
191 |
+
is_biased=trait_biased,
|
192 |
+
df=final_data,
|
193 |
+
note="Trait data successfully extracted; row renamed to trait for linking."
|
194 |
+
)
|
195 |
+
|
196 |
+
# 6) If the dataset is usable, save
|
197 |
+
if is_usable:
|
198 |
+
final_data.to_csv(out_data_file)
|
199 |
+
else:
|
200 |
+
# If the clinical file does not exist, the trait is unavailable
|
201 |
+
empty_df = pd.DataFrame()
|
202 |
+
validate_and_save_cohort_info(
|
203 |
+
is_final=True,
|
204 |
+
cohort=cohort,
|
205 |
+
info_path=json_path,
|
206 |
+
is_gene_available=True,
|
207 |
+
is_trait_available=False,
|
208 |
+
is_biased=True,
|
209 |
+
df=empty_df,
|
210 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
211 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/GSE55857.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE55857"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE55857"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE55857.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE55857.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE55857.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1) Determine if gene expression data is available
|
37 |
+
is_gene_available = False # This dataset is about small non-coding RNAs (miRNAs), not mRNA gene expression
|
38 |
+
|
39 |
+
# 2) Identify rows for trait, age, and gender
|
40 |
+
trait_row = 1 # "tissue: ESCC normal"/"tissue: ESCC tumor"
|
41 |
+
age_row = None
|
42 |
+
gender_row = None
|
43 |
+
|
44 |
+
# 2.2) Define conversion functions
|
45 |
+
def convert_trait(value: str):
|
46 |
+
parts = value.split(':', 1)
|
47 |
+
if len(parts) < 2:
|
48 |
+
return None
|
49 |
+
label = parts[1].strip().lower()
|
50 |
+
if 'tumor' in label:
|
51 |
+
return 1
|
52 |
+
elif 'normal' in label:
|
53 |
+
return 0
|
54 |
+
return None
|
55 |
+
|
56 |
+
def convert_age(value: str):
|
57 |
+
return None
|
58 |
+
|
59 |
+
def convert_gender(value: str):
|
60 |
+
return None
|
61 |
+
|
62 |
+
# 3) Perform initial filtering and save metadata
|
63 |
+
is_trait_available = (trait_row is not None)
|
64 |
+
_ = validate_and_save_cohort_info(
|
65 |
+
is_final=False,
|
66 |
+
cohort=cohort,
|
67 |
+
info_path=json_path,
|
68 |
+
is_gene_available=is_gene_available,
|
69 |
+
is_trait_available=is_trait_available
|
70 |
+
)
|
71 |
+
|
72 |
+
# 4) If trait data is available, extract and save clinical features
|
73 |
+
if trait_row is not None:
|
74 |
+
selected_clinical_df = geo_select_clinical_features(
|
75 |
+
clinical_data,
|
76 |
+
trait=trait,
|
77 |
+
trait_row=trait_row,
|
78 |
+
convert_trait=convert_trait,
|
79 |
+
age_row=age_row,
|
80 |
+
convert_age=convert_age,
|
81 |
+
gender_row=gender_row,
|
82 |
+
convert_gender=convert_gender
|
83 |
+
)
|
84 |
+
# Preview the extracted clinical data
|
85 |
+
previewed_clinical = preview_df(selected_clinical_df)
|
86 |
+
print(previewed_clinical)
|
87 |
+
|
88 |
+
# Save the clinical data to CSV
|
89 |
+
selected_clinical_df.to_csv(out_clinical_data_file, index=False)
|
p1/preprocess/Esophageal_Cancer/code/GSE66258.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE66258"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE66258"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE66258.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE66258.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE66258.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1. Gene Expression Data Availability
|
37 |
+
is_gene_available = False # The dataset focuses on small non-coding RNAs (sncRNAs), which is not standard mRNA expression data.
|
38 |
+
|
39 |
+
# 2. Variable Availability and Data Type Conversion
|
40 |
+
|
41 |
+
# Based on sample characteristics, row 0 has a single unique value: 'tissue: esophageal squamous cell carcinoma (ESCC) tumor'
|
42 |
+
# and row 1 has only IDs. Neither age nor gender is provided. Hence, all are effectively unavailable or constant.
|
43 |
+
|
44 |
+
trait_row = None # No varying trait information found
|
45 |
+
age_row = None # No age information
|
46 |
+
gender_row = None # No gender information
|
47 |
+
|
48 |
+
# Since none of them are available, we set is_trait_available to False
|
49 |
+
is_trait_available = (trait_row is not None)
|
50 |
+
|
51 |
+
# We won't define conversion functions because there's no available data to convert.
|
52 |
+
# But for completeness, we'll define stubs:
|
53 |
+
|
54 |
+
def convert_trait(x: str) -> float:
|
55 |
+
return None
|
56 |
+
|
57 |
+
def convert_age(x: str) -> float:
|
58 |
+
return None
|
59 |
+
|
60 |
+
def convert_gender(x: str) -> int:
|
61 |
+
return None
|
62 |
+
|
63 |
+
# 3. Save Metadata: initial filtering
|
64 |
+
# Trait data is not available, so the dataset fails initial filtering on trait availability.
|
65 |
+
is_usable = validate_and_save_cohort_info(
|
66 |
+
is_final=False,
|
67 |
+
cohort=cohort,
|
68 |
+
info_path=json_path,
|
69 |
+
is_gene_available=is_gene_available,
|
70 |
+
is_trait_available=is_trait_available
|
71 |
+
)
|
72 |
+
|
73 |
+
# 4. Clinical Feature Extraction
|
74 |
+
# Because trait_row is None, we skip this sub-step.
|
p1/preprocess/Esophageal_Cancer/code/GSE75241.py
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE75241"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE75241"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE75241.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE75241.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE75241.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1. Determine gene expression data availability
|
37 |
+
is_gene_available = True # Based on the series title indicating gene expression data
|
38 |
+
|
39 |
+
# 2. Identify data availability and define row indices for trait, age, gender
|
40 |
+
trait_row = 1 # "tissue: nonmalignant surrounding mucosa" or "tissue: esophageal tumor"
|
41 |
+
age_row = None # Not found
|
42 |
+
gender_row = None # Not found
|
43 |
+
|
44 |
+
# 2.2 Define data conversion functions
|
45 |
+
|
46 |
+
def convert_trait(value: str):
|
47 |
+
"""
|
48 |
+
Convert trait-related strings to binary:
|
49 |
+
- 'nonmalignant' -> 0
|
50 |
+
- 'tumor' -> 1
|
51 |
+
Unknown/empty -> None
|
52 |
+
"""
|
53 |
+
if not value or pd.isna(value):
|
54 |
+
return None
|
55 |
+
parts = value.split(':', 1)
|
56 |
+
if len(parts) < 2:
|
57 |
+
return None
|
58 |
+
val = parts[1].strip().lower()
|
59 |
+
if 'nonmalignant' in val:
|
60 |
+
return 0
|
61 |
+
elif 'tumor' in val:
|
62 |
+
return 1
|
63 |
+
else:
|
64 |
+
return None
|
65 |
+
|
66 |
+
def convert_age(value: str):
|
67 |
+
"""
|
68 |
+
No age data available for this dataset, so return None.
|
69 |
+
"""
|
70 |
+
return None
|
71 |
+
|
72 |
+
def convert_gender(value: str):
|
73 |
+
"""
|
74 |
+
No gender data available for this dataset, so return None.
|
75 |
+
"""
|
76 |
+
return None
|
77 |
+
|
78 |
+
# 3. Conduct initial filtering to save metadata
|
79 |
+
is_trait_available = (trait_row is not None)
|
80 |
+
is_usable = validate_and_save_cohort_info(
|
81 |
+
is_final=False,
|
82 |
+
cohort=cohort,
|
83 |
+
info_path=json_path,
|
84 |
+
is_gene_available=is_gene_available,
|
85 |
+
is_trait_available=is_trait_available
|
86 |
+
)
|
87 |
+
|
88 |
+
# 4. Clinical feature extraction if trait data is available
|
89 |
+
if trait_row is not None:
|
90 |
+
selected_clinical_df = geo_select_clinical_features(
|
91 |
+
clinical_data,
|
92 |
+
trait=trait,
|
93 |
+
trait_row=trait_row,
|
94 |
+
convert_trait=convert_trait,
|
95 |
+
age_row=age_row,
|
96 |
+
convert_age=convert_age,
|
97 |
+
gender_row=gender_row,
|
98 |
+
convert_gender=convert_gender
|
99 |
+
)
|
100 |
+
|
101 |
+
# Preview the result
|
102 |
+
previewed = preview_df(selected_clinical_df)
|
103 |
+
print("Preview of selected clinical features:", previewed)
|
104 |
+
|
105 |
+
# Save clinical features to CSV
|
106 |
+
selected_clinical_df.to_csv(out_clinical_data_file, index=False)
|
107 |
+
# STEP3
|
108 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
109 |
+
gene_data = get_genetic_data(matrix_file)
|
110 |
+
|
111 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
112 |
+
print(gene_data.index[:20])
|
113 |
+
# Based on the provided gene IDs, they appear to be platform-specific probe identifiers rather than standard human gene symbols.
|
114 |
+
# Therefore, they require mapping to gene symbols.
|
115 |
+
print("requires_gene_mapping = True")
|
116 |
+
# STEP5
|
117 |
+
import pandas as pd
|
118 |
+
import io
|
119 |
+
|
120 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
121 |
+
annotation_text, _ = filter_content_by_prefix(
|
122 |
+
source=soft_file,
|
123 |
+
prefixes_a=['^', '!', '#'],
|
124 |
+
unselect=True,
|
125 |
+
source_type='file',
|
126 |
+
return_df_a=False,
|
127 |
+
return_df_b=False
|
128 |
+
)
|
129 |
+
|
130 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
131 |
+
gene_annotation = pd.read_csv(
|
132 |
+
io.StringIO(annotation_text),
|
133 |
+
delimiter='\t',
|
134 |
+
on_bad_lines='skip',
|
135 |
+
engine='python'
|
136 |
+
)
|
137 |
+
|
138 |
+
print("Gene annotation preview:")
|
139 |
+
print(preview_df(gene_annotation))
|
140 |
+
# STEP: Gene Identifier Mapping
|
141 |
+
|
142 |
+
# 1. Identify columns containing matching probe identifiers and gene symbols
|
143 |
+
id_col = "ID" # Matches the probe IDs of the gene expression data
|
144 |
+
symbol_col = "gene_assignment" # Contains gene symbols embedded in the text
|
145 |
+
|
146 |
+
# 2. Get the gene-probe mapping DataFrame
|
147 |
+
mapping_df = get_gene_mapping(gene_annotation, prob_col=id_col, gene_col=symbol_col)
|
148 |
+
|
149 |
+
# 3. Convert probe-level measurements into gene-level expression data
|
150 |
+
gene_data = apply_gene_mapping(gene_data, mapping_df)
|
151 |
+
import os
|
152 |
+
import pandas as pd
|
153 |
+
|
154 |
+
# STEP7
|
155 |
+
|
156 |
+
# 1) Normalize gene symbols and save
|
157 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
158 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
159 |
+
|
160 |
+
# Check whether we actually have a clinical CSV file (i.e., trait data) from Step 2
|
161 |
+
if os.path.exists(out_clinical_data_file):
|
162 |
+
# 2) Link the clinical and gene expression data
|
163 |
+
# Load the single-row clinical CSV without forcing an index column
|
164 |
+
tmp_df = pd.read_csv(out_clinical_data_file, header=0)
|
165 |
+
# Rename the single row to the trait. Now columns = sample IDs, index = [trait].
|
166 |
+
tmp_df.index = [trait]
|
167 |
+
selected_clinical_df = tmp_df
|
168 |
+
|
169 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
170 |
+
|
171 |
+
# 3) Handle missing values
|
172 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
173 |
+
|
174 |
+
# 4) Evaluate bias in the trait (and remove biased demographics if any)
|
175 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
176 |
+
|
177 |
+
# 5) Final validation
|
178 |
+
is_usable = validate_and_save_cohort_info(
|
179 |
+
is_final=True,
|
180 |
+
cohort=cohort,
|
181 |
+
info_path=json_path,
|
182 |
+
is_gene_available=True,
|
183 |
+
is_trait_available=True,
|
184 |
+
is_biased=trait_biased,
|
185 |
+
df=final_data,
|
186 |
+
note="Trait data successfully extracted; row renamed to trait for linking."
|
187 |
+
)
|
188 |
+
|
189 |
+
# 6) If the dataset is usable, save
|
190 |
+
if is_usable:
|
191 |
+
final_data.to_csv(out_data_file)
|
192 |
+
else:
|
193 |
+
# If the clinical file does not exist, the trait is unavailable
|
194 |
+
empty_df = pd.DataFrame()
|
195 |
+
validate_and_save_cohort_info(
|
196 |
+
is_final=True,
|
197 |
+
cohort=cohort,
|
198 |
+
info_path=json_path,
|
199 |
+
is_gene_available=True,
|
200 |
+
is_trait_available=False,
|
201 |
+
is_biased=True,
|
202 |
+
df=empty_df,
|
203 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
204 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/GSE77790.py
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
cohort = "GSE77790"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Esophageal_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Esophageal_Cancer/GSE77790"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/GSE77790.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/GSE77790.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/GSE77790.csv"
|
16 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# STEP1
|
19 |
+
from tools.preprocess import *
|
20 |
+
# 1. Identify the paths to the SOFT file and the matrix file
|
21 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
22 |
+
|
23 |
+
# 2. Read the matrix file to obtain background information and sample characteristics data
|
24 |
+
background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']
|
25 |
+
clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']
|
26 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)
|
27 |
+
|
28 |
+
# 3. Obtain the sample characteristics dictionary from the clinical dataframe
|
29 |
+
sample_characteristics_dict = get_unique_values_by_row(clinical_data)
|
30 |
+
|
31 |
+
# 4. Explicitly print out all the background information and the sample characteristics dictionary
|
32 |
+
print("Background Information:")
|
33 |
+
print(background_info)
|
34 |
+
print("Sample Characteristics Dictionary:")
|
35 |
+
print(sample_characteristics_dict)
|
36 |
+
# 1) Determine if gene expression data is available
|
37 |
+
is_gene_available = True # Based on "Agilent whole genome microarrays" mention
|
38 |
+
|
39 |
+
# 2) Identify availability of variables and define conversion functions
|
40 |
+
|
41 |
+
# From the sample characteristics dictionary, row 1 contains labels like
|
42 |
+
# 'cell type: lung squamous cell carcinoma', 'cell type: esophageal cancer', etc.
|
43 |
+
# We can use row 1 to infer the presence or absence of "esophageal cancer".
|
44 |
+
trait_row = 1 # We have multiple distinct values including "esophageal cancer", so it's valid
|
45 |
+
|
46 |
+
# No row indicates age or gender information. Hence, set them to None.
|
47 |
+
age_row = None
|
48 |
+
gender_row = None
|
49 |
+
|
50 |
+
# Conversion function for the trait. We map "esophageal cancer" to 1, all others to 0.
|
51 |
+
def convert_trait(value: str) -> int:
|
52 |
+
"""
|
53 |
+
Convert cell type strings to a binary indicator for 'esophageal cancer'.
|
54 |
+
Unknown or unrecognized strings return 0 by default (non-esophageal).
|
55 |
+
"""
|
56 |
+
# Typically the format is "cell type: something"
|
57 |
+
parts = value.split(':', 1)
|
58 |
+
if len(parts) < 2:
|
59 |
+
return 0
|
60 |
+
label = parts[1].strip().lower()
|
61 |
+
if 'esophageal' in label:
|
62 |
+
return 1
|
63 |
+
return 0
|
64 |
+
|
65 |
+
# Since age_row = None and gender_row = None, we define placeholder converters
|
66 |
+
def convert_age(value: str):
|
67 |
+
return None
|
68 |
+
|
69 |
+
def convert_gender(value: str):
|
70 |
+
return None
|
71 |
+
|
72 |
+
# 3) Conduct initial filtering and save metadata
|
73 |
+
is_trait_available = (trait_row is not None)
|
74 |
+
validate_and_save_cohort_info(
|
75 |
+
is_final=False,
|
76 |
+
cohort=cohort,
|
77 |
+
info_path=json_path,
|
78 |
+
is_gene_available=is_gene_available,
|
79 |
+
is_trait_available=is_trait_available
|
80 |
+
)
|
81 |
+
|
82 |
+
# 4) If trait_row is available, extract and preview clinical features, then save
|
83 |
+
if trait_row is not None:
|
84 |
+
clinical_features_df = geo_select_clinical_features(
|
85 |
+
clinical_data,
|
86 |
+
trait=trait,
|
87 |
+
trait_row=trait_row,
|
88 |
+
convert_trait=convert_trait,
|
89 |
+
age_row=age_row,
|
90 |
+
convert_age=convert_age,
|
91 |
+
gender_row=gender_row,
|
92 |
+
convert_gender=convert_gender
|
93 |
+
)
|
94 |
+
print("Preview of selected clinical features:")
|
95 |
+
print(preview_df(clinical_features_df, n=5))
|
96 |
+
clinical_features_df.to_csv(out_clinical_data_file, index=True)
|
97 |
+
# STEP3
|
98 |
+
# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.
|
99 |
+
gene_data = get_genetic_data(matrix_file)
|
100 |
+
|
101 |
+
# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.
|
102 |
+
print(gene_data.index[:20])
|
103 |
+
# Based on the numeric IDs observed, these are not standard human gene symbols.
|
104 |
+
# Hence, they would require mapping to human gene symbols.
|
105 |
+
print("requires_gene_mapping = True")
|
106 |
+
# STEP5
|
107 |
+
import pandas as pd
|
108 |
+
import io
|
109 |
+
|
110 |
+
# 1. Extract the lines that do NOT start with '^', '!', or '#', but do NOT parse them into a DataFrame yet.
|
111 |
+
annotation_text, _ = filter_content_by_prefix(
|
112 |
+
source=soft_file,
|
113 |
+
prefixes_a=['^', '!', '#'],
|
114 |
+
unselect=True,
|
115 |
+
source_type='file',
|
116 |
+
return_df_a=False,
|
117 |
+
return_df_b=False
|
118 |
+
)
|
119 |
+
|
120 |
+
# 2. Manually parse the filtered text into a DataFrame, specifying engine="python" to avoid buffer overflow issues.
|
121 |
+
gene_annotation = pd.read_csv(
|
122 |
+
io.StringIO(annotation_text),
|
123 |
+
delimiter='\t',
|
124 |
+
on_bad_lines='skip',
|
125 |
+
engine='python'
|
126 |
+
)
|
127 |
+
|
128 |
+
print("Gene annotation preview:")
|
129 |
+
print(preview_df(gene_annotation))
|
130 |
+
# STEP: Gene Identifier Mapping
|
131 |
+
# 1) Identify columns for gene ID and gene symbol
|
132 |
+
# From the annotation preview, 'ID' matches the probe ID used in gene_data,
|
133 |
+
# and 'GENE_SYMBOL' stores the gene symbols.
|
134 |
+
|
135 |
+
mapping_df = get_gene_mapping(
|
136 |
+
annotation=gene_annotation,
|
137 |
+
prob_col="ID",
|
138 |
+
gene_col="GENE_SYMBOL"
|
139 |
+
)
|
140 |
+
|
141 |
+
# 2) Convert probe-level measurements to gene-level expression
|
142 |
+
gene_data = apply_gene_mapping(
|
143 |
+
expression_df=gene_data,
|
144 |
+
mapping_df=mapping_df
|
145 |
+
)
|
146 |
+
|
147 |
+
# (Optional) Preview the mapped gene expression data
|
148 |
+
print("Preview of mapped gene expression data:")
|
149 |
+
print(preview_df(gene_data, n=5))
|
150 |
+
import os
|
151 |
+
import pandas as pd
|
152 |
+
|
153 |
+
# STEP7
|
154 |
+
|
155 |
+
# 1) Normalize gene symbols and save
|
156 |
+
normalized_gene_data = normalize_gene_symbols_in_index(gene_data)
|
157 |
+
normalized_gene_data.to_csv(out_gene_data_file)
|
158 |
+
|
159 |
+
# Check whether we actually have a clinical CSV file (i.e., trait data) from Step 2
|
160 |
+
if os.path.exists(out_clinical_data_file):
|
161 |
+
# 2) Link the clinical and gene expression data
|
162 |
+
# Load the clinical data with its row index (features) from the CSV
|
163 |
+
selected_clinical_df = pd.read_csv(out_clinical_data_file, header=0, index_col=0)
|
164 |
+
|
165 |
+
# Link
|
166 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, normalized_gene_data)
|
167 |
+
|
168 |
+
# 3) Handle missing values
|
169 |
+
final_data = handle_missing_values(linked_data, trait_col=trait)
|
170 |
+
|
171 |
+
# 4) Evaluate bias in the trait (and remove biased demographics if any)
|
172 |
+
trait_biased, final_data = judge_and_remove_biased_features(final_data, trait)
|
173 |
+
|
174 |
+
# 5) Final validation
|
175 |
+
is_usable = validate_and_save_cohort_info(
|
176 |
+
is_final=True,
|
177 |
+
cohort=cohort,
|
178 |
+
info_path=json_path,
|
179 |
+
is_gene_available=True,
|
180 |
+
is_trait_available=True,
|
181 |
+
is_biased=trait_biased,
|
182 |
+
df=final_data,
|
183 |
+
note="Trait data successfully extracted; index set from CSV directly."
|
184 |
+
)
|
185 |
+
|
186 |
+
# 6) If the dataset is usable, save
|
187 |
+
if is_usable:
|
188 |
+
final_data.to_csv(out_data_file)
|
189 |
+
else:
|
190 |
+
# If the clinical file does not exist, the trait is unavailable
|
191 |
+
empty_df = pd.DataFrame()
|
192 |
+
validate_and_save_cohort_info(
|
193 |
+
is_final=True,
|
194 |
+
cohort=cohort,
|
195 |
+
info_path=json_path,
|
196 |
+
is_gene_available=True,
|
197 |
+
is_trait_available=False,
|
198 |
+
is_biased=True,
|
199 |
+
df=empty_df,
|
200 |
+
note="No trait data was found; linking and final dataset output are skipped."
|
201 |
+
)
|
p1/preprocess/Esophageal_Cancer/code/TCGA.py
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Esophageal_Cancer"
|
6 |
+
|
7 |
+
# Input paths
|
8 |
+
tcga_root_dir = "../DATA/TCGA"
|
9 |
+
|
10 |
+
# Output paths
|
11 |
+
out_data_file = "./output/preprocess/1/Esophageal_Cancer/TCGA.csv"
|
12 |
+
out_gene_data_file = "./output/preprocess/1/Esophageal_Cancer/gene_data/TCGA.csv"
|
13 |
+
out_clinical_data_file = "./output/preprocess/1/Esophageal_Cancer/clinical_data/TCGA.csv"
|
14 |
+
json_path = "./output/preprocess/1/Esophageal_Cancer/cohort_info.json"
|
15 |
+
|
16 |
+
import os
|
17 |
+
import pandas as pd
|
18 |
+
|
19 |
+
# 1. Identify subdirectories under tcga_root_dir
|
20 |
+
subdirectories = os.listdir(tcga_root_dir)
|
21 |
+
|
22 |
+
trait_subdir = None
|
23 |
+
for d in subdirectories:
|
24 |
+
# Check if the directory name contains "esophageal" or "esca" (lowercase match)
|
25 |
+
if "esophageal" in d.lower() or "esca" in d.lower():
|
26 |
+
trait_subdir = d
|
27 |
+
break
|
28 |
+
|
29 |
+
# 2. If none found, skip this trait
|
30 |
+
if not trait_subdir:
|
31 |
+
print(f"No suitable subdirectory found for trait '{trait}'. Skipping...")
|
32 |
+
is_gene_available = False
|
33 |
+
is_trait_available = False
|
34 |
+
validate_and_save_cohort_info(
|
35 |
+
is_final=False,
|
36 |
+
cohort="TCGA",
|
37 |
+
info_path=json_path,
|
38 |
+
is_gene_available=is_gene_available,
|
39 |
+
is_trait_available=is_trait_available
|
40 |
+
)
|
41 |
+
else:
|
42 |
+
# Identify the paths to the clinical and genetic data files
|
43 |
+
full_subdir_path = os.path.join(tcga_root_dir, trait_subdir)
|
44 |
+
clinical_path, genetic_path = tcga_get_relevant_filepaths(full_subdir_path)
|
45 |
+
|
46 |
+
# 3. Load data into DataFrames
|
47 |
+
clinical_df = pd.read_csv(clinical_path, index_col=0, sep='\t')
|
48 |
+
genetic_df = pd.read_csv(genetic_path, index_col=0, sep='\t')
|
49 |
+
|
50 |
+
# 4. Print the column names of the clinical data for inspection
|
51 |
+
print("Clinical Data Columns:")
|
52 |
+
print(clinical_df.columns.tolist())
|
53 |
+
candidate_age_cols = ["age_at_initial_pathologic_diagnosis", "age_began_smoking_in_years"]
|
54 |
+
candidate_gender_cols = ["gender"]
|
55 |
+
|
56 |
+
extracted_cols = candidate_age_cols + candidate_gender_cols
|
57 |
+
|
58 |
+
if extracted_cols:
|
59 |
+
subset_clinical = clinical_df[extracted_cols]
|
60 |
+
preview_data = subset_clinical.head(5).to_dict(orient='list')
|
61 |
+
print(preview_data)
|
62 |
+
# Step 1: Choose the best columns for age and gender based on the data inspection
|
63 |
+
age_col = "age_at_initial_pathologic_diagnosis"
|
64 |
+
gender_col = "gender"
|
65 |
+
|
66 |
+
# Step 2: Print out the chosen columns
|
67 |
+
print(f"age_col: {age_col}")
|
68 |
+
print(f"gender_col: {gender_col}")
|
69 |
+
# 1) Extract and standardize clinical features
|
70 |
+
selected_clinical_df = tcga_select_clinical_features(
|
71 |
+
clinical_df=clinical_df,
|
72 |
+
trait=trait,
|
73 |
+
age_col=age_col,
|
74 |
+
gender_col=gender_col
|
75 |
+
)
|
76 |
+
|
77 |
+
# 2) Normalize gene symbols
|
78 |
+
normalized_gene_df = normalize_gene_symbols_in_index(genetic_df)
|
79 |
+
normalized_gene_df.to_csv(out_gene_data_file)
|
80 |
+
|
81 |
+
# 3) Link clinical and genetic data
|
82 |
+
linked_data = selected_clinical_df.join(normalized_gene_df.T, how='inner')
|
83 |
+
|
84 |
+
# 4) Handle missing values
|
85 |
+
linked_data_clean = handle_missing_values(linked_data, trait)
|
86 |
+
|
87 |
+
# 5) Determine biased features
|
88 |
+
trait_biased, linked_data_no_bias = judge_and_remove_biased_features(linked_data_clean, trait)
|
89 |
+
|
90 |
+
# 6) Final quality validation
|
91 |
+
is_usable = validate_and_save_cohort_info(
|
92 |
+
is_final=True,
|
93 |
+
cohort="TCGA",
|
94 |
+
info_path=json_path,
|
95 |
+
is_gene_available=True,
|
96 |
+
is_trait_available=True,
|
97 |
+
is_biased=trait_biased,
|
98 |
+
df=linked_data_no_bias,
|
99 |
+
note="Endometrioid Cancer TCGA cohort processed successfully."
|
100 |
+
)
|
101 |
+
|
102 |
+
# 7) Save usable data
|
103 |
+
if is_usable:
|
104 |
+
linked_data_no_bias.to_csv(out_data_file)
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE100843.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:100ceb54a1c0b1947a8d0d3ff0a55e95bea0464b6bf3bb0c67d5eddb8ee2f38a
|
3 |
+
size 28739857
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE104958.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f56a51be1a5c9d45191e0295166f9ecde7c87bb40d6bfaf0a93ca8f8c181233
|
3 |
+
size 11772704
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE107754.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a82da64a5edcbde2a3ccf1c07d005767e02ceeaad822b4ed6217419063405079
|
3 |
+
size 19822703
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE131027.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a8582008fe6fc5b90879aea7d12ca4ea58cc0bbe03209acb333425d229be6e33
|
3 |
+
size 24379939
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE218109.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE75241.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p1/preprocess/Esophageal_Cancer/gene_data/GSE77790.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p1/preprocess/Essential_Thrombocythemia/GSE103237.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8e20dc273a3c676762828b17649a046a42071d5234e562bcb985dc1bd5ef0080
|
3 |
+
size 12501629
|
p1/preprocess/Essential_Thrombocythemia/GSE12295.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p1/preprocess/Essential_Thrombocythemia/GSE159514.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c873419446df5c8a365accded2a02ea13fa2f70df150140be41d260e26125e79
|
3 |
+
size 21786888
|
p1/preprocess/Essential_Thrombocythemia/GSE174060.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be9bb6fa3109286d9b9cdf8d29d55e1b57972d31dd09a108ddb18c1bbaabfd74
|
3 |
+
size 12990427
|
p1/preprocess/Essential_Thrombocythemia/GSE55976.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p1/preprocess/Essential_Thrombocythemia/GSE57793.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:788c0950aca6203d9bab29622515671322fe26e660d824dc4c12830fde911eee
|
3 |
+
size 17564694
|
p1/preprocess/Essential_Thrombocythemia/GSE61629.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bb468228287b315779a9ddb38ec15b31172fc5b1fdb5e1caa7d11fe442ded1f7
|
3 |
+
size 14391042
|
p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE103176.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE103237.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
GSM2758679,GSM2758680,GSM2758681,GSM2758682,GSM2758683,GSM2758684,GSM2758685,GSM2758686,GSM2758687,GSM2758688,GSM2758689,GSM2758690,GSM2758691,GSM2758692,GSM2758693,GSM2758694,GSM2758695,GSM2758696,GSM2758697,GSM2758698,GSM2758699,GSM2758700,GSM2758701,GSM2758702,GSM2758703,GSM2758704,GSM2758705,GSM2758706,GSM2758707,GSM2758708,GSM2758709,GSM2758710,GSM2758711,GSM2758712,GSM2758713,GSM2758714,GSM2758715,GSM2758716,GSM2758717,GSM2758718,GSM2758719,GSM2758720,GSM2758721,GSM2758722,GSM2758723,GSM2758724,GSM2758725,GSM2758726,GSM2758727,GSM2758728,GSM2758729,GSM2758730,GSM2758731,GSM2758732,GSM2758733,GSM2758734,GSM2758735,GSM2758736,GSM2758737,GSM2758738,GSM2758739,GSM2758740,GSM2758741,GSM2758742,GSM2758743
|
2 |
+
1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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 |
+
1.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,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,,,,,,,,,,,,,,,
|
p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE12295.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
GSM309072,GSM309073,GSM309074,GSM309075,GSM309076,GSM309077,GSM309078,GSM309079,GSM309080,GSM309081,GSM309082,GSM309083,GSM309084,GSM309085,GSM309086,GSM309087,GSM309088,GSM309089,GSM309090,GSM309091,GSM309092,GSM309093,GSM309094,GSM309095,GSM309096,GSM309097,GSM309098,GSM309099,GSM309100,GSM309101,GSM309102,GSM309103,GSM309104,GSM309105,GSM309106,GSM309107,GSM309108,GSM309109,GSM309110,GSM309111,GSM309112,GSM309113,GSM309114,GSM309115,GSM309116,GSM309117,GSM309118,GSM309119,GSM309120,GSM309121,GSM309122,GSM309123,GSM309124,GSM309125,GSM309126,GSM309127,GSM309128,GSM309129,GSM309130,GSM309131,GSM309132,GSM309133,GSM309134,GSM309135,GSM309136,GSM309137,GSM309138,GSM309139,GSM309140,GSM309141,GSM309142,GSM309143,GSM309144,GSM309145,GSM309146,GSM309147,GSM309148,GSM309149,GSM309150,GSM309151,GSM309152,GSM309153,GSM309154,GSM309155,GSM309156,GSM309157,GSM309158,GSM309159,GSM309160,GSM309161,GSM309162,GSM309163,GSM309164,GSM309165,GSM309166
|
2 |
+
1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0
|
p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE159514.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
GSM4831515,GSM4831516,GSM4831517,GSM4831518,GSM4831519,GSM4831520,GSM4831521,GSM4831522,GSM4831523,GSM4831524,GSM4831525,GSM4831526,GSM4831527,GSM4831528,GSM4831529,GSM4831530,GSM4831531,GSM4831532,GSM4831533,GSM4831534,GSM4831535,GSM4831536,GSM4831537,GSM4831538,GSM4831539,GSM4831540,GSM4831541,GSM4831542,GSM4831543,GSM4831544,GSM4831545,GSM4831546,GSM4831547,GSM4831548,GSM4831549,GSM4831550,GSM4831551,GSM4831552,GSM4831553,GSM4831554,GSM4831555,GSM4831556,GSM4831557,GSM4831558,GSM4831559,GSM4831560,GSM4831561,GSM4831562,GSM4831563,GSM4831564,GSM4831565,GSM4831566,GSM4831567,GSM4831568,GSM4831569,GSM4831570,GSM4831571,GSM4831572,GSM4831573,GSM4831574,GSM4831575,GSM4831576,GSM4831577,GSM4831578,GSM4831579,GSM4831580,GSM4831581,GSM4831582,GSM4831583,GSM4831584,GSM4831585,GSM4831586,GSM4831587,GSM4831588,GSM4831589,GSM4831590,GSM4831591,GSM4831592,GSM4831593,GSM4831594,GSM4831595,GSM4831596,GSM4831597,GSM4831598,GSM4831599,GSM4831600,GSM4831601,GSM4831602,GSM4831603,GSM4831604,GSM4831605,GSM4831606,GSM4831607,GSM4831608,GSM4831609,GSM4831610,GSM4831611,GSM4831612,GSM4831613,GSM4831614,GSM4831615,GSM4831616,GSM4831617,GSM4831618,GSM4831619,GSM4831620,GSM4831621,GSM4831622,GSM4831623,GSM4831624,GSM4831625,GSM4831626,GSM4831627,GSM4831628
|
2 |
+
0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.0,0.0,1.0,0.0,0.0,1.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,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
|
p1/preprocess/Essential_Thrombocythemia/clinical_data/GSE174060.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GSM5285411,GSM5285412,GSM5285413,GSM5285414,GSM5285415,GSM5285416,GSM5285417,GSM5285418,GSM5285419,GSM5285420,GSM5285421,GSM5285422,GSM5285423,GSM5285424,GSM5285425,GSM5285426,GSM5285427,GSM5285428,GSM5285429,GSM5285430,GSM5285431,GSM5285432,GSM5285433,GSM5285434,GSM5285435,GSM5285436,GSM5285437,GSM5285438,GSM5285439,GSM5285440,GSM5285441,GSM5285442,GSM5285443,GSM5285444,GSM5285445,GSM5285446
|
2 |
+
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,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0
|
3 |
+
41.0,53.0,52.0,47.0,19.0,33.0,58.0,76.0,68.0,65.0,61.0,45.0,68.0,42.0,36.0,42.0,69.0,45.0,74.0,75.0,62.0,58.0,76.0,72.0,61.0,76.0,71.0,43.0,56.0,68.0,29.0,27.0,28.0,28.0,32.0,27.0
|
4 |
+
0.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0
|