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 +23 -0
- p3/preprocess/Alzheimers_Disease/TCGA.csv +3 -0
- p3/preprocess/Alzheimers_Disease/gene_data/TCGA.csv +3 -0
- p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE148450.csv +3 -0
- p3/preprocess/Autoinflammatory_Disorders/GSE80060.csv +3 -0
- p3/preprocess/Autoinflammatory_Disorders/gene_data/GSE80060.csv +3 -0
- p3/preprocess/Bile_Duct_Cancer/GSE131027.csv +3 -0
- p3/preprocess/Bile_Duct_Cancer/gene_data/GSE107754.csv +3 -0
- p3/preprocess/Bile_Duct_Cancer/gene_data/GSE131027.csv +3 -0
- p3/preprocess/Bile_Duct_Cancer/gene_data/TCGA.csv +3 -0
- p3/preprocess/Bipolar_disorder/GSE45484.csv +3 -0
- p3/preprocess/Bipolar_disorder/GSE46449.csv +3 -0
- p3/preprocess/Bipolar_disorder/GSE53987.csv +3 -0
- p3/preprocess/Bipolar_disorder/GSE62191.csv +3 -0
- p3/preprocess/Bipolar_disorder/GSE92538.csv +3 -0
- p3/preprocess/Bipolar_disorder/clinical_data/GSE46416.csv +2 -0
- p3/preprocess/Bipolar_disorder/clinical_data/GSE53987.csv +4 -0
- p3/preprocess/Bipolar_disorder/clinical_data/GSE62191.csv +4 -0
- p3/preprocess/Bipolar_disorder/clinical_data/GSE67311.csv +2 -0
- p3/preprocess/Bipolar_disorder/clinical_data/GSE92538.csv +4 -0
- p3/preprocess/Bipolar_disorder/clinical_data/GSE93114.csv +2 -0
- p3/preprocess/Bipolar_disorder/code/GSE120340.py +158 -0
- p3/preprocess/Bipolar_disorder/code/GSE120342.py +114 -0
- p3/preprocess/Bipolar_disorder/code/GSE45484.py +167 -0
- p3/preprocess/Bipolar_disorder/code/GSE46416.py +267 -0
- p3/preprocess/Bipolar_disorder/code/GSE46449.py +157 -0
- p3/preprocess/Bipolar_disorder/code/GSE53987.py +161 -0
- p3/preprocess/Bipolar_disorder/code/GSE62191.py +158 -0
- p3/preprocess/Bipolar_disorder/code/GSE67311.py +154 -0
- p3/preprocess/Bipolar_disorder/code/GSE92538.py +168 -0
- p3/preprocess/Bipolar_disorder/code/GSE93114.py +94 -0
- p3/preprocess/Bipolar_disorder/code/TCGA.py +31 -0
- p3/preprocess/Bipolar_disorder/gene_data/GSE120340.csv +0 -0
- p3/preprocess/Bipolar_disorder/gene_data/GSE45484.csv +3 -0
- p3/preprocess/Bipolar_disorder/gene_data/GSE46449.csv +3 -0
- p3/preprocess/Bipolar_disorder/gene_data/GSE53987.csv +3 -0
- p3/preprocess/Bipolar_disorder/gene_data/GSE62191.csv +3 -0
- p3/preprocess/Bladder_Cancer/GSE138118.csv +3 -0
- p3/preprocess/Bladder_Cancer/GSE185264.csv +0 -0
- p3/preprocess/Bladder_Cancer/GSE222073.csv +3 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE138118.csv +3 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE145261.csv +4 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE162253.csv +2 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE185264.csv +3 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE222073.csv +2 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE244266.csv +2 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE245953.csv +2 -0
- p3/preprocess/Bladder_Cancer/clinical_data/GSE253531.csv +2 -0
- p3/preprocess/Bladder_Cancer/code/GSE138118.py +179 -0
- p3/preprocess/Bladder_Cancer/code/GSE145261.py +201 -0
.gitattributes
CHANGED
@@ -1517,3 +1517,26 @@ p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE111175.csv filter=lfs
|
|
1517 |
p3/preprocess/Autism_spectrum_disorder_(ASD)/GSE148450.csv filter=lfs diff=lfs merge=lfs -text
|
1518 |
p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE65106.csv filter=lfs diff=lfs merge=lfs -text
|
1519 |
p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE42133.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1517 |
p3/preprocess/Autism_spectrum_disorder_(ASD)/GSE148450.csv filter=lfs diff=lfs merge=lfs -text
|
1518 |
p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE65106.csv filter=lfs diff=lfs merge=lfs -text
|
1519 |
p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE42133.csv filter=lfs diff=lfs merge=lfs -text
|
1520 |
+
p3/preprocess/Bile_Duct_Cancer/GSE131027.csv filter=lfs diff=lfs merge=lfs -text
|
1521 |
+
p3/preprocess/Bile_Duct_Cancer/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1522 |
+
p3/preprocess/Bile_Duct_Cancer/gene_data/GSE107754.csv filter=lfs diff=lfs merge=lfs -text
|
1523 |
+
p3/preprocess/Bile_Duct_Cancer/gene_data/GSE131027.csv filter=lfs diff=lfs merge=lfs -text
|
1524 |
+
p3/preprocess/Bipolar_disorder/GSE53987.csv filter=lfs diff=lfs merge=lfs -text
|
1525 |
+
p3/preprocess/Bipolar_disorder/GSE62191.csv filter=lfs diff=lfs merge=lfs -text
|
1526 |
+
p3/preprocess/Bipolar_disorder/GSE45484.csv filter=lfs diff=lfs merge=lfs -text
|
1527 |
+
p3/preprocess/Autoinflammatory_Disorders/GSE80060.csv filter=lfs diff=lfs merge=lfs -text
|
1528 |
+
p3/preprocess/Bipolar_disorder/GSE46449.csv filter=lfs diff=lfs merge=lfs -text
|
1529 |
+
p3/preprocess/Autoinflammatory_Disorders/gene_data/GSE80060.csv filter=lfs diff=lfs merge=lfs -text
|
1530 |
+
p3/preprocess/Bipolar_disorder/gene_data/GSE62191.csv filter=lfs diff=lfs merge=lfs -text
|
1531 |
+
p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE148450.csv filter=lfs diff=lfs merge=lfs -text
|
1532 |
+
p3/preprocess/Bipolar_disorder/GSE92538.csv filter=lfs diff=lfs merge=lfs -text
|
1533 |
+
p3/preprocess/Bipolar_disorder/gene_data/GSE45484.csv filter=lfs diff=lfs merge=lfs -text
|
1534 |
+
p3/preprocess/Bipolar_disorder/gene_data/GSE46449.csv filter=lfs diff=lfs merge=lfs -text
|
1535 |
+
p3/preprocess/Bladder_Cancer/GSE138118.csv filter=lfs diff=lfs merge=lfs -text
|
1536 |
+
p3/preprocess/Bladder_Cancer/GSE222073.csv filter=lfs diff=lfs merge=lfs -text
|
1537 |
+
p3/preprocess/Alzheimers_Disease/gene_data/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1538 |
+
p3/preprocess/Bipolar_disorder/gene_data/GSE53987.csv filter=lfs diff=lfs merge=lfs -text
|
1539 |
+
p3/preprocess/Alzheimers_Disease/TCGA.csv filter=lfs diff=lfs merge=lfs -text
|
1540 |
+
p3/preprocess/Bladder_Cancer/gene_data/GSE253531.csv filter=lfs diff=lfs merge=lfs -text
|
1541 |
+
p3/preprocess/Bladder_Cancer/gene_data/GSE138118.csv filter=lfs diff=lfs merge=lfs -text
|
1542 |
+
p3/preprocess/Bladder_Cancer/gene_data/GSE222073.csv filter=lfs diff=lfs merge=lfs -text
|
p3/preprocess/Alzheimers_Disease/TCGA.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d10516b5bcaafdf0f8b995268a90d1517746cb8f5fb68f00f7bfc5bb26c49936
|
3 |
+
size 203630546
|
p3/preprocess/Alzheimers_Disease/gene_data/TCGA.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ca538730424e09dc117dcbf2b9e361e18a559838fbd5166c65c39e001c215c63
|
3 |
+
size 203622702
|
p3/preprocess/Autism_spectrum_disorder_(ASD)/gene_data/GSE148450.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b17241070868a8899ba1a1482081f84b28ea734729c1faa11dacb0e865cd221f
|
3 |
+
size 66317324
|
p3/preprocess/Autoinflammatory_Disorders/GSE80060.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b34c376652d3e82ad31a3f37c75545992531acd382e5f3e54f483b7f44bd84cf
|
3 |
+
size 45737283
|
p3/preprocess/Autoinflammatory_Disorders/gene_data/GSE80060.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9df5145ab13c51ae5d9a8a8d0506870eae1854951a44c7867bb8915b5e661c9a
|
3 |
+
size 45736436
|
p3/preprocess/Bile_Duct_Cancer/GSE131027.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:736f3631855fdd8eae6daa1dfffa37d999c36cbfd1aac2fbd0fd6f178733399d
|
3 |
+
size 24380320
|
p3/preprocess/Bile_Duct_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
|
p3/preprocess/Bile_Duct_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
|
p3/preprocess/Bile_Duct_Cancer/gene_data/TCGA.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:487ad5b2b7321770f48f777197bb2b173d2d7bdc3c910702b5bbc9b90cd9dc77
|
3 |
+
size 13655934
|
p3/preprocess/Bipolar_disorder/GSE45484.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:36da23435264f75639b2ce87db09034f3ca7f94139ff51d3da5ead299b387672
|
3 |
+
size 21932391
|
p3/preprocess/Bipolar_disorder/GSE46449.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dd9c37f1491e231f5be738c4447ac560f961bc72284a9d5d73f3596e3b13b07f
|
3 |
+
size 23289308
|
p3/preprocess/Bipolar_disorder/GSE53987.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e41f01b802052607fb8ef73bb96f16b9c582056603aec1fdb670ae1b8f1a68e6
|
3 |
+
size 18125169
|
p3/preprocess/Bipolar_disorder/GSE62191.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:68f3da5c2668fe57d837490d3600d5b014fdd3a4f3e3114a55409b18d2a2da75
|
3 |
+
size 10792824
|
p3/preprocess/Bipolar_disorder/GSE92538.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b672a0b2d6064f5dfcc1a63d081c449ddb4e827649580c6072269951c5173e5c
|
3 |
+
size 32891082
|
p3/preprocess/Bipolar_disorder/clinical_data/GSE46416.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM1129903,GSM1129904,GSM1129905,GSM1129906,GSM1129907,GSM1129908,GSM1129909,GSM1129910,GSM1129911,GSM1129912,GSM1129913,GSM1129914,GSM1129915,GSM1129916,GSM1129917,GSM1129918,GSM1129919,GSM1129920,GSM1129921,GSM1129922,GSM1129923,GSM1129924,GSM1129925,GSM1129926,GSM1129927,GSM1129928,GSM1129929,GSM1129930,GSM1129931,GSM1129932,GSM1129933,GSM1129934
|
2 |
+
Bipolar_disorder,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
p3/preprocess/Bipolar_disorder/clinical_data/GSE53987.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,GSM1304852,GSM1304853,GSM1304854,GSM1304855,GSM1304856,GSM1304857,GSM1304858,GSM1304859,GSM1304860,GSM1304861,GSM1304862,GSM1304863,GSM1304864,GSM1304865,GSM1304866,GSM1304867,GSM1304868,GSM1304869,GSM1304870,GSM1304871,GSM1304872,GSM1304873,GSM1304874,GSM1304875,GSM1304876,GSM1304877,GSM1304878,GSM1304879,GSM1304880,GSM1304881,GSM1304882,GSM1304883,GSM1304884,GSM1304885,GSM1304886,GSM1304887,GSM1304888,GSM1304889,GSM1304890,GSM1304891,GSM1304892,GSM1304893,GSM1304894,GSM1304895,GSM1304896,GSM1304897,GSM1304898,GSM1304899,GSM1304900,GSM1304901,GSM1304902,GSM1304903,GSM1304904,GSM1304905,GSM1304906,GSM1304907,GSM1304908,GSM1304909,GSM1304910,GSM1304911,GSM1304912,GSM1304913,GSM1304914,GSM1304915,GSM1304916,GSM1304917,GSM1304918,GSM1304919,GSM1304920,GSM1304921,GSM1304922,GSM1304923,GSM1304924,GSM1304925,GSM1304926,GSM1304927,GSM1304928,GSM1304929,GSM1304930,GSM1304931,GSM1304932,GSM1304933,GSM1304934,GSM1304935,GSM1304936,GSM1304937,GSM1304938,GSM1304939,GSM1304940,GSM1304941,GSM1304942,GSM1304943,GSM1304944,GSM1304945,GSM1304946,GSM1304947,GSM1304948,GSM1304949,GSM1304950,GSM1304951,GSM1304952,GSM1304953,GSM1304954,GSM1304955,GSM1304956,GSM1304957,GSM1304958,GSM1304959,GSM1304960,GSM1304961,GSM1304962,GSM1304963,GSM1304964,GSM1304965,GSM1304966,GSM1304967,GSM1304968,GSM1304969,GSM1304970,GSM1304971,GSM1304972,GSM1304973,GSM1304974,GSM1304975,GSM1304976,GSM1304977,GSM1304978,GSM1304979,GSM1304980,GSM1304981,GSM1304982,GSM1304983,GSM1304984,GSM1304985,GSM1304986,GSM1304987,GSM1304988,GSM1304989,GSM1304990,GSM1304991,GSM1304992,GSM1304993,GSM1304994,GSM1304995,GSM1304996,GSM1304997,GSM1304998,GSM1304999,GSM1305000,GSM1305001,GSM1305002,GSM1305003,GSM1305004,GSM1305005,GSM1305006,GSM1305007,GSM1305008,GSM1305009,GSM1305010,GSM1305011,GSM1305012,GSM1305013,GSM1305014,GSM1305015,GSM1305016,GSM1305017,GSM1305018,GSM1305019,GSM1305020,GSM1305021,GSM1305022,GSM1305023,GSM1305024,GSM1305025,GSM1305026,GSM1305027,GSM1305028,GSM1305029,GSM1305030,GSM1305031,GSM1305032,GSM1305033,GSM1305034,GSM1305035,GSM1305036,GSM1305037,GSM1305038,GSM1305039,GSM1305040,GSM1305041,GSM1305042,GSM1305043,GSM1305044,GSM1305045,GSM1305046,GSM1305047,GSM1305048,GSM1305049,GSM1305050,GSM1305051,GSM1305052,GSM1305053,GSM1305054,GSM1305055,GSM1305056
|
2 |
+
Bipolar_disorder,1.0,1.0,1.0,1.0,1.0,1.0,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1.0,1.0,1.0,1.0,1.0,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1.0,1.0,1.0,1.0,1.0,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
3 |
+
Age,52.0,50.0,28.0,55.0,58.0,28.0,49.0,42.0,43.0,50.0,40.0,39.0,45.0,42.0,65.0,51.0,39.0,48.0,51.0,51.0,36.0,65.0,55.0,22.0,52.0,58.0,40.0,41.0,49.0,48.0,39.0,48.0,43.0,68.0,58.0,43.0,51.0,53.0,26.0,52.0,62.0,29.0,49.0,54.0,28.0,42.0,44.0,40.0,47.0,59.0,47.0,34.0,51.0,49.0,47.0,25.0,62.0,44.0,46.0,50.0,46.0,41.0,47.0,37.0,58.0,44.0,38.0,52.0,52.0,50.0,28.0,55.0,58.0,28.0,49.0,56.0,50.0,40.0,39.0,45.0,42.0,65.0,51.0,39.0,48.0,51.0,51.0,36.0,65.0,55.0,22.0,52.0,58.0,40.0,41.0,49.0,48.0,39.0,48.0,43.0,68.0,58.0,43.0,46.0,51.0,53.0,26.0,52.0,62.0,29.0,49.0,54.0,28.0,42.0,40.0,47.0,44.0,59.0,47.0,34.0,51.0,49.0,47.0,25.0,41.0,62.0,47.0,44.0,46.0,50.0,41.0,47.0,37.0,58.0,44.0,52.0,50.0,40.0,39.0,45.0,42.0,65.0,51.0,39.0,48.0,52.0,50.0,28.0,55.0,58.0,49.0,56.0,42.0,49.0,48.0,39.0,48.0,43.0,68.0,58.0,43.0,46.0,51.0,51.0,36.0,65.0,55.0,22.0,52.0,58.0,40.0,42.0,44.0,47.0,44.0,59.0,47.0,34.0,51.0,51.0,53.0,26.0,52.0,62.0,29.0,49.0,54.0,50.0,46.0,41.0,47.0,37.0,58.0,44.0,38.0,52.0,49.0,47.0,25.0,41.0,62.0,32.0,47.0,50.0,44.0
|
4 |
+
Gender,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0
|
p3/preprocess/Bipolar_disorder/clinical_data/GSE62191.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,GSM1521625,GSM1521626,GSM1521627,GSM1521628,GSM1521629,GSM1521630,GSM1521631,GSM1521632,GSM1521633,GSM1521634,GSM1521635,GSM1521636,GSM1521637,GSM1521638,GSM1521639,GSM1521640,GSM1521641,GSM1521642,GSM1521643,GSM1521644,GSM1521645,GSM1521646,GSM1521647,GSM1521648,GSM1521649,GSM1521650,GSM1521651,GSM1521652,GSM1521653,GSM1521654,GSM1521655,GSM1521656,GSM1521657,GSM1521658,GSM1521659,GSM1521660,GSM1521661,GSM1521662,GSM1521663,GSM1521664,GSM1521665,GSM1521666,GSM1521667,GSM1521668,GSM1521669,GSM1521670,GSM1521671,GSM1521672,GSM1521673,GSM1521674,GSM1521675,GSM1521676,GSM1521677,GSM1521678,GSM1521679,GSM1521680,GSM1521681,GSM1521682,GSM1521683,GSM1521684,GSM1521685,GSM1521686,GSM1521687,GSM1521688,GSM1521689,GSM1521690,GSM1521691,GSM1521692,GSM1521693,GSM1521694,GSM1521695,GSM1521696,GSM1521697,GSM1521698,GSM1521699,GSM1521700,GSM1521701,GSM1521702,GSM1521703,GSM1521704,GSM1521705,GSM1521706,GSM1521707,GSM1521708,GSM1521709,GSM1521710,GSM1521711,GSM1521712
|
2 |
+
Bipolar_disorder,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
3 |
+
Age,29.0,58.0,54.0,42.0,63.0,64.0,59.0,51.0,49.0,41.0,48.0,47.0,45.0,41.0,29.0,44.0,48.0,42.0,35.0,35.0,38.0,44.0,43.0,50.0,56.0,29.0,59.0,35.0,33.0,34.0,44.0,46.0,51.0,33.0,48.0,40.0,31.0,39.0,59.0,53.0,53.0,38.0,60.0,45.0,45.0,35.0,47.0,34.0,42.0,19.0,41.0,44.0,49.0,49.0,35.0,47.0,51.0,48.0,49.0,55.0,40.0,44.0,31.0,38.0,47.0,24.0,32.0,44.0,39.0,33.0,43.0,35.0,47.0,36.0,53.0,45.0,51.0,19.0,45.0,43.0,46.0,52.0,44.0,50.0,41.0,42.0,53.0,52.0
|
4 |
+
Gender,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
p3/preprocess/Bipolar_disorder/clinical_data/GSE67311.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM1644447,GSM1644448,GSM1644449,GSM1644450,GSM1644451,GSM1644452,GSM1644453,GSM1644454,GSM1644455,GSM1644456,GSM1644457,GSM1644458,GSM1644459,GSM1644460,GSM1644461,GSM1644462,GSM1644463,GSM1644464,GSM1644465,GSM1644466,GSM1644467,GSM1644468,GSM1644469,GSM1644470,GSM1644471,GSM1644472,GSM1644473,GSM1644474,GSM1644475,GSM1644476,GSM1644477,GSM1644478,GSM1644479,GSM1644480,GSM1644481,GSM1644482,GSM1644483,GSM1644484,GSM1644485,GSM1644486,GSM1644487,GSM1644488,GSM1644489,GSM1644490,GSM1644491,GSM1644492,GSM1644493,GSM1644494,GSM1644495,GSM1644496,GSM1644497,GSM1644498,GSM1644499,GSM1644500,GSM1644501,GSM1644502,GSM1644503,GSM1644504,GSM1644505,GSM1644506,GSM1644507,GSM1644508,GSM1644509,GSM1644510,GSM1644511,GSM1644512,GSM1644513,GSM1644514,GSM1644515,GSM1644516,GSM1644517,GSM1644518,GSM1644519,GSM1644520,GSM1644521,GSM1644522,GSM1644523,GSM1644524,GSM1644525,GSM1644526,GSM1644527,GSM1644528,GSM1644529,GSM1644530,GSM1644531,GSM1644532,GSM1644533,GSM1644534,GSM1644535,GSM1644536,GSM1644537,GSM1644538,GSM1644539,GSM1644540,GSM1644541,GSM1644542,GSM1644543,GSM1644544,GSM1644545,GSM1644546,GSM1644547,GSM1644548,GSM1644549,GSM1644550,GSM1644551,GSM1644552,GSM1644553,GSM1644554,GSM1644555,GSM1644556,GSM1644557,GSM1644558,GSM1644559,GSM1644560,GSM1644561,GSM1644562,GSM1644563,GSM1644564,GSM1644565,GSM1644566,GSM1644567,GSM1644568,GSM1644569,GSM1644570,GSM1644571,GSM1644572,GSM1644573,GSM1644574,GSM1644575,GSM1644576,GSM1644577,GSM1644578,GSM1644579,GSM1644580,GSM1644581,GSM1644582,GSM1644583,GSM1644584,GSM1644585,GSM1644586,GSM1644587,GSM1644588
|
2 |
+
Bipolar_disorder,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,,0.0,,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,,0.0,0.0,0.0,0.0,0.0,0.0,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,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
|
p3/preprocess/Bipolar_disorder/clinical_data/GSE92538.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,GSM2431718,GSM2431721,GSM2431722,GSM2431723,GSM2431726,GSM2431727,GSM2431728,GSM2431730,GSM2431731,GSM2431733,GSM2431734,GSM2431735,GSM2431737,GSM2431738,GSM2431739,GSM2431740,GSM2431743,GSM2431745,GSM2431749,GSM2431750,GSM2431751,GSM2431752,GSM2431753,GSM2431755,GSM2431756,GSM2431758,GSM2431759,GSM2431761,GSM2431762,GSM2431763,GSM2431765,GSM2431768,GSM2431771,GSM2431772,GSM2431773,GSM2431776,GSM2431777,GSM2431780,GSM2431783,GSM2431784,GSM2431785,GSM2431786,GSM2431787,GSM2431788,GSM2431789,GSM2431790,GSM2431791,GSM2431792,GSM2431794,GSM2431795,GSM2431796,GSM2431797,GSM2431800,GSM2431801,GSM2431803,GSM2431804,GSM2431807,GSM2431810,GSM2431811,GSM2431812,GSM2431813,GSM2431814,GSM2431815,GSM2431819,GSM2431820,GSM2431821,GSM2431822,GSM2431824,GSM2431827,GSM2431828,GSM2431830,GSM2431831,GSM2431832,GSM2431833,GSM2431834,GSM2431835,GSM2431836,GSM2431838,GSM2431839,GSM2431840,GSM2431841,GSM2431842,GSM2431844,GSM2431846,GSM2431847,GSM2431850,GSM2431851,GSM2431854,GSM2431855,GSM2431856,GSM2431857,GSM2431859,GSM2431860,GSM2431861,GSM2431862,GSM2431863,GSM2431865,GSM2431869,GSM2431870,GSM2431871,GSM2431872,GSM2431875,GSM2431878,GSM2431879,GSM2431880,GSM2431881,GSM2431882,GSM2431883,GSM2431884,GSM2431885,GSM2431886,GSM2431887,GSM2431888,GSM2431889,GSM2431890,GSM2431891,GSM2431892,GSM2431893,GSM2431894,GSM2431895,GSM2431896,GSM2431897,GSM2431898,GSM2431899,GSM2431902,GSM2431906,GSM2431908,GSM2431909,GSM2431912,GSM2431913,GSM2431914,GSM2431916,GSM2431918,GSM2431919,GSM2431920,GSM2431921,GSM2431923,GSM2431924,GSM2431926,GSM2431927,GSM2431929,GSM2431934,GSM2431935,GSM2431936,GSM2431937,GSM2431938,GSM2431939,GSM2431941,GSM2431942,GSM2431946,GSM2431947,GSM2431949,GSM2431950,GSM2431951,GSM2431954,GSM2431955,GSM2431960,GSM2431961,GSM2431962,GSM2431964,GSM2431965,GSM2431966,GSM2431967,GSM2431972,GSM2431973,GSM2431974,GSM2431975,GSM2431976,GSM2431977,GSM2431978,GSM2431979,GSM2431980,GSM2431981,GSM2431982,GSM2431983,GSM2431986,GSM2431987,GSM2431988,GSM2431989,GSM2431992,GSM2431993,GSM2431994,GSM2431996,GSM2431997,GSM2432001,GSM2432003,GSM2432004,GSM2432006,GSM2432007,GSM2432008,GSM2432009,GSM2432011,GSM2432012,GSM2432013,GSM2432015,GSM2432016,GSM2432019,GSM2432020,GSM2432022,GSM2432023,GSM2432024,GSM2432025,GSM2432026,GSM2432027,GSM2432028,GSM2432030,GSM2432031,GSM2432032,GSM2432033,GSM2432034,GSM2432035,GSM2432036,GSM2432038,GSM2432043,GSM2432044,GSM2432046,GSM2432049,GSM2432050,GSM2432051,GSM2432053,GSM2432056,GSM2432057,GSM2432059,GSM2432061,GSM2432062,GSM2432067,GSM2432072,GSM2432073,GSM2432075,GSM2432080,GSM2432085,GSM2432086,GSM2432088,GSM2432090,GSM2432092
|
2 |
+
Bipolar_disorder,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,1.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,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,1.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.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,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0
|
3 |
+
Age,39.0,32.0,63.0,70.0,71.0,44.0,66.0,59.0,65.0,69.0,52.0,49.0,58.0,45.0,72.0,73.0,44.0,64.0,70.0,52.0,77.0,59.0,55.0,49.0,49.0,53.0,62.0,47.0,67.0,57.0,35.0,48.0,19.0,54.0,73.0,48.0,69.0,50.0,48.0,65.0,69.0,56.0,63.0,80.0,60.0,55.0,40.0,39.0,59.0,48.0,39.0,67.0,66.0,18.0,41.0,47.0,50.0,40.0,40.0,41.0,72.0,72.0,64.0,48.0,34.0,77.0,63.0,50.0,40.0,84.0,32.0,58.0,46.0,70.0,73.0,58.0,70.0,23.0,63.0,52.0,39.0,19.0,48.0,64.0,47.0,49.0,64.0,50.0,59.0,25.0,45.0,60.0,78.0,52.0,65.0,68.0,71.0,81.0,54.0,34.0,68.0,43.0,35.0,47.0,26.0,57.0,39.0,59.0,44.0,64.0,59.0,47.0,48.0,48.0,50.0,48.0,40.0,64.0,48.0,48.0,59.0,54.0,43.0,57.0,39.0,32.0,63.0,70.0,71.0,44.0,66.0,59.0,69.0,69.0,49.0,49.0,58.0,58.0,45.0,44.0,64.0,70.0,52.0,77.0,59.0,55.0,55.0,49.0,49.0,53.0,62.0,47.0,67.0,57.0,35.0,48.0,19.0,54.0,54.0,73.0,48.0,69.0,50.0,48.0,65.0,69.0,56.0,56.0,63.0,80.0,60.0,60.0,55.0,40.0,39.0,59.0,48.0,39.0,67.0,66.0,18.0,18.0,41.0,47.0,50.0,40.0,41.0,72.0,72.0,72.0,64.0,48.0,34.0,77.0,50.0,50.0,40.0,84.0,32.0,46.0,70.0,73.0,58.0,58.0,70.0,23.0,23.0,63.0,52.0,39.0,19.0,19.0,48.0,49.0,49.0,64.0,59.0,25.0,45.0,60.0,78.0,52.0,52.0,65.0,65.0,71.0,81.0,54.0,34.0,43.0,35.0,47.0,26.0,26.0,57.0
|
4 |
+
Gender,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,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,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0
|
p3/preprocess/Bipolar_disorder/clinical_data/GSE93114.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM2444026,GSM2444027,GSM2444028,GSM2444029,GSM2444030,GSM2444031,GSM2444032,GSM2444033,GSM2444034,GSM2444035,GSM2444036,GSM2444037,GSM2444038,GSM2444039,GSM2444040,GSM2444041
|
2 |
+
Bipolar_disorder,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
p3/preprocess/Bipolar_disorder/code/GSE120340.py
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE120340"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE120340"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE120340.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE120340.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE120340.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# From background info, this is an "expression microarray" study
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2. Variable Availability and Data Type Conversion
|
39 |
+
# 2.1 Data Availability
|
40 |
+
trait_row = 0 # 'disease state' contains BD/control info
|
41 |
+
age_row = None # Age not available in sample characteristics
|
42 |
+
gender_row = None # Gender mentioned as matched but not provided
|
43 |
+
|
44 |
+
# 2.2 Data Type Conversion Functions
|
45 |
+
def convert_trait(x):
|
46 |
+
if not isinstance(x, str):
|
47 |
+
return None
|
48 |
+
value = x.split(': ')[-1].strip().upper()
|
49 |
+
if value == 'BD(+)' or value == 'BD(-)':
|
50 |
+
return 1 # Any BD type maps to case
|
51 |
+
elif value == 'CONTROL':
|
52 |
+
return 0 # Control maps to control
|
53 |
+
elif value == 'SCZ':
|
54 |
+
return None # Not relevant for bipolar study
|
55 |
+
return None
|
56 |
+
|
57 |
+
def convert_age(x):
|
58 |
+
return None # No age data
|
59 |
+
|
60 |
+
def convert_gender(x):
|
61 |
+
return None # No gender data
|
62 |
+
|
63 |
+
# 3. Save Metadata
|
64 |
+
is_trait_available = trait_row is not None
|
65 |
+
_ = validate_and_save_cohort_info(is_final=False,
|
66 |
+
cohort=cohort,
|
67 |
+
info_path=json_path,
|
68 |
+
is_gene_available=is_gene_available,
|
69 |
+
is_trait_available=is_trait_available)
|
70 |
+
|
71 |
+
# 4. Clinical Feature Extraction
|
72 |
+
if trait_row is not None:
|
73 |
+
selected_clinical_df = geo_select_clinical_features(clinical_data,
|
74 |
+
trait=trait,
|
75 |
+
trait_row=trait_row,
|
76 |
+
convert_trait=convert_trait)
|
77 |
+
|
78 |
+
# Preview data
|
79 |
+
preview = preview_df(selected_clinical_df)
|
80 |
+
print("Clinical data preview:", preview)
|
81 |
+
|
82 |
+
# Save clinical features
|
83 |
+
selected_clinical_df.to_csv(out_clinical_data_file)
|
84 |
+
# Extract genetic data from the matrix file
|
85 |
+
try:
|
86 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
87 |
+
print("First 20 row IDs:")
|
88 |
+
print(genetic_data.index[:20])
|
89 |
+
except Exception as e:
|
90 |
+
print(f"Error reading genetic data: {e}")
|
91 |
+
|
92 |
+
# Looking at the row IDs which appear to be gene/transcript identifiers,
|
93 |
+
# and considering the background info mentioning "expression microarrays",
|
94 |
+
# maintain original assessment that this is gene expression data
|
95 |
+
is_gene_available = True
|
96 |
+
|
97 |
+
# Save metadata with correct gene availability info
|
98 |
+
validate_and_save_cohort_info(
|
99 |
+
is_final=False,
|
100 |
+
cohort=cohort,
|
101 |
+
info_path=json_path,
|
102 |
+
is_gene_available=is_gene_available,
|
103 |
+
is_trait_available=(trait_row is not None)
|
104 |
+
)
|
105 |
+
# The ids contain "_at" suffix which is characteristic of Affymetrix probe IDs
|
106 |
+
# These need to be mapped to gene symbols for consistent analysis
|
107 |
+
requires_gene_mapping = True
|
108 |
+
# Extract gene annotation data
|
109 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
110 |
+
|
111 |
+
# Preview column names and first few values
|
112 |
+
preview = preview_df(gene_metadata)
|
113 |
+
print("\nGene annotation columns and sample values:")
|
114 |
+
print(preview)
|
115 |
+
# 1. Description column contains gene names
|
116 |
+
prob_col = 'ID'
|
117 |
+
gene_col = 'Description'
|
118 |
+
|
119 |
+
# 2. Get mapping between probe IDs and gene names
|
120 |
+
mapping_data = get_gene_mapping(gene_metadata, prob_col, gene_col)
|
121 |
+
|
122 |
+
# 3. Apply mapping to convert probe data to gene expression data
|
123 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_data)
|
124 |
+
|
125 |
+
# Preview results
|
126 |
+
print("\nFirst few rows and columns of mapped gene expression data:")
|
127 |
+
print(gene_data.iloc[:5, :5])
|
128 |
+
# 1. Normalize gene symbols and save gene data
|
129 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
130 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
131 |
+
gene_data.to_csv(out_gene_data_file)
|
132 |
+
|
133 |
+
# 2. Link clinical and genetic data
|
134 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
135 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
136 |
+
|
137 |
+
# 3. Handle missing values
|
138 |
+
linked_data = handle_missing_values(linked_data, trait)
|
139 |
+
|
140 |
+
# 4. Judge bias in features and remove biased ones
|
141 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
142 |
+
|
143 |
+
# 5. Final validation and save metadata
|
144 |
+
is_usable = validate_and_save_cohort_info(
|
145 |
+
is_final=True,
|
146 |
+
cohort=cohort,
|
147 |
+
info_path=json_path,
|
148 |
+
is_gene_available=is_gene_available,
|
149 |
+
is_trait_available=True,
|
150 |
+
is_biased=trait_biased,
|
151 |
+
df=linked_data,
|
152 |
+
note="Expression microarray data from post-mortem brain samples (BA46) of bipolar disorder patients and controls."
|
153 |
+
)
|
154 |
+
|
155 |
+
# 6. Save linked data if usable
|
156 |
+
if is_usable:
|
157 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
158 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE120342.py
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE120342"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE120342"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE120342.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE120342.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE120342.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# Based on series title mentioning "transcriptomes", this dataset likely contains gene expression data
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2. Variable Analysis
|
39 |
+
# 2.1 Data Availability
|
40 |
+
# Trait (BD status) is available in index 0
|
41 |
+
trait_row = 0
|
42 |
+
# Age data is not available
|
43 |
+
age_row = None
|
44 |
+
# Gender data is not available
|
45 |
+
gender_row = None
|
46 |
+
|
47 |
+
# 2.2 Data Type Conversion Functions
|
48 |
+
def convert_trait(value):
|
49 |
+
if not isinstance(value, str):
|
50 |
+
return None
|
51 |
+
value = value.lower().strip()
|
52 |
+
if 'disease state:' in value:
|
53 |
+
value = value.split('disease state:')[1].strip()
|
54 |
+
if value == 'bd(+)' or value == 'bd(-)': # Both BD+ and BD- are cases
|
55 |
+
return 1
|
56 |
+
elif value == 'control':
|
57 |
+
return 0
|
58 |
+
return None
|
59 |
+
|
60 |
+
def convert_age(value):
|
61 |
+
return None # Not available
|
62 |
+
|
63 |
+
def convert_gender(value):
|
64 |
+
return None # Not available
|
65 |
+
|
66 |
+
# 3. Save metadata
|
67 |
+
validate_and_save_cohort_info(
|
68 |
+
is_final=False,
|
69 |
+
cohort=cohort,
|
70 |
+
info_path=json_path,
|
71 |
+
is_gene_available=is_gene_available,
|
72 |
+
is_trait_available=(trait_row is not None)
|
73 |
+
)
|
74 |
+
|
75 |
+
# 4. Clinical Feature Extraction
|
76 |
+
if trait_row is not None:
|
77 |
+
clinical_features = geo_select_clinical_features(
|
78 |
+
clinical_df=clinical_data,
|
79 |
+
trait=trait,
|
80 |
+
trait_row=trait_row,
|
81 |
+
convert_trait=convert_trait,
|
82 |
+
age_row=age_row,
|
83 |
+
convert_age=convert_age,
|
84 |
+
gender_row=gender_row,
|
85 |
+
convert_gender=convert_gender
|
86 |
+
)
|
87 |
+
|
88 |
+
# Preview the processed clinical data
|
89 |
+
preview = preview_df(clinical_features)
|
90 |
+
print("Preview of processed clinical features:")
|
91 |
+
print(preview)
|
92 |
+
|
93 |
+
# Save to CSV
|
94 |
+
clinical_features.to_csv(out_clinical_data_file)
|
95 |
+
# List all files to check for gene expression data
|
96 |
+
all_files = os.listdir(in_cohort_dir)
|
97 |
+
print("All files in directory:")
|
98 |
+
for f in all_files:
|
99 |
+
print(f)
|
100 |
+
|
101 |
+
# Since we found this is methylation data, and no other matrix file contains gene expression,
|
102 |
+
# we need to revise our earlier assessment
|
103 |
+
is_gene_available = False
|
104 |
+
|
105 |
+
# Save updated metadata with corrected gene availability info
|
106 |
+
validate_and_save_cohort_info(
|
107 |
+
is_final=False,
|
108 |
+
cohort=cohort,
|
109 |
+
info_path=json_path,
|
110 |
+
is_gene_available=is_gene_available,
|
111 |
+
is_trait_available=(trait_row is not None)
|
112 |
+
)
|
113 |
+
|
114 |
+
print("\nThis dataset contains methylation data rather than gene expression data.")
|
p3/preprocess/Bipolar_disorder/code/GSE45484.py
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE45484"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE45484"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE45484.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE45484.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE45484.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
is_gene_available = True # Based on series description, this is a gene expression study from blood samples
|
36 |
+
|
37 |
+
# 2. Variable Availability and Data Type Conversion
|
38 |
+
# 2.1 Data Availability
|
39 |
+
trait_row = 2 # 'responder' indicates treatment response status
|
40 |
+
age_row = 4 # Contains age information
|
41 |
+
gender_row = 3 # Contains sex information
|
42 |
+
|
43 |
+
# 2.2 Data Type Conversion Functions
|
44 |
+
def convert_trait(value: str) -> int:
|
45 |
+
"""Convert treatment response to binary (0: non-responder, 1: responder)"""
|
46 |
+
if not value or ':' not in value:
|
47 |
+
return None
|
48 |
+
value = value.split(':')[1].strip().upper()
|
49 |
+
if value == 'NO':
|
50 |
+
return 0
|
51 |
+
elif value == 'YES':
|
52 |
+
return 1
|
53 |
+
return None
|
54 |
+
|
55 |
+
def convert_age(value: str) -> float:
|
56 |
+
"""Convert age to continuous numeric value"""
|
57 |
+
if not value or ':' not in value:
|
58 |
+
return None
|
59 |
+
try:
|
60 |
+
return float(value.split(':')[1].strip())
|
61 |
+
except:
|
62 |
+
return None
|
63 |
+
|
64 |
+
def convert_gender(value: str) -> int:
|
65 |
+
"""Convert gender to binary (0: female, 1: male)"""
|
66 |
+
if not value or ':' not in value:
|
67 |
+
return None
|
68 |
+
value = value.split(':')[1].strip().upper()
|
69 |
+
if value == 'F':
|
70 |
+
return 0
|
71 |
+
elif value == 'M':
|
72 |
+
return 1
|
73 |
+
return None
|
74 |
+
|
75 |
+
# 3. Save Metadata
|
76 |
+
is_trait_available = trait_row is not None
|
77 |
+
_ = validate_and_save_cohort_info(
|
78 |
+
is_final=False,
|
79 |
+
cohort=cohort,
|
80 |
+
info_path=json_path,
|
81 |
+
is_gene_available=is_gene_available,
|
82 |
+
is_trait_available=is_trait_available
|
83 |
+
)
|
84 |
+
|
85 |
+
# 4. Clinical Feature Extraction
|
86 |
+
if trait_row is not None:
|
87 |
+
selected_clinical_df = geo_select_clinical_features(
|
88 |
+
clinical_data,
|
89 |
+
trait="Treatment_Response",
|
90 |
+
trait_row=trait_row,
|
91 |
+
convert_trait=convert_trait,
|
92 |
+
age_row=age_row,
|
93 |
+
convert_age=convert_age,
|
94 |
+
gender_row=gender_row,
|
95 |
+
convert_gender=convert_gender
|
96 |
+
)
|
97 |
+
|
98 |
+
# Preview the processed data
|
99 |
+
preview = preview_df(selected_clinical_df)
|
100 |
+
print("Preview of processed clinical data:")
|
101 |
+
print(preview)
|
102 |
+
|
103 |
+
# Save to CSV
|
104 |
+
selected_clinical_df.to_csv(out_clinical_data_file)
|
105 |
+
# Extract gene expression data from matrix file
|
106 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
107 |
+
|
108 |
+
# Print first 20 row IDs and some data preview to verify structure
|
109 |
+
print("First 20 gene/probe IDs:")
|
110 |
+
print(list(genetic_data.index[:20]))
|
111 |
+
|
112 |
+
print("\nData preview:")
|
113 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
114 |
+
print(preview_subset)
|
115 |
+
# The gene identifiers are ILMN_ probe IDs used in Illumina microarrays
|
116 |
+
# These need to be mapped to gene symbols
|
117 |
+
requires_gene_mapping = True
|
118 |
+
# Extract gene annotation data
|
119 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
120 |
+
|
121 |
+
# Preview column names and first few values
|
122 |
+
preview = preview_df(gene_metadata)
|
123 |
+
print("\nGene annotation columns and sample values:")
|
124 |
+
print(preview)
|
125 |
+
# Extract gene mapping from annotation
|
126 |
+
prob_col = 'ID' # Column containing probe IDs (ILMN_*)
|
127 |
+
gene_col = 'Symbol' # Column containing gene symbols
|
128 |
+
mapping_df = get_gene_mapping(gene_metadata, prob_col, gene_col)
|
129 |
+
|
130 |
+
# Apply mapping to convert probe expressions to gene expressions
|
131 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_df)
|
132 |
+
|
133 |
+
# Preview the mapped data
|
134 |
+
print("First few genes and their expression values:")
|
135 |
+
preview = preview_df(gene_data)
|
136 |
+
print(preview)
|
137 |
+
# 1. Normalize gene symbols and save gene data
|
138 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
139 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
140 |
+
gene_data.to_csv(out_gene_data_file)
|
141 |
+
|
142 |
+
# 2. Link clinical and genetic data
|
143 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
144 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
145 |
+
|
146 |
+
# 3. Handle missing values
|
147 |
+
linked_data = handle_missing_values(linked_data, "Treatment_Response")
|
148 |
+
|
149 |
+
# 4. Judge bias in features and remove biased ones
|
150 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, "Treatment_Response")
|
151 |
+
|
152 |
+
# 5. Final validation and save metadata
|
153 |
+
is_usable = validate_and_save_cohort_info(
|
154 |
+
is_final=True,
|
155 |
+
cohort=cohort,
|
156 |
+
info_path=json_path,
|
157 |
+
is_gene_available=is_gene_available,
|
158 |
+
is_trait_available=True,
|
159 |
+
is_biased=trait_biased,
|
160 |
+
df=linked_data,
|
161 |
+
note="Gene expression data from blood samples of bipolar disorder patients receiving lithium treatment vs non-responders."
|
162 |
+
)
|
163 |
+
|
164 |
+
# 6. Save linked data if usable
|
165 |
+
if is_usable:
|
166 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
167 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE46416.py
ADDED
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE46416"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE46416"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE46416.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE46416.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE46416.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# From the series title and summary, this study analyzed gene expression profiles
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2. Variable Availability and Data Type Conversion
|
39 |
+
# 2.1 Data Availability
|
40 |
+
# Trait (bipolar disorder) can be derived from disease status and bd phase
|
41 |
+
trait_row = 1
|
42 |
+
# Age and gender not available in sample characteristics
|
43 |
+
age_row = None
|
44 |
+
gender_row = None
|
45 |
+
|
46 |
+
# 2.2 Data Type Conversion
|
47 |
+
def convert_trait(value):
|
48 |
+
"""Convert disease status to binary: control=0, BD=1"""
|
49 |
+
if pd.isna(value):
|
50 |
+
return None
|
51 |
+
value = value.split(": ")[1].lower()
|
52 |
+
if "control" in value:
|
53 |
+
return 0
|
54 |
+
elif "bipolar disorder" in value or "bd" in value:
|
55 |
+
return 1
|
56 |
+
return None
|
57 |
+
|
58 |
+
def convert_age(value):
|
59 |
+
return None # Not used since age not available
|
60 |
+
|
61 |
+
def convert_gender(value):
|
62 |
+
return None # Not used since gender not available
|
63 |
+
|
64 |
+
# 3. Save Metadata
|
65 |
+
is_trait_available = trait_row is not None
|
66 |
+
validate_and_save_cohort_info(is_final=False,
|
67 |
+
cohort=cohort,
|
68 |
+
info_path=json_path,
|
69 |
+
is_gene_available=is_gene_available,
|
70 |
+
is_trait_available=is_trait_available)
|
71 |
+
|
72 |
+
# 4. Clinical Feature Extraction
|
73 |
+
# Since trait_row is not None, we extract clinical features
|
74 |
+
selected_clinical = geo_select_clinical_features(
|
75 |
+
clinical_df=clinical_data,
|
76 |
+
trait=trait,
|
77 |
+
trait_row=trait_row,
|
78 |
+
convert_trait=convert_trait,
|
79 |
+
age_row=age_row,
|
80 |
+
convert_age=convert_age,
|
81 |
+
gender_row=gender_row,
|
82 |
+
convert_gender=convert_gender
|
83 |
+
)
|
84 |
+
|
85 |
+
# Preview the extracted clinical data
|
86 |
+
print("Preview of clinical data:")
|
87 |
+
print(preview_df(selected_clinical))
|
88 |
+
|
89 |
+
# Save clinical data
|
90 |
+
selected_clinical.to_csv(out_clinical_data_file)
|
91 |
+
# Extract gene expression data from matrix file
|
92 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
93 |
+
|
94 |
+
# Print first 20 row IDs and some data preview to verify structure
|
95 |
+
print("First 20 gene/probe IDs:")
|
96 |
+
print(list(genetic_data.index[:20]))
|
97 |
+
|
98 |
+
print("\nData preview:")
|
99 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
100 |
+
print(preview_subset)
|
101 |
+
# The gene identifiers are numeric codes, not standard human gene symbols
|
102 |
+
# These appear to be probe IDs that will need to be mapped to gene symbols
|
103 |
+
requires_gene_mapping = True
|
104 |
+
# Extract gene annotation data with common GEO gene annotation prefixes
|
105 |
+
gene_metadata = get_gene_annotation(soft_file_path, prefixes=['ID_REF', 'GENE', 'GENE_SYMBOL', 'Symbol'])
|
106 |
+
|
107 |
+
# Preview the gene metadata to verify we got the annotation data
|
108 |
+
preview = preview_df(gene_metadata)
|
109 |
+
print("\nGene annotation columns and sample values:")
|
110 |
+
print(preview)
|
111 |
+
# Let's properly extract platform annotation data from the SOFT file
|
112 |
+
with gzip.open(soft_file_path, 'rt') as file:
|
113 |
+
platform_section = False
|
114 |
+
platform_data = []
|
115 |
+
for line in file:
|
116 |
+
if '!Platform_table_begin' in line:
|
117 |
+
platform_section = True
|
118 |
+
# Skip the header line
|
119 |
+
next(file)
|
120 |
+
continue
|
121 |
+
if '!Platform_table_end' in line:
|
122 |
+
platform_section = False
|
123 |
+
continue
|
124 |
+
if platform_section and line.strip():
|
125 |
+
platform_data.append(line.strip().split('\t'))
|
126 |
+
|
127 |
+
# Convert to DataFrame
|
128 |
+
gene_metadata = pd.DataFrame(platform_data[1:], columns=platform_data[0])
|
129 |
+
print("\nPlatform annotation columns:")
|
130 |
+
print(gene_metadata.columns.tolist())
|
131 |
+
print("\nFirst few rows:")
|
132 |
+
print(gene_metadata.head())
|
133 |
+
|
134 |
+
# Get mapping between probe IDs and gene symbols
|
135 |
+
mapping_data = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Symbol')
|
136 |
+
|
137 |
+
# Convert probe-level measurements to gene expression data
|
138 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_data)
|
139 |
+
|
140 |
+
# Preview mapped gene data
|
141 |
+
print("\nPreview of gene expression data after mapping:")
|
142 |
+
preview_subset = gene_data.iloc[:5, :5]
|
143 |
+
print(preview_subset)
|
144 |
+
# First read and print some content of the SOFT file to understand its structure
|
145 |
+
print("Previewing SOFT file structure:")
|
146 |
+
with gzip.open(soft_file_path, 'rt') as file:
|
147 |
+
platform_data = []
|
148 |
+
in_table = False
|
149 |
+
header = None
|
150 |
+
|
151 |
+
# Read through file line by line
|
152 |
+
for line in file:
|
153 |
+
line = line.strip()
|
154 |
+
|
155 |
+
# Start collecting data when we reach the platform table
|
156 |
+
if line.startswith('^PLATFORM'):
|
157 |
+
in_table = True
|
158 |
+
continue
|
159 |
+
|
160 |
+
# Only process lines when we're in the platform section
|
161 |
+
if in_table:
|
162 |
+
# Skip empty lines and comment lines
|
163 |
+
if not line or line.startswith('!') or line.startswith('#'):
|
164 |
+
continue
|
165 |
+
|
166 |
+
# First non-comment line is the header
|
167 |
+
if header is None:
|
168 |
+
header = line.split('\t')
|
169 |
+
continue
|
170 |
+
|
171 |
+
# Add data lines to our collection
|
172 |
+
platform_data.append(line.split('\t'))
|
173 |
+
|
174 |
+
# Stop when we reach the end of platform section
|
175 |
+
if line.startswith('^SERIES'):
|
176 |
+
break
|
177 |
+
|
178 |
+
# Convert to DataFrame
|
179 |
+
gene_metadata = pd.DataFrame(platform_data, columns=header)
|
180 |
+
|
181 |
+
print("\nPlatform annotation columns:")
|
182 |
+
print(gene_metadata.columns.tolist())
|
183 |
+
|
184 |
+
print("\nFirst few rows:")
|
185 |
+
print(gene_metadata.head())
|
186 |
+
|
187 |
+
# Get mapping between probe IDs and gene symbols
|
188 |
+
mapping_data = get_gene_mapping(gene_metadata, prob_col='ID_REF', gene_col='Gene Symbol')
|
189 |
+
|
190 |
+
# Convert probe-level measurements to gene expression data
|
191 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_data)
|
192 |
+
|
193 |
+
print("\nPreview of mapped gene data:")
|
194 |
+
print(gene_data.iloc[:5, :5])
|
195 |
+
|
196 |
+
# Save gene data
|
197 |
+
gene_data.to_csv(out_gene_data_file)
|
198 |
+
# First read and extract platform annotation data
|
199 |
+
platform_data = []
|
200 |
+
header = None
|
201 |
+
with gzip.open(soft_file_path, 'rt') as file:
|
202 |
+
in_platform = False
|
203 |
+
for line in file:
|
204 |
+
line = line.strip()
|
205 |
+
if line.startswith('!platform_table_begin'):
|
206 |
+
in_platform = True
|
207 |
+
continue
|
208 |
+
elif line.startswith('!platform_table_end'):
|
209 |
+
break
|
210 |
+
elif in_platform:
|
211 |
+
if header is None:
|
212 |
+
header = line.split('\t')
|
213 |
+
else:
|
214 |
+
fields = line.split('\t')
|
215 |
+
if len(fields) == len(header): # Only add rows matching header length
|
216 |
+
platform_data.append(fields)
|
217 |
+
|
218 |
+
if header is None:
|
219 |
+
raise ValueError("Could not find platform annotation data in SOFT file")
|
220 |
+
|
221 |
+
# Convert to DataFrame
|
222 |
+
gene_metadata = pd.DataFrame(platform_data, columns=header)
|
223 |
+
|
224 |
+
# Get mapping between probe IDs and gene symbols
|
225 |
+
mapping_data = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Symbol')
|
226 |
+
|
227 |
+
# Convert probe-level measurements to gene expression data
|
228 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_data)
|
229 |
+
|
230 |
+
# Normalize gene symbols and save gene data
|
231 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
232 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
233 |
+
gene_data.to_csv(out_gene_data_file)
|
234 |
+
|
235 |
+
# Link clinical and genetic data
|
236 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
237 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
238 |
+
|
239 |
+
# Handle missing values
|
240 |
+
linked_data = handle_missing_values(linked_data, trait)
|
241 |
+
|
242 |
+
# Judge bias in features and remove biased ones
|
243 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
244 |
+
|
245 |
+
# Final validation and save metadata
|
246 |
+
is_usable = validate_and_save_cohort_info(
|
247 |
+
is_final=True,
|
248 |
+
cohort=cohort,
|
249 |
+
info_path=json_path,
|
250 |
+
is_gene_available=is_gene_available,
|
251 |
+
is_trait_available=True,
|
252 |
+
is_biased=trait_biased,
|
253 |
+
df=linked_data,
|
254 |
+
note="Gene expression data from blood samples comparing bipolar disorder patients in manic vs euthymic phases with controls."
|
255 |
+
)
|
256 |
+
|
257 |
+
# Save linked data if usable
|
258 |
+
if is_usable:
|
259 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
260 |
+
linked_data.to_csv(out_data_file)
|
261 |
+
# Extract gene annotation data
|
262 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
263 |
+
|
264 |
+
# Preview column names and first few values
|
265 |
+
preview = preview_df(gene_metadata)
|
266 |
+
print("\nGene annotation columns and sample values:")
|
267 |
+
print(preview)
|
p3/preprocess/Bipolar_disorder/code/GSE46449.py
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE46449"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE46449"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE46449.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE46449.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE46449.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# The dataset uses Affymetrix microarrays for gene expression, so gene data is available
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2.1 Data Row Identification
|
39 |
+
trait_row = 1 # 'genotype' contains trait information
|
40 |
+
age_row = 2 # 'age' data is available
|
41 |
+
gender_row = 3 # 'gender' data is available but shows only male
|
42 |
+
|
43 |
+
# 2.2 Data Type Conversion Functions
|
44 |
+
def convert_trait(x):
|
45 |
+
if not isinstance(x, str):
|
46 |
+
return None
|
47 |
+
x = x.lower().split(': ')[-1]
|
48 |
+
if 'bipolar' in x:
|
49 |
+
return 1
|
50 |
+
elif 'control' in x:
|
51 |
+
return 0
|
52 |
+
return None
|
53 |
+
|
54 |
+
def convert_age(x):
|
55 |
+
if not isinstance(x, str):
|
56 |
+
return None
|
57 |
+
try:
|
58 |
+
return float(x.split(': ')[-1])
|
59 |
+
except:
|
60 |
+
return None
|
61 |
+
|
62 |
+
def convert_gender(x):
|
63 |
+
if not isinstance(x, str):
|
64 |
+
return None
|
65 |
+
x = x.lower().split(': ')[-1]
|
66 |
+
if x == 'male':
|
67 |
+
return 1
|
68 |
+
elif x == 'female':
|
69 |
+
return 0
|
70 |
+
return None
|
71 |
+
|
72 |
+
# 3. Save Metadata
|
73 |
+
validate_and_save_cohort_info(is_final=False,
|
74 |
+
cohort=cohort,
|
75 |
+
info_path=json_path,
|
76 |
+
is_gene_available=is_gene_available,
|
77 |
+
is_trait_available=trait_row is not None)
|
78 |
+
|
79 |
+
# 4. Clinical Feature Extraction
|
80 |
+
if trait_row is not None:
|
81 |
+
selected_clinical_df = geo_select_clinical_features(clinical_df=clinical_data,
|
82 |
+
trait=trait,
|
83 |
+
trait_row=trait_row,
|
84 |
+
convert_trait=convert_trait,
|
85 |
+
age_row=age_row,
|
86 |
+
convert_age=convert_age,
|
87 |
+
gender_row=gender_row,
|
88 |
+
convert_gender=convert_gender)
|
89 |
+
|
90 |
+
# Preview the data
|
91 |
+
preview = preview_df(selected_clinical_df)
|
92 |
+
print("Preview of selected clinical features:")
|
93 |
+
print(preview)
|
94 |
+
|
95 |
+
# Save to CSV
|
96 |
+
selected_clinical_df.to_csv(out_clinical_data_file)
|
97 |
+
# Extract gene expression data from matrix file
|
98 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
99 |
+
|
100 |
+
# Print first 20 row IDs and some data preview to verify structure
|
101 |
+
print("First 20 gene/probe IDs:")
|
102 |
+
print(list(genetic_data.index[:20]))
|
103 |
+
|
104 |
+
print("\nData preview:")
|
105 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
106 |
+
print(preview_subset)
|
107 |
+
# These appear to be probe IDs from Affymetrix arrays (e.g. "1007_s_at" format)
|
108 |
+
# They need to be mapped to human gene symbols for analysis
|
109 |
+
requires_gene_mapping = True
|
110 |
+
# Extract gene annotation data
|
111 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
112 |
+
|
113 |
+
# Preview column names and first few values
|
114 |
+
preview = preview_df(gene_metadata)
|
115 |
+
print("\nGene annotation columns and sample values:")
|
116 |
+
print(preview)
|
117 |
+
# Get gene mapping between probe IDs and gene symbols
|
118 |
+
mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Gene Symbol')
|
119 |
+
|
120 |
+
# Apply gene mapping to convert probe-level data to gene-level data
|
121 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_df)
|
122 |
+
|
123 |
+
# Preview the gene expression data
|
124 |
+
print("Preview of mapped gene expression data:")
|
125 |
+
preview_subset = gene_data.iloc[:5, :5]
|
126 |
+
print(preview_subset)
|
127 |
+
# 1. Normalize gene symbols and save gene data
|
128 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
129 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
130 |
+
gene_data.to_csv(out_gene_data_file)
|
131 |
+
|
132 |
+
# 2. Link clinical and genetic data
|
133 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
134 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
135 |
+
|
136 |
+
# 3. Handle missing values
|
137 |
+
linked_data = handle_missing_values(linked_data, trait)
|
138 |
+
|
139 |
+
# 4. Judge bias in features and remove biased ones
|
140 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
141 |
+
|
142 |
+
# 5. Final validation and save metadata
|
143 |
+
is_usable = validate_and_save_cohort_info(
|
144 |
+
is_final=True,
|
145 |
+
cohort=cohort,
|
146 |
+
info_path=json_path,
|
147 |
+
is_gene_available=is_gene_available,
|
148 |
+
is_trait_available=True,
|
149 |
+
is_biased=trait_biased,
|
150 |
+
df=linked_data,
|
151 |
+
note="Gene expression data from whole blood. Samples include SJIA patients treated with canakinumab/placebo and healthy controls."
|
152 |
+
)
|
153 |
+
|
154 |
+
# 6. Save linked data if usable
|
155 |
+
if is_usable:
|
156 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
157 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE53987.py
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE53987"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE53987"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE53987.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE53987.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE53987.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# The background info states "hybridized to U133_Plus2 Affymetrix chips" which is a gene expression microarray
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2. Variable Availability and Data Type Conversion
|
39 |
+
# 2.1 Data Availability
|
40 |
+
# Disease state (trait) is in row 7
|
41 |
+
trait_row = 7
|
42 |
+
# Age is in row 0
|
43 |
+
age_row = 0
|
44 |
+
# Gender is in row 1
|
45 |
+
gender_row = 1
|
46 |
+
|
47 |
+
# 2.2 Data Type Conversion Functions
|
48 |
+
def convert_trait(value):
|
49 |
+
# Extract value after colon and strip whitespace
|
50 |
+
value = value.split(":")[-1].strip()
|
51 |
+
# Map disease states to binary (control=0, bipolar=1)
|
52 |
+
if value == "control":
|
53 |
+
return 0
|
54 |
+
elif value == "bipolar disorder":
|
55 |
+
return 1
|
56 |
+
# Skip other disease states
|
57 |
+
return None
|
58 |
+
|
59 |
+
def convert_age(value):
|
60 |
+
# Extract numeric age value
|
61 |
+
try:
|
62 |
+
age = float(value.split(":")[-1].strip())
|
63 |
+
return age
|
64 |
+
except:
|
65 |
+
return None
|
66 |
+
|
67 |
+
def convert_gender(value):
|
68 |
+
# Extract gender value and convert to binary
|
69 |
+
value = value.split(":")[-1].strip()
|
70 |
+
if value == "F":
|
71 |
+
return 0
|
72 |
+
elif value == "M":
|
73 |
+
return 1
|
74 |
+
return None
|
75 |
+
|
76 |
+
# 3. Save Metadata
|
77 |
+
validate_and_save_cohort_info(is_final=False,
|
78 |
+
cohort=cohort,
|
79 |
+
info_path=json_path,
|
80 |
+
is_gene_available=is_gene_available,
|
81 |
+
is_trait_available=trait_row is not None)
|
82 |
+
|
83 |
+
# 4. Clinical Feature Extraction
|
84 |
+
if trait_row is not None:
|
85 |
+
clinical_features = geo_select_clinical_features(clinical_data,
|
86 |
+
trait=trait,
|
87 |
+
trait_row=trait_row,
|
88 |
+
convert_trait=convert_trait,
|
89 |
+
age_row=age_row,
|
90 |
+
convert_age=convert_age,
|
91 |
+
gender_row=gender_row,
|
92 |
+
convert_gender=convert_gender)
|
93 |
+
|
94 |
+
# Preview the processed clinical data
|
95 |
+
preview = preview_df(clinical_features)
|
96 |
+
print("Preview of clinical features:")
|
97 |
+
print(preview)
|
98 |
+
|
99 |
+
# Save clinical data
|
100 |
+
clinical_features.to_csv(out_clinical_data_file)
|
101 |
+
# Extract gene expression data from matrix file
|
102 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
103 |
+
|
104 |
+
# Print first 20 row IDs and some data preview to verify structure
|
105 |
+
print("First 20 gene/probe IDs:")
|
106 |
+
print(list(genetic_data.index[:20]))
|
107 |
+
|
108 |
+
print("\nData preview:")
|
109 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
110 |
+
print(preview_subset)
|
111 |
+
# These appear to be Affymetrix probe IDs (####_at format) rather than gene symbols
|
112 |
+
# They will need to be mapped to official human gene symbols for analysis
|
113 |
+
requires_gene_mapping = True
|
114 |
+
# Extract gene annotation data
|
115 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
116 |
+
|
117 |
+
# Preview column names and first few values
|
118 |
+
preview = preview_df(gene_metadata)
|
119 |
+
print("\nGene annotation columns and sample values:")
|
120 |
+
print(preview)
|
121 |
+
# Get mapping between probe IDs and gene symbols
|
122 |
+
mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='Gene Symbol')
|
123 |
+
|
124 |
+
# Apply mapping to convert probe-level data to gene-level data
|
125 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_df)
|
126 |
+
|
127 |
+
# Preview gene data after mapping
|
128 |
+
print("Data preview after mapping to gene symbols:")
|
129 |
+
preview_subset = gene_data.iloc[:5, :5]
|
130 |
+
print(preview_subset)
|
131 |
+
# 1. Normalize gene symbols and save gene data
|
132 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
133 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
134 |
+
gene_data.to_csv(out_gene_data_file)
|
135 |
+
|
136 |
+
# 2. Link clinical and genetic data
|
137 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
138 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
139 |
+
|
140 |
+
# 3. Handle missing values
|
141 |
+
linked_data = handle_missing_values(linked_data, trait)
|
142 |
+
|
143 |
+
# 4. Judge bias in features and remove biased ones
|
144 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
145 |
+
|
146 |
+
# 5. Final validation and save metadata
|
147 |
+
is_usable = validate_and_save_cohort_info(
|
148 |
+
is_final=True,
|
149 |
+
cohort=cohort,
|
150 |
+
info_path=json_path,
|
151 |
+
is_gene_available=is_gene_available,
|
152 |
+
is_trait_available=True,
|
153 |
+
is_biased=trait_biased,
|
154 |
+
df=linked_data,
|
155 |
+
note="Gene expression data from whole blood. Samples include SJIA patients treated with canakinumab/placebo and healthy controls."
|
156 |
+
)
|
157 |
+
|
158 |
+
# 6. Save linked data if usable
|
159 |
+
if is_usable:
|
160 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
161 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE62191.py
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE62191"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE62191"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE62191.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE62191.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE62191.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# This is a gene expression study according to title and summary
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2. Variable Availability and Data Type Conversion
|
39 |
+
# 2.1 Row identification
|
40 |
+
trait_row = 1 # Disease state is recorded in row 1
|
41 |
+
age_row = 2 # Age is recorded in row 2
|
42 |
+
gender_row = 6 # Gender is recorded in row 6
|
43 |
+
|
44 |
+
# 2.2 Conversion functions
|
45 |
+
def convert_trait(x):
|
46 |
+
if pd.isna(x):
|
47 |
+
return None
|
48 |
+
value = x.split(": ")[1].lower()
|
49 |
+
if "bipolar disorder" in value:
|
50 |
+
return 1
|
51 |
+
elif "healthy control" in value:
|
52 |
+
return 0
|
53 |
+
return None
|
54 |
+
|
55 |
+
def convert_age(x):
|
56 |
+
if pd.isna(x):
|
57 |
+
return None
|
58 |
+
try:
|
59 |
+
return int(x.split(": ")[1].split(" ")[0])
|
60 |
+
except:
|
61 |
+
return None
|
62 |
+
|
63 |
+
def convert_gender(x):
|
64 |
+
if pd.isna(x):
|
65 |
+
return None
|
66 |
+
value = x.split(": ")[1].lower()
|
67 |
+
if value == "male":
|
68 |
+
return 1
|
69 |
+
elif value == "female":
|
70 |
+
return 0
|
71 |
+
return None
|
72 |
+
|
73 |
+
# 3. Save initial validation result
|
74 |
+
is_validated = 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=trait_row is not None
|
80 |
+
)
|
81 |
+
|
82 |
+
# 4. Extract clinical features
|
83 |
+
selected_clinical = geo_select_clinical_features(
|
84 |
+
clinical_df=clinical_data,
|
85 |
+
trait=trait,
|
86 |
+
trait_row=trait_row,
|
87 |
+
convert_trait=convert_trait,
|
88 |
+
age_row=age_row,
|
89 |
+
convert_age=convert_age,
|
90 |
+
gender_row=gender_row,
|
91 |
+
convert_gender=convert_gender
|
92 |
+
)
|
93 |
+
|
94 |
+
# Preview the extracted features
|
95 |
+
preview_result = preview_df(selected_clinical)
|
96 |
+
|
97 |
+
# Save clinical data
|
98 |
+
selected_clinical.to_csv(out_clinical_data_file)
|
99 |
+
# Extract gene expression data from matrix file
|
100 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
101 |
+
|
102 |
+
# Print first 20 row IDs and some data preview to verify structure
|
103 |
+
print("First 20 gene/probe IDs:")
|
104 |
+
print(list(genetic_data.index[:20]))
|
105 |
+
|
106 |
+
print("\nData preview:")
|
107 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
108 |
+
print(preview_subset)
|
109 |
+
# The identifiers appear to be numeric probe IDs rather than human gene symbols
|
110 |
+
requires_gene_mapping = True
|
111 |
+
# Extract gene annotation data
|
112 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
113 |
+
|
114 |
+
# Preview column names and first few values
|
115 |
+
preview = preview_df(gene_metadata)
|
116 |
+
print("\nGene annotation columns and sample values:")
|
117 |
+
print(preview)
|
118 |
+
# Extract probe_id and gene_symbol mapping from annotation data
|
119 |
+
mapping_data = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='GENE_SYMBOL')
|
120 |
+
|
121 |
+
# Apply gene mapping to convert probe-level data to gene-level data
|
122 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_data)
|
123 |
+
|
124 |
+
# Preview the gene expression data
|
125 |
+
print("\nGene expression data preview:")
|
126 |
+
preview_subset = gene_data.iloc[:5, :5]
|
127 |
+
print(preview_subset)
|
128 |
+
# 1. Normalize gene symbols and save gene data
|
129 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
130 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
131 |
+
gene_data.to_csv(out_gene_data_file)
|
132 |
+
|
133 |
+
# 2. Link clinical and genetic data
|
134 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
135 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
136 |
+
|
137 |
+
# 3. Handle missing values
|
138 |
+
linked_data = handle_missing_values(linked_data, trait)
|
139 |
+
|
140 |
+
# 4. Judge bias in features and remove biased ones
|
141 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
142 |
+
|
143 |
+
# 5. Final validation and save metadata
|
144 |
+
is_usable = validate_and_save_cohort_info(
|
145 |
+
is_final=True,
|
146 |
+
cohort=cohort,
|
147 |
+
info_path=json_path,
|
148 |
+
is_gene_available=is_gene_available,
|
149 |
+
is_trait_available=True,
|
150 |
+
is_biased=trait_biased,
|
151 |
+
df=linked_data,
|
152 |
+
note="Gene expression data from whole blood. Samples include SJIA patients treated with canakinumab/placebo and healthy controls."
|
153 |
+
)
|
154 |
+
|
155 |
+
# 6. Save linked data if usable
|
156 |
+
if is_usable:
|
157 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
158 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE67311.py
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE67311"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE67311"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE67311.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE67311.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE67311.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# Yes, according to the background info this is a gene expression dataset using Affymetrix® Human Gene 1.1 ST arrays
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2. Variable Availability and Data Type Conversion
|
39 |
+
# Trait (Bipolar disorder) is recorded in row 7
|
40 |
+
trait_row = 7
|
41 |
+
|
42 |
+
def convert_trait(x):
|
43 |
+
if pd.isna(x):
|
44 |
+
return None
|
45 |
+
value = x.split(': ')[1]
|
46 |
+
if value == 'Yes':
|
47 |
+
return 1
|
48 |
+
elif value == 'No':
|
49 |
+
return 0
|
50 |
+
return None
|
51 |
+
|
52 |
+
# Age is not available
|
53 |
+
age_row = None
|
54 |
+
convert_age = None
|
55 |
+
|
56 |
+
# Gender is not available
|
57 |
+
gender_row = None
|
58 |
+
convert_gender = None
|
59 |
+
|
60 |
+
# 3. Save initial filtering result
|
61 |
+
note = "Dataset is primarily focused on fibromyalgia with bipolar disorder only recorded as comorbidity. Very few bipolar cases (~2/140) make it unsuitable for bipolar disorder research."
|
62 |
+
|
63 |
+
is_usable = validate_and_save_cohort_info(
|
64 |
+
is_final=False,
|
65 |
+
cohort=cohort,
|
66 |
+
info_path=json_path,
|
67 |
+
is_gene_available=is_gene_available,
|
68 |
+
is_trait_available=(trait_row is not None),
|
69 |
+
note=note
|
70 |
+
)
|
71 |
+
|
72 |
+
# 4. Clinical Feature Extraction
|
73 |
+
if trait_row is not None:
|
74 |
+
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 |
+
|
85 |
+
# Preview the extracted features
|
86 |
+
preview = preview_df(clinical_df)
|
87 |
+
print("Preview of clinical features:", preview)
|
88 |
+
|
89 |
+
# Save to CSV
|
90 |
+
clinical_df.to_csv(out_clinical_data_file)
|
91 |
+
# Extract gene expression data from matrix file
|
92 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
93 |
+
|
94 |
+
# Print first 20 row IDs and some data preview to verify structure
|
95 |
+
print("First 20 gene/probe IDs:")
|
96 |
+
print(list(genetic_data.index[:20]))
|
97 |
+
|
98 |
+
print("\nData preview:")
|
99 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
100 |
+
print(preview_subset)
|
101 |
+
# These numeric identifiers appear to be microarray probe IDs, not gene symbols
|
102 |
+
# They are likely Illumina or Affymetrix probe IDs that need to be mapped to gene symbols
|
103 |
+
requires_gene_mapping = True
|
104 |
+
# Extract gene annotation data
|
105 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
106 |
+
|
107 |
+
# Preview column names and first few values
|
108 |
+
preview = preview_df(gene_metadata)
|
109 |
+
print("\nGene annotation columns and sample values:")
|
110 |
+
print(preview)
|
111 |
+
# Get gene mapping from annotation data
|
112 |
+
# 'ID' column contains probe IDs matching gene expression data
|
113 |
+
# Extract gene symbols directly from gene_assignment field using extract_human_gene_symbols
|
114 |
+
mapping_df = get_gene_mapping(gene_metadata, prob_col='ID', gene_col='gene_assignment')
|
115 |
+
|
116 |
+
# Convert probe-level measurements to gene expression data using the library's function
|
117 |
+
# The apply_gene_mapping function already includes the extract_human_gene_symbols logic
|
118 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_df)
|
119 |
+
|
120 |
+
# Preview results
|
121 |
+
print("Shape of gene expression data:", gene_data.shape)
|
122 |
+
print("\nFirst few rows and columns of gene expression data:")
|
123 |
+
print(gene_data.iloc[:5, :5])
|
124 |
+
# 1. Normalize gene symbols and save gene data
|
125 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
126 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
127 |
+
gene_data.to_csv(out_gene_data_file)
|
128 |
+
|
129 |
+
# 2. Link clinical and genetic data
|
130 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
131 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
132 |
+
|
133 |
+
# 3. Handle missing values
|
134 |
+
linked_data = handle_missing_values(linked_data, trait)
|
135 |
+
|
136 |
+
# 4. Judge bias in features and remove biased ones
|
137 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
138 |
+
|
139 |
+
# 5. Final validation and save metadata
|
140 |
+
is_usable = validate_and_save_cohort_info(
|
141 |
+
is_final=True,
|
142 |
+
cohort=cohort,
|
143 |
+
info_path=json_path,
|
144 |
+
is_gene_available=is_gene_available,
|
145 |
+
is_trait_available=True,
|
146 |
+
is_biased=trait_biased,
|
147 |
+
df=linked_data,
|
148 |
+
note="Gene expression data from whole blood. Samples include SJIA patients treated with canakinumab/placebo and healthy controls."
|
149 |
+
)
|
150 |
+
|
151 |
+
# 6. Save linked data if usable
|
152 |
+
if is_usable:
|
153 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
154 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE92538.py
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE92538"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE92538"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE92538.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE92538.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE92538.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Gene Expression Data Availability
|
35 |
+
# Based on background info, this dataset contains gene expression data from Affymetrix microarrays
|
36 |
+
is_gene_available = True
|
37 |
+
|
38 |
+
# 2.1 Data Availability
|
39 |
+
# Trait (Bipolar Disorder) data is in row 2 under 'diagnosis'
|
40 |
+
trait_row = 2
|
41 |
+
|
42 |
+
# Age data is in row 8
|
43 |
+
age_row = 8
|
44 |
+
|
45 |
+
# Gender data is in row 6
|
46 |
+
gender_row = 6
|
47 |
+
|
48 |
+
# 2.2 Data Type Conversion Functions
|
49 |
+
def convert_trait(x: str) -> Optional[int]:
|
50 |
+
"""Convert diagnosis to binary indicating bipolar disorder"""
|
51 |
+
if not x or 'diagnosis:' not in x:
|
52 |
+
return None
|
53 |
+
val = x.split('diagnosis:')[1].strip()
|
54 |
+
if 'Bipolar Disorder' in val:
|
55 |
+
return 1
|
56 |
+
elif val in ['Control', 'Schizophrenia', 'Major Depressive Disorder']:
|
57 |
+
return 0
|
58 |
+
return None
|
59 |
+
|
60 |
+
def convert_age(x: str) -> Optional[float]:
|
61 |
+
"""Convert age to continuous value"""
|
62 |
+
if not x or 'age:' not in x:
|
63 |
+
return None
|
64 |
+
try:
|
65 |
+
return float(x.split('age:')[1].strip())
|
66 |
+
except:
|
67 |
+
return None
|
68 |
+
|
69 |
+
def convert_gender(x: str) -> Optional[int]:
|
70 |
+
"""Convert gender to binary (0=female, 1=male)"""
|
71 |
+
if not x or 'gender:' not in x:
|
72 |
+
return None
|
73 |
+
val = x.split('gender:')[1].strip()
|
74 |
+
if val == 'F':
|
75 |
+
return 0
|
76 |
+
elif val == 'M':
|
77 |
+
return 1
|
78 |
+
return None
|
79 |
+
|
80 |
+
# 3. Save Metadata
|
81 |
+
validate_and_save_cohort_info(
|
82 |
+
is_final=False,
|
83 |
+
cohort=cohort,
|
84 |
+
info_path=json_path,
|
85 |
+
is_gene_available=is_gene_available,
|
86 |
+
is_trait_available=(trait_row is not None)
|
87 |
+
)
|
88 |
+
|
89 |
+
# 4. Clinical Feature Extraction
|
90 |
+
# Extract clinical features using helper function
|
91 |
+
selected_clinical = geo_select_clinical_features(
|
92 |
+
clinical_df=clinical_data,
|
93 |
+
trait=trait,
|
94 |
+
trait_row=trait_row,
|
95 |
+
convert_trait=convert_trait,
|
96 |
+
age_row=age_row,
|
97 |
+
convert_age=convert_age,
|
98 |
+
gender_row=gender_row,
|
99 |
+
convert_gender=convert_gender
|
100 |
+
)
|
101 |
+
|
102 |
+
# Preview the extracted features
|
103 |
+
print("Preview of extracted clinical features:")
|
104 |
+
print(preview_df(selected_clinical))
|
105 |
+
|
106 |
+
# Save clinical data
|
107 |
+
os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
|
108 |
+
selected_clinical.to_csv(out_clinical_data_file)
|
109 |
+
# Extract gene expression data from matrix file
|
110 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
111 |
+
|
112 |
+
# Print first 20 row IDs and some data preview to verify structure
|
113 |
+
print("First 20 gene/probe IDs:")
|
114 |
+
print(list(genetic_data.index[:20]))
|
115 |
+
|
116 |
+
print("\nData preview:")
|
117 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
118 |
+
print(preview_subset)
|
119 |
+
# These IDs are in Affymetrix ID format (_at suffix), not gene symbols
|
120 |
+
# They need to be mapped to official gene symbols
|
121 |
+
requires_gene_mapping = True
|
122 |
+
# Extract gene annotation data
|
123 |
+
gene_metadata = get_gene_annotation(soft_file_path)
|
124 |
+
|
125 |
+
# Preview column names and first few values
|
126 |
+
preview = preview_df(gene_metadata)
|
127 |
+
print("\nGene annotation columns and sample values:")
|
128 |
+
print(preview)
|
129 |
+
# 1. Identify relevant columns: 'ID' contains probe IDs and 'SYMBOL' contains gene symbols
|
130 |
+
prob_col = 'ID'
|
131 |
+
gene_col = 'SYMBOL'
|
132 |
+
|
133 |
+
# 2. Get gene mapping dataframe
|
134 |
+
mapping_data = get_gene_mapping(gene_metadata, prob_col, gene_col)
|
135 |
+
|
136 |
+
# 3. Apply gene mapping to convert probe-level data to gene expression data
|
137 |
+
gene_data = apply_gene_mapping(genetic_data, mapping_data)
|
138 |
+
# 1. Normalize gene symbols and save gene data
|
139 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
140 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
141 |
+
gene_data.to_csv(out_gene_data_file)
|
142 |
+
|
143 |
+
# 2. Link clinical and genetic data
|
144 |
+
clinical_features = pd.read_csv(out_clinical_data_file, index_col=0)
|
145 |
+
linked_data = geo_link_clinical_genetic_data(clinical_features, gene_data)
|
146 |
+
|
147 |
+
# 3. Handle missing values
|
148 |
+
linked_data = handle_missing_values(linked_data, trait)
|
149 |
+
|
150 |
+
# 4. Judge bias in features and remove biased ones
|
151 |
+
trait_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
152 |
+
|
153 |
+
# 5. Final validation and save metadata
|
154 |
+
is_usable = validate_and_save_cohort_info(
|
155 |
+
is_final=True,
|
156 |
+
cohort=cohort,
|
157 |
+
info_path=json_path,
|
158 |
+
is_gene_available=is_gene_available,
|
159 |
+
is_trait_available=True,
|
160 |
+
is_biased=trait_biased,
|
161 |
+
df=linked_data,
|
162 |
+
note="Gene expression data from whole blood. Samples include SJIA patients treated with canakinumab/placebo and healthy controls."
|
163 |
+
)
|
164 |
+
|
165 |
+
# 6. Save linked data if usable
|
166 |
+
if is_usable:
|
167 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
168 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bipolar_disorder/code/GSE93114.py
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
cohort = "GSE93114"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bipolar_disorder"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bipolar_disorder/GSE93114"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/GSE93114.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/GSE93114.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/GSE93114.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths for SOFT and matrix files
|
19 |
+
soft_file_path, matrix_file_path = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Get background info and clinical data from the matrix file
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file_path)
|
23 |
+
|
24 |
+
# Create dictionary of unique values for each feature
|
25 |
+
unique_values_dict = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print the information
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(background_info)
|
30 |
+
print("\nSample Characteristics:")
|
31 |
+
for feature, values in unique_values_dict.items():
|
32 |
+
print(f"\n{feature}:")
|
33 |
+
print(values)
|
34 |
+
# 1. Check gene expression data availability
|
35 |
+
is_gene_available = True # Series title mentions "Gene expression data"
|
36 |
+
|
37 |
+
# 2.1 Data Availability
|
38 |
+
# All samples are bipolar disorder cases - no controls, so trait data not usable
|
39 |
+
trait_row = None # No trait variability
|
40 |
+
age_row = None # Age not available
|
41 |
+
gender_row = None # Gender not available
|
42 |
+
|
43 |
+
# 2.2 Convert functions
|
44 |
+
def convert_trait(val: str) -> int:
|
45 |
+
"""Convert bipolar disorder status to binary value"""
|
46 |
+
if not isinstance(val, str):
|
47 |
+
return None
|
48 |
+
val = val.lower()
|
49 |
+
if 'bipolar disorder' in val:
|
50 |
+
return 1
|
51 |
+
elif 'control' in val:
|
52 |
+
return 0
|
53 |
+
return None
|
54 |
+
|
55 |
+
def convert_age(val: str) -> float:
|
56 |
+
"""Convert age to float - not used since age not available"""
|
57 |
+
return None
|
58 |
+
|
59 |
+
def convert_gender(val: str) -> int:
|
60 |
+
"""Convert gender to binary - not used since gender not available"""
|
61 |
+
return None
|
62 |
+
|
63 |
+
# 3. Save metadata
|
64 |
+
_ = validate_and_save_cohort_info(
|
65 |
+
is_final=False,
|
66 |
+
cohort=cohort,
|
67 |
+
info_path=json_path,
|
68 |
+
is_gene_available=is_gene_available,
|
69 |
+
is_trait_available=(trait_row is not None)
|
70 |
+
)
|
71 |
+
|
72 |
+
# 4. Skip clinical feature extraction since trait_row is None
|
73 |
+
# Extract gene expression data from matrix file
|
74 |
+
genetic_data = get_genetic_data(matrix_file_path)
|
75 |
+
|
76 |
+
# Print first 20 row IDs and some data preview to verify structure
|
77 |
+
print("First 20 gene/probe IDs:")
|
78 |
+
print(list(genetic_data.index[:20]))
|
79 |
+
|
80 |
+
print("\nData preview:")
|
81 |
+
preview_subset = genetic_data.iloc[:5, :5]
|
82 |
+
print(preview_subset)
|
83 |
+
# These identifiers appear to be probe IDs from a microarray platform, not human gene symbols
|
84 |
+
# They need to be mapped to standard gene symbols for analysis
|
85 |
+
requires_gene_mapping = True
|
86 |
+
# Update metadata with correct gene availability assessment
|
87 |
+
is_gene_available = False # Dataset contains miRNA, not gene expression data
|
88 |
+
_ = validate_and_save_cohort_info(
|
89 |
+
is_final=False,
|
90 |
+
cohort=cohort,
|
91 |
+
info_path=json_path,
|
92 |
+
is_gene_available=is_gene_available,
|
93 |
+
is_trait_available=(trait_row is not None)
|
94 |
+
)
|
p3/preprocess/Bipolar_disorder/code/TCGA.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bipolar_disorder"
|
6 |
+
|
7 |
+
# Input paths
|
8 |
+
tcga_root_dir = "../DATA/TCGA"
|
9 |
+
|
10 |
+
# Output paths
|
11 |
+
out_data_file = "./output/preprocess/3/Bipolar_disorder/TCGA.csv"
|
12 |
+
out_gene_data_file = "./output/preprocess/3/Bipolar_disorder/gene_data/TCGA.csv"
|
13 |
+
out_clinical_data_file = "./output/preprocess/3/Bipolar_disorder/clinical_data/TCGA.csv"
|
14 |
+
json_path = "./output/preprocess/3/Bipolar_disorder/cohort_info.json"
|
15 |
+
|
16 |
+
# Check if directory exists for bipolar disorder
|
17 |
+
directories = os.listdir(tcga_root_dir)
|
18 |
+
relevant_dirs = [d for d in directories if not d.startswith('.') and os.path.isdir(os.path.join(tcga_root_dir, d))]
|
19 |
+
|
20 |
+
# No relevant cohort exists for bipolar disorder in TCGA (cancer database)
|
21 |
+
is_gene_available = False
|
22 |
+
is_trait_available = False
|
23 |
+
|
24 |
+
# Record this information and exit pipeline
|
25 |
+
validate_and_save_cohort_info(
|
26 |
+
is_final=False,
|
27 |
+
cohort="TCGA",
|
28 |
+
info_path=json_path,
|
29 |
+
is_gene_available=is_gene_available,
|
30 |
+
is_trait_available=is_trait_available
|
31 |
+
)
|
p3/preprocess/Bipolar_disorder/gene_data/GSE120340.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p3/preprocess/Bipolar_disorder/gene_data/GSE45484.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81156a135b95c2d5f3e860624d2493840a0ef28f47fb0d90b6c465ec7d0931fb
|
3 |
+
size 21930805
|
p3/preprocess/Bipolar_disorder/gene_data/GSE46449.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:13151fc2b2ee7c131e9e90df2c4c4b1c93021e2eecc7cfb11e69bc1fdc8606ca
|
3 |
+
size 23288499
|
p3/preprocess/Bipolar_disorder/gene_data/GSE53987.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b5fda65de449c36e18a9f851ea0d633241d655a9efb0b60a936c5cabcaba8a98
|
3 |
+
size 34613190
|
p3/preprocess/Bipolar_disorder/gene_data/GSE62191.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a1038eca3fd0daa25b8a814562891971ac0cb79e1a1f5f51021c4956b40028f7
|
3 |
+
size 16039825
|
p3/preprocess/Bladder_Cancer/GSE138118.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a5002d4a518cdc727b310c939683dea7ffe53e57268ba6c4252bae15855729bf
|
3 |
+
size 15335998
|
p3/preprocess/Bladder_Cancer/GSE185264.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
p3/preprocess/Bladder_Cancer/GSE222073.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:74a3de67549cdbb49355c60085930df17eef6359c72482d7d18fc7ff408ed5db
|
3 |
+
size 23285441
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE138118.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
,GSM4100381,GSM4100382,GSM4100383,GSM4100384,GSM4100385,GSM4100386,GSM4100387,GSM4100388,GSM4100389,GSM4100390,GSM4100391,GSM4100392,GSM4100393,GSM4100394,GSM4100395,GSM4100396,GSM4100397,GSM4100398,GSM4100399,GSM4100400,GSM4100401,GSM4100402,GSM4100403,GSM4100404,GSM4100405,GSM4100406,GSM4100407,GSM4100408,GSM4100409,GSM4100410,GSM4100411,GSM4100412,GSM4100413,GSM4100414,GSM4100415,GSM4100416,GSM4100417,GSM4100418,GSM4100419,GSM4100420,GSM4100421,GSM4100422,GSM4100423,GSM4100424,GSM4100425,GSM4100426,GSM4100427,GSM4100428,GSM4100429,GSM4100430,GSM4100431,GSM4100432,GSM4100433,GSM4100434,GSM4100435,GSM4100436,GSM4100437,GSM4100438,GSM4100439,GSM4100440,GSM4100441,GSM4100442,GSM4100443,GSM4100444,GSM4100445,GSM4100446,GSM4100447,GSM4100448,GSM4100449,GSM4100450,GSM4100451,GSM4100452,GSM4100453,GSM4100454,GSM4100455
|
2 |
+
Bladder_Cancer,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,,,,1.0,,1.0,,,,1.0,1.0,1.0,,,,1.0,1.0,1.0,1.0,,,,,,,1.0,,,,,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
3 |
+
Age,71.0,68.0,83.0,69.0,66.0,59.0,56.0,73.0,72.0,93.0,69.0,74.0,72.0,45.0,78.0,70.0,76.0,64.0,67.0,63.0,68.0,58.0,68.0,61.0,65.0,77.0,68.0,54.0,66.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE145261.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,GSM4310302,GSM4310303,GSM4310304,GSM4310305,GSM4310306,GSM4310307,GSM4310308,GSM4310309,GSM4310310,GSM4310311,GSM4310312,GSM4310313,GSM4310314,GSM4310315,GSM4310316,GSM4310317,GSM4310318,GSM4310319,GSM4310320,GSM4310321,GSM4310322,GSM4310323
|
2 |
+
Bladder_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
3 |
+
Age,72.0,76.0,72.0,79.0,60.0,65.0,41.0,76.0,76.0,67.0,71.0,65.0,71.0,72.0,57.0,71.0,67.0,34.0,62.0,90.0,72.0,58.0
|
4 |
+
Gender,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE162253.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM4947508,GSM4947509,GSM4947510
|
2 |
+
Bladder_Cancer,0.0,1.0,1.0
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE185264.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
,GSM5609338,GSM5609339,GSM5609340,GSM5609341,GSM5609342,GSM5609343,GSM5609344,GSM5609345,GSM5609346,GSM5609347,GSM5609348,GSM5609349,GSM5609350,GSM5609351,GSM5609352,GSM5609353,GSM5609354,GSM5609355,GSM5609356,GSM5609357,GSM5609358,GSM5609359,GSM5609360,GSM5609361,GSM5609362,GSM5609363,GSM5609364,GSM5609365,GSM5609366,GSM5609367,GSM5609368,GSM5609369,GSM5609370,GSM5609371,GSM5609372,GSM5609373,GSM5609374,GSM5609375,GSM5609376,GSM5609377,GSM5609378,GSM5609379,GSM5609380,GSM5609381,GSM5609382,GSM5609383,GSM5609384,GSM5609385,GSM5609386,GSM5609387,GSM5609388,GSM5609389,GSM5609390,GSM5609391,GSM5609392,GSM5609393,GSM5609394,GSM5609395,GSM5609396,GSM5609397,GSM5609398,GSM5609399,GSM5609400,GSM5609401,GSM5609402,GSM5609403,GSM5609404,GSM5609405,GSM5609406,GSM5609407,GSM5609408,GSM5609409,GSM5609410,GSM5609411,GSM5609412,GSM5609413,GSM5609414,GSM5609415
|
2 |
+
Bladder_Cancer,,,,,,0.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,,,,,,,,,,,,,,,,,,,,,,,,0.0,0.0,0.0,0.0,0.0,0.0,,0.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0
|
3 |
+
Gender,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE222073.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM6914278,GSM6914279,GSM6914280,GSM6914281,GSM6914282,GSM6914283,GSM6914284,GSM6914285,GSM6914286,GSM6914287,GSM6914288,GSM6914289,GSM6914290,GSM6914291,GSM6914292,GSM6914293,GSM6914294,GSM6914295,GSM6914296,GSM6914297,GSM6914298,GSM6914299,GSM6914300,GSM6914301,GSM6914302,GSM6914303,GSM6914304,GSM6914305,GSM6914306,GSM6914307,GSM6914308,GSM6914309,GSM6914310,GSM6914311,GSM6914312,GSM6914313,GSM6914314,GSM6914315,GSM6914316,GSM6914317,GSM6914318,GSM6914319,GSM6914320,GSM6914321,GSM6914322,GSM6914323,GSM6914324,GSM6914325,GSM6914326,GSM6914327,GSM6914328,GSM6914329,GSM6914330,GSM6914331,GSM6914332,GSM6914333,GSM6914334,GSM6914335,GSM6914336,GSM6914337,GSM6914338,GSM6914339,GSM6914340,GSM6914341,GSM6914342,GSM6914343,GSM6914344,GSM6914345,GSM6914346,GSM6914347,GSM6914348,GSM6914349,GSM6914350,GSM6914351,GSM6914352,GSM6914353,GSM6914354,GSM6914355,GSM6914356,GSM6914357,GSM6914358,GSM6914359,GSM6914360,GSM6914361,GSM6914362,GSM6914363,GSM6914364,GSM6914365,GSM6914366,GSM6914367,GSM6914368,GSM6914369,GSM6914370,GSM6914371,GSM6914372,GSM6914373,GSM6914374,GSM6914375,GSM6914376,GSM6914377,GSM6914378,GSM6914379,GSM6914380,GSM6914381,GSM6914382,GSM6914383,GSM6914384,GSM6914385,GSM6914386,GSM6914387,GSM6914388,GSM6914389,GSM6914390,GSM6914391,GSM6914392,GSM6914393,GSM6914394,GSM6914395,GSM6914396,GSM6914397,GSM6914398,GSM6914399,GSM6914400,GSM6914401,GSM6914402,GSM6914403,GSM6914404,GSM6914405,GSM6914406,GSM6914407,GSM6914408,GSM6914409,GSM6914410,GSM6914411,GSM6914412,GSM6914413,GSM6914414,GSM6914415,GSM6914416,GSM6914417,GSM6914418,GSM6914419,GSM6914420,GSM6914421,GSM6914422,GSM6914423
|
2 |
+
Bladder_Cancer,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,0.0,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,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,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE244266.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM7810144,GSM7810145,GSM7810146,GSM7810147,GSM7810148,GSM7810149,GSM7810150,GSM7810151,GSM7810152,GSM7810153,GSM7810154,GSM7810155,GSM7810156,GSM7810157,GSM7810158,GSM7810159,GSM7810160,GSM7810161,GSM7810162,GSM7810163,GSM7810164,GSM7810165,GSM7810166,GSM7810167,GSM7810168,GSM7810169,GSM7810170,GSM7810171,GSM7810172,GSM7810173,GSM7810174,GSM7810175,GSM7810176,GSM7810177,GSM7810178,GSM7810179,GSM7810180,GSM7810181,GSM7810182,GSM7810183,GSM7810184,GSM7810185,GSM7810186,GSM7810187,GSM7810188,GSM7810189,GSM7810190,GSM7810191,GSM7810192,GSM7810193,GSM7810194,GSM7810195,GSM7810196,GSM7810197,GSM7810198,GSM7810199,GSM7810200,GSM7810201,GSM7810202,GSM7810203,GSM7810204,GSM7810205,GSM7810206,GSM7810207,GSM7810208,GSM7810209,GSM7810210,GSM7810211,GSM7810212,GSM7810213,GSM7810214,GSM7810215,GSM7810216,GSM7810217,GSM7810218,GSM7810219,GSM7810220,GSM7810221,GSM7810222,GSM7810223,GSM7810224,GSM7810225,GSM7810226,GSM7810227,GSM7810228,GSM7810229,GSM7810230,GSM7810231,GSM7810232,GSM7810233,GSM7810234,GSM7810235,GSM7810236,GSM7810237,GSM7810238,GSM7810239,GSM7810240,GSM7810241,GSM7810242,GSM7810243,GSM7810244,GSM7810245,GSM7810246,GSM7810247,GSM7810248,GSM7810249,GSM7810250,GSM7810251,GSM7810252,GSM7810253,GSM7810254,GSM7810255,GSM7810256,GSM7810257,GSM7810258,GSM7810259,GSM7810260,GSM7810261,GSM7810262,GSM7810263,GSM7810264,GSM7810265,GSM7810266,GSM7810267,GSM7810268,GSM7810269,GSM7810270,GSM7810271,GSM7810272,GSM7810273,GSM7810274,GSM7810275,GSM7810276,GSM7810277,GSM7810278,GSM7810279,GSM7810280,GSM7810281,GSM7810282,GSM7810283,GSM7810284,GSM7810285,GSM7810286,GSM7810287,GSM7810288,GSM7810289,GSM7810290,GSM7810291,GSM7810292,GSM7810293,GSM7810294,GSM7810295,GSM7810296,GSM7810297,GSM7810298,GSM7810299,GSM7810300,GSM7810301,GSM7810302,GSM7810303,GSM7810304,GSM7810305,GSM7810306,GSM7810307,GSM7810308,GSM7810309,GSM7810310,GSM7810311,GSM7810312,GSM7810313,GSM7810314,GSM7810315,GSM7810316,GSM7810317,GSM7810318,GSM7810319,GSM7810320,GSM7810321,GSM7810322,GSM7810323,GSM7810324,GSM7810325,GSM7810326,GSM7810327,GSM7810328,GSM7810329,GSM7810330,GSM7810331,GSM7810332
|
2 |
+
Bladder_Cancer,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE245953.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM7851882,GSM7851883,GSM7851884,GSM7851885,GSM7851886,GSM7851887,GSM7851888,GSM7851889,GSM7851890,GSM7851891,GSM7851892,GSM7851893,GSM7851894,GSM7851895,GSM7851896,GSM7851897,GSM7851898,GSM7851899,GSM7851900,GSM7851901,GSM7851902,GSM7851903,GSM7851904,GSM7851905,GSM7851906,GSM7851907,GSM7851908,GSM7851909,GSM7851910,GSM7851911,GSM7851912,GSM7851913,GSM7851914,GSM7851915,GSM7851916,GSM7851917,GSM7851918,GSM7851919,GSM7851920,GSM7851921,GSM7851922,GSM7851923,GSM7851924,GSM7851925,GSM7851926,GSM7851927,GSM7851928,GSM7851929,GSM7851930,GSM7851931,GSM7851932,GSM7851933,GSM7851934,GSM7851935,GSM7851936,GSM7851937,GSM7851938,GSM7851939,GSM7851940,GSM7851941,GSM7851942,GSM7851943,GSM7851944,GSM7851945,GSM7851946,GSM7851947,GSM7851948,GSM7851949,GSM7851950,GSM7851951,GSM7851952,GSM7851953,GSM7851954,GSM7851955,GSM7851956,GSM7851957,GSM7851958,GSM7851959,GSM7851960,GSM7851961,GSM7851962,GSM7851963,GSM7851964,GSM7851965,GSM7851966,GSM7851967,GSM7851968,GSM7851969,GSM7851970,GSM7851971,GSM7851972,GSM7851973,GSM7851974,GSM7851975,GSM7851976,GSM7851977,GSM7851978,GSM7851979,GSM7851980,GSM7851981,GSM7851982,GSM7851983,GSM7851984,GSM7851985,GSM7851986,GSM7851987,GSM7851988,GSM7851989,GSM7851990,GSM7851991,GSM7851992,GSM7851993,GSM7851994,GSM7851995,GSM7851996,GSM7851997,GSM7851998,GSM7851999,GSM7852000,GSM7852001,GSM7852002,GSM7852003,GSM7852004,GSM7852005,GSM7852006,GSM7852007,GSM7852008,GSM7852009,GSM7852010,GSM7852011,GSM7852012,GSM7852013,GSM7852014,GSM7852015,GSM7852016,GSM7852017,GSM7852018,GSM7852019,GSM7852020,GSM7852021,GSM7852022,GSM7852023,GSM7852024,GSM7852025,GSM7852026,GSM7852027,GSM7852028,GSM7852029,GSM7852030,GSM7852031,GSM7852032,GSM7852033,GSM7852034,GSM7852035,GSM7852036,GSM7852037,GSM7852038,GSM7852039,GSM7852040,GSM7852041,GSM7852042,GSM7852043,GSM7852044,GSM7852045,GSM7852046,GSM7852047,GSM7852048,GSM7852049,GSM7852050,GSM7852051,GSM7852052,GSM7852053,GSM7852054,GSM7852055,GSM7852056,GSM7852057,GSM7852058,GSM7852059,GSM7852060,GSM7852061,GSM7852062,GSM7852063,GSM7852064,GSM7852065,GSM7852066,GSM7852067,GSM7852068,GSM7852069,GSM7852070,GSM7852071,GSM7852072,GSM7852073,GSM7852074,GSM7852075,GSM7852076,GSM7852077,GSM7852078,GSM7852079,GSM7852080,GSM7852081,GSM7852082,GSM7852083,GSM7852084,GSM7852085,GSM7852086,GSM7852087,GSM7852088,GSM7852089,GSM7852090,GSM7852091,GSM7852092,GSM7852093,GSM7852094,GSM7852095,GSM7852096,GSM7852097,GSM7852098,GSM7852099,GSM7852100,GSM7852101,GSM7852102,GSM7852103,GSM7852104,GSM7852105,GSM7852106,GSM7852107,GSM7852108,GSM7852109,GSM7852110,GSM7852111,GSM7852112,GSM7852113,GSM7852114,GSM7852115,GSM7852116,GSM7852117,GSM7852118,GSM7852119,GSM7852120,GSM7852121,GSM7852122,GSM7852123,GSM7852124,GSM7852125,GSM7852126,GSM7852127,GSM7852128,GSM7852129,GSM7852130,GSM7852131,GSM7852132,GSM7852133,GSM7852134,GSM7852135,GSM7852136,GSM7852137,GSM7852138,GSM7852139,GSM7852140,GSM7852141,GSM7852142,GSM7852143,GSM7852144,GSM7852145,GSM7852146,GSM7852147,GSM7852148,GSM7852149,GSM7852150,GSM7852151,GSM7852152,GSM7852153,GSM7852154,GSM7852155,GSM7852156,GSM7852157,GSM7852158,GSM7852159,GSM7852160,GSM7852161,GSM7852162,GSM7852163,GSM7852164,GSM7852165,GSM7852166,GSM7852167,GSM7852168,GSM7852169,GSM7852170,GSM7852171,GSM7852172,GSM7852173,GSM7852174,GSM7852175,GSM7852176,GSM7852177,GSM7852178,GSM7852179,GSM7852180,GSM7852181,GSM7852182,GSM7852183,GSM7852184,GSM7852185,GSM7852186,GSM7852187,GSM7852188,GSM7852189,GSM7852190,GSM7852191
|
2 |
+
Bladder_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
p3/preprocess/Bladder_Cancer/clinical_data/GSE253531.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
,GSM8022612,GSM8022613,GSM8022614,GSM8022615,GSM8022616,GSM8022617,GSM8022618,GSM8022619,GSM8022620,GSM8022621,GSM8022622,GSM8022623,GSM8022624,GSM8022625,GSM8022626,GSM8022627,GSM8022628,GSM8022629,GSM8022630,GSM8022631,GSM8022632,GSM8022633,GSM8022634,GSM8022635,GSM8022636,GSM8022637,GSM8022638,GSM8022639,GSM8022640,GSM8022641,GSM8022642,GSM8022643,GSM8022644,GSM8022645,GSM8022646,GSM8022647,GSM8022648,GSM8022649,GSM8022650,GSM8022651,GSM8022652,GSM8022653,GSM8022654,GSM8022655,GSM8022656,GSM8022657,GSM8022658,GSM8022659,GSM8022660,GSM8022661,GSM8022662,GSM8022663,GSM8022664,GSM8022665
|
2 |
+
Bladder_Cancer,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
|
p3/preprocess/Bladder_Cancer/code/GSE138118.py
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bladder_Cancer"
|
6 |
+
cohort = "GSE138118"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bladder_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bladder_Cancer/GSE138118"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bladder_Cancer/GSE138118.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bladder_Cancer/gene_data/GSE138118.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bladder_Cancer/clinical_data/GSE138118.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bladder_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths
|
19 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Extract background info and clinical data
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file)
|
23 |
+
|
24 |
+
# Get unique values per clinical feature
|
25 |
+
sample_characteristics = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print background info
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(f"{background_info}\n")
|
30 |
+
|
31 |
+
# Print sample characteristics
|
32 |
+
print("Sample Characteristics:")
|
33 |
+
for feature, values in sample_characteristics.items():
|
34 |
+
print(f"Feature: {feature}")
|
35 |
+
print(f"Values: {values}\n")
|
36 |
+
# 1. Gene Expression Data Availability
|
37 |
+
is_gene_available = True # Based on the series title and summary, this is gene expression data from blood
|
38 |
+
|
39 |
+
# 2.1 Data Availability
|
40 |
+
trait_row = 0 # "stage at sample" contains cancer status
|
41 |
+
age_row = 1 # Age information is available
|
42 |
+
gender_row = None # Gender information is not available in the characteristics
|
43 |
+
|
44 |
+
# 2.2 Data Type Conversion Functions
|
45 |
+
def convert_trait(x):
|
46 |
+
if pd.isna(x):
|
47 |
+
return None
|
48 |
+
value = x.split(': ')[-1].strip()
|
49 |
+
# Convert to binary: Healthy=0, Any cancer stage=1
|
50 |
+
if value == 'Healthy':
|
51 |
+
return 0
|
52 |
+
elif value in ['G1', 'G2', 'G3', 'G1 pTa', 'G2 pTa']:
|
53 |
+
return 1
|
54 |
+
return None
|
55 |
+
|
56 |
+
def convert_age(x):
|
57 |
+
if pd.isna(x):
|
58 |
+
return None
|
59 |
+
value = x.split(': ')[-1].strip()
|
60 |
+
try:
|
61 |
+
# Convert to continuous numeric value
|
62 |
+
return float(value)
|
63 |
+
except:
|
64 |
+
return None
|
65 |
+
|
66 |
+
def convert_gender(x):
|
67 |
+
return None # Not used since gender data is not available
|
68 |
+
|
69 |
+
# 3. Save Initial Filtering Results
|
70 |
+
validate_and_save_cohort_info(
|
71 |
+
is_final=False,
|
72 |
+
cohort=cohort,
|
73 |
+
info_path=json_path,
|
74 |
+
is_gene_available=is_gene_available,
|
75 |
+
is_trait_available=trait_row is not None
|
76 |
+
)
|
77 |
+
|
78 |
+
# 4. Extract Clinical Features
|
79 |
+
clinical_df = geo_select_clinical_features(
|
80 |
+
clinical_df=clinical_data,
|
81 |
+
trait=trait,
|
82 |
+
trait_row=trait_row,
|
83 |
+
convert_trait=convert_trait,
|
84 |
+
age_row=age_row,
|
85 |
+
convert_age=convert_age
|
86 |
+
)
|
87 |
+
|
88 |
+
# Preview the processed clinical data
|
89 |
+
preview_result = preview_df(clinical_df)
|
90 |
+
print("Preview of processed clinical data:")
|
91 |
+
print(preview_result)
|
92 |
+
|
93 |
+
# Save clinical data
|
94 |
+
os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)
|
95 |
+
clinical_df.to_csv(out_clinical_data_file)
|
96 |
+
# Extract gene expression data from matrix file
|
97 |
+
gene_data = get_genetic_data(matrix_file)
|
98 |
+
|
99 |
+
# Print first 20 row IDs and shape of data to help debug
|
100 |
+
print("Shape of gene expression data:", gene_data.shape)
|
101 |
+
print("\nFirst few rows of data:")
|
102 |
+
print(gene_data.head())
|
103 |
+
print("\nFirst 20 gene/probe identifiers:")
|
104 |
+
print(gene_data.index[:20])
|
105 |
+
|
106 |
+
# Inspect a snippet of raw file to verify identifier format
|
107 |
+
import gzip
|
108 |
+
with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
|
109 |
+
lines = []
|
110 |
+
for i, line in enumerate(f):
|
111 |
+
if "!series_matrix_table_begin" in line:
|
112 |
+
# Get the next 5 lines after the marker
|
113 |
+
for _ in range(5):
|
114 |
+
lines.append(next(f).strip())
|
115 |
+
break
|
116 |
+
print("\nFirst few lines after matrix marker in raw file:")
|
117 |
+
for line in lines:
|
118 |
+
print(line)
|
119 |
+
# Observe the gene identifiers
|
120 |
+
# The identifiers are numeric strings starting with '16650', which appears to be probe IDs
|
121 |
+
# These are not standard human gene symbols and will need to be mapped
|
122 |
+
requires_gene_mapping = True
|
123 |
+
# Get file paths using library function
|
124 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
125 |
+
|
126 |
+
# Extract gene annotation from SOFT file
|
127 |
+
gene_annotation = get_gene_annotation(soft_file)
|
128 |
+
|
129 |
+
# Preview gene annotation data
|
130 |
+
print("Gene annotation columns and example values:")
|
131 |
+
print(preview_df(gene_annotation))
|
132 |
+
# Get gene mapping data from annotation
|
133 |
+
# For this dataset:
|
134 |
+
# ID column contains probe IDs matching gene expression data
|
135 |
+
# gene_assignment column contains gene symbols
|
136 |
+
mapping_df = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='gene_assignment')
|
137 |
+
|
138 |
+
# Apply gene mapping to convert probe expression to gene expression
|
139 |
+
# The apply_gene_mapping function handles many-to-many mappings
|
140 |
+
gene_data = apply_gene_mapping(gene_data, mapping_df)
|
141 |
+
|
142 |
+
# Preview data shape and first few rows
|
143 |
+
print("Shape of gene expression data:", gene_data.shape)
|
144 |
+
print("\nFirst few rows:")
|
145 |
+
print(gene_data.head())
|
146 |
+
# 1. Normalize gene symbols and save normalized gene data
|
147 |
+
gene_data.index = gene_data.index.str.replace('-mRNA', '')
|
148 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
149 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
150 |
+
gene_data.to_csv(out_gene_data_file)
|
151 |
+
|
152 |
+
# Load previously saved clinical data
|
153 |
+
clinical_df = pd.read_csv(out_clinical_data_file, index_col=0)
|
154 |
+
|
155 |
+
# 2. Link clinical and genetic data
|
156 |
+
linked_data = geo_link_clinical_genetic_data(clinical_df, gene_data)
|
157 |
+
|
158 |
+
# 3. Handle missing values
|
159 |
+
linked_data = handle_missing_values(linked_data, trait)
|
160 |
+
|
161 |
+
# 4. Check for biased features and remove them if needed
|
162 |
+
is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
163 |
+
|
164 |
+
# 5. Validate and save cohort info
|
165 |
+
is_usable = validate_and_save_cohort_info(
|
166 |
+
is_final=True,
|
167 |
+
cohort=cohort,
|
168 |
+
info_path=json_path,
|
169 |
+
is_gene_available=True,
|
170 |
+
is_trait_available=True,
|
171 |
+
is_biased=is_biased,
|
172 |
+
df=linked_data,
|
173 |
+
note="NanoString nCounter RNA profiling data for bladder cancer recurrence study"
|
174 |
+
)
|
175 |
+
|
176 |
+
# 6. Save linked data if usable
|
177 |
+
if is_usable:
|
178 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
179 |
+
linked_data.to_csv(out_data_file)
|
p3/preprocess/Bladder_Cancer/code/GSE145261.py
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Path Configuration
|
2 |
+
from tools.preprocess import *
|
3 |
+
|
4 |
+
# Processing context
|
5 |
+
trait = "Bladder_Cancer"
|
6 |
+
cohort = "GSE145261"
|
7 |
+
|
8 |
+
# Input paths
|
9 |
+
in_trait_dir = "../DATA/GEO/Bladder_Cancer"
|
10 |
+
in_cohort_dir = "../DATA/GEO/Bladder_Cancer/GSE145261"
|
11 |
+
|
12 |
+
# Output paths
|
13 |
+
out_data_file = "./output/preprocess/3/Bladder_Cancer/GSE145261.csv"
|
14 |
+
out_gene_data_file = "./output/preprocess/3/Bladder_Cancer/gene_data/GSE145261.csv"
|
15 |
+
out_clinical_data_file = "./output/preprocess/3/Bladder_Cancer/clinical_data/GSE145261.csv"
|
16 |
+
json_path = "./output/preprocess/3/Bladder_Cancer/cohort_info.json"
|
17 |
+
|
18 |
+
# Get file paths
|
19 |
+
soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)
|
20 |
+
|
21 |
+
# Extract background info and clinical data
|
22 |
+
background_info, clinical_data = get_background_and_clinical_data(matrix_file)
|
23 |
+
|
24 |
+
# Get unique values per clinical feature
|
25 |
+
sample_characteristics = get_unique_values_by_row(clinical_data)
|
26 |
+
|
27 |
+
# Print background info
|
28 |
+
print("Dataset Background Information:")
|
29 |
+
print(f"{background_info}\n")
|
30 |
+
|
31 |
+
# Print sample characteristics
|
32 |
+
print("Sample Characteristics:")
|
33 |
+
for feature, values in sample_characteristics.items():
|
34 |
+
print(f"Feature: {feature}")
|
35 |
+
print(f"Values: {values}\n")
|
36 |
+
# 1. Gene Expression Data Availability
|
37 |
+
is_gene_available = True # Based on context, this dataset studies carcinoma with molecular analysis
|
38 |
+
|
39 |
+
# 2. Variable Availability and Data Type Conversion
|
40 |
+
# 2.1 Row identification
|
41 |
+
trait_row = 3 # "tissue type" contains SCC vs UC info
|
42 |
+
age_row = 0 # "subject age" contains age info
|
43 |
+
gender_row = 1 # "subject gender" contains gender info
|
44 |
+
|
45 |
+
# 2.2 Conversion functions
|
46 |
+
def convert_trait(x):
|
47 |
+
# Binary: SCC (1) vs UC (0)
|
48 |
+
if not isinstance(x, str):
|
49 |
+
return None
|
50 |
+
x = x.lower()
|
51 |
+
if 'scc' in x or 'small cell' in x:
|
52 |
+
return 1
|
53 |
+
elif 'uc' in x or 'urothelial' in x:
|
54 |
+
return 0
|
55 |
+
return None
|
56 |
+
|
57 |
+
def convert_age(x):
|
58 |
+
# Continuous: extract age in years
|
59 |
+
if not isinstance(x, str):
|
60 |
+
return None
|
61 |
+
try:
|
62 |
+
age = int(''.join(filter(str.isdigit, x)))
|
63 |
+
if 0 <= age <= 120: # Basic age validation
|
64 |
+
return age
|
65 |
+
return None
|
66 |
+
except:
|
67 |
+
return None
|
68 |
+
|
69 |
+
def convert_gender(x):
|
70 |
+
# Binary: female (0) vs male (1)
|
71 |
+
if not isinstance(x, str):
|
72 |
+
return None
|
73 |
+
x = x.lower()
|
74 |
+
if 'female' in x:
|
75 |
+
return 0
|
76 |
+
elif 'male' in x:
|
77 |
+
return 1
|
78 |
+
return None
|
79 |
+
|
80 |
+
# 3. Save metadata
|
81 |
+
validate_and_save_cohort_info(
|
82 |
+
is_final=False,
|
83 |
+
cohort=cohort,
|
84 |
+
info_path=json_path,
|
85 |
+
is_gene_available=is_gene_available,
|
86 |
+
is_trait_available=trait_row is not None
|
87 |
+
)
|
88 |
+
|
89 |
+
# 4. Extract clinical features
|
90 |
+
if trait_row is not None:
|
91 |
+
selected_clinical_df = geo_select_clinical_features(
|
92 |
+
clinical_df=clinical_data,
|
93 |
+
trait=trait,
|
94 |
+
trait_row=trait_row,
|
95 |
+
convert_trait=convert_trait,
|
96 |
+
age_row=age_row,
|
97 |
+
convert_age=convert_age,
|
98 |
+
gender_row=gender_row,
|
99 |
+
convert_gender=convert_gender
|
100 |
+
)
|
101 |
+
|
102 |
+
# Preview the extracted features
|
103 |
+
preview_data = preview_df(selected_clinical_df)
|
104 |
+
print("Preview of extracted clinical features:", preview_data)
|
105 |
+
|
106 |
+
# Save to CSV
|
107 |
+
selected_clinical_df.to_csv(out_clinical_data_file)
|
108 |
+
# Extract gene expression data from matrix file
|
109 |
+
gene_data = get_genetic_data(matrix_file)
|
110 |
+
|
111 |
+
# Print first 20 row IDs and shape of data to help debug
|
112 |
+
print("Shape of gene expression data:", gene_data.shape)
|
113 |
+
print("\nFirst few rows of data:")
|
114 |
+
print(gene_data.head())
|
115 |
+
print("\nFirst 20 gene/probe identifiers:")
|
116 |
+
print(gene_data.index[:20])
|
117 |
+
|
118 |
+
# Inspect a snippet of raw file to verify identifier format
|
119 |
+
import gzip
|
120 |
+
with gzip.open(matrix_file, 'rt', encoding='utf-8') as f:
|
121 |
+
lines = []
|
122 |
+
for i, line in enumerate(f):
|
123 |
+
if "!series_matrix_table_begin" in line:
|
124 |
+
# Get the next 5 lines after the marker
|
125 |
+
for _ in range(5):
|
126 |
+
lines.append(next(f).strip())
|
127 |
+
break
|
128 |
+
print("\nFirst few lines after matrix marker in raw file:")
|
129 |
+
for line in lines:
|
130 |
+
print(line)
|
131 |
+
# These are Illumina probes (starting with ILMN_), not gene symbols
|
132 |
+
# We'll need to map them to human gene symbols for analysis
|
133 |
+
requires_gene_mapping = True
|
134 |
+
# Extract gene annotation from SOFT file using default prefixes
|
135 |
+
gene_annotation = get_gene_annotation(soft_file)
|
136 |
+
|
137 |
+
# Preview gene annotation data
|
138 |
+
print("Gene annotation shape:", gene_annotation.shape)
|
139 |
+
print("\nGene annotation columns and first few values:")
|
140 |
+
print(preview_df(gene_annotation))
|
141 |
+
|
142 |
+
# Also inspect the raw SOFT file annotation section to verify parsing
|
143 |
+
import gzip
|
144 |
+
with gzip.open(soft_file, 'rt') as f:
|
145 |
+
found_table = False
|
146 |
+
lines = []
|
147 |
+
for line in f:
|
148 |
+
if '!platform_table_begin' in line.lower():
|
149 |
+
found_table = True
|
150 |
+
lines.append(next(f)) # Get header line
|
151 |
+
for _ in range(3): # Get first 3 data lines
|
152 |
+
lines.append(next(f))
|
153 |
+
break
|
154 |
+
|
155 |
+
if found_table:
|
156 |
+
print("\nRaw annotation format in SOFT file:")
|
157 |
+
for line in lines:
|
158 |
+
print(line.strip())
|
159 |
+
# Extract gene mapping from annotation
|
160 |
+
# 'ID' column contains probe IDs (ILMN_*) matching the gene expression data
|
161 |
+
# 'Symbol' column contains gene symbols we want to map to
|
162 |
+
gene_mapping = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='Symbol')
|
163 |
+
|
164 |
+
# Apply gene mapping to convert probe-level data to gene-level data
|
165 |
+
gene_data = apply_gene_mapping(gene_data, gene_mapping)
|
166 |
+
|
167 |
+
# Print info about the conversion
|
168 |
+
print("Shape of mapped gene expression data:", gene_data.shape)
|
169 |
+
print("\nFirst few rows of mapped gene expression data:")
|
170 |
+
print(gene_data.head())
|
171 |
+
# 1. Normalize gene symbols and save normalized gene data
|
172 |
+
gene_data.index = gene_data.index.str.replace('-mRNA', '')
|
173 |
+
gene_data = normalize_gene_symbols_in_index(gene_data)
|
174 |
+
os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)
|
175 |
+
gene_data.to_csv(out_gene_data_file)
|
176 |
+
|
177 |
+
# 2. Link clinical and genetic data
|
178 |
+
linked_data = geo_link_clinical_genetic_data(selected_clinical_df, gene_data)
|
179 |
+
|
180 |
+
# 3. Handle missing values
|
181 |
+
linked_data = handle_missing_values(linked_data, trait)
|
182 |
+
|
183 |
+
# 4. Check for biased features and remove them if needed
|
184 |
+
is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)
|
185 |
+
|
186 |
+
# 5. Validate and save cohort info
|
187 |
+
is_usable = validate_and_save_cohort_info(
|
188 |
+
is_final=True,
|
189 |
+
cohort=cohort,
|
190 |
+
info_path=json_path,
|
191 |
+
is_gene_available=True,
|
192 |
+
is_trait_available=True,
|
193 |
+
is_biased=is_biased,
|
194 |
+
df=linked_data,
|
195 |
+
note="NanoString nCounter RNA profiling data for bladder cancer recurrence study"
|
196 |
+
)
|
197 |
+
|
198 |
+
# 6. Save linked data if usable
|
199 |
+
if is_usable:
|
200 |
+
os.makedirs(os.path.dirname(out_data_file), exist_ok=True)
|
201 |
+
linked_data.to_csv(out_data_file)
|