Thanks for the script, it is very useful. But I still have one more issue to resolve. I generated the json file with my dataset but now the problem is with handling data.
L1,L2,L3,L4,L5,GENE_NAME
Enzyme,Kinase,Protein Kinase,Ser_Thr,Cmgc,MAPK11
Enzyme,Kinase,Protein Kinase,Tyr,Tk,ABL1
Enzyme,Kinase,Protein Kinase,Tyr,Tk,PDGFRB
Enzyme,Kinase,Protein Kinase,Tyr,Tk,PDGFRA
Enzyme,Kinase,Protein Kinase,Ser_Thr,Tkl,ALK
Enzyme,Isomerase,Isomerase Other,,,gyrB
Enzyme,Oxidoreductase,Oxidoreductase Other,,,ALOX5
Enzyme,Oxidoreductase,Oxidoreductase Other,,,IMPDH1
Enzyme,Transferase,Transferase Other,,,COMT
Enzyme,Oxidoreductase,Oxidoreductase Other,,,RRM1
Enzyme,Oxidoreductase,Oxidoreductase Other,,,PTGS2
Enzyme,Lyase,Lyase Other,,,POLB
Enzyme,Lyase,Lyase Other,,,CA5B
Enzyme,Hydrolase,Hydrolase Other,,,GAA
Enzyme,Protease,Metallo,MAM,M10A,MMP8
Enzyme,Lyase,Lyase Other,,,CA5A
Enzyme,Lyase,Lyase Other,,,CA7
As you can see from the data, there are few blank cells in the data set. Which means that L1, L2, L3, GENE_NAME are mandatory fields and L4, L5 instances are not mandatory (may be present or may not be). For instance for a data point when there is no data in L4, L5 the json which I get will be 2 blank quotes. This should be handled and removed.
"Cytosolic other": {
"Cytosolic other": {
"": {
"": {
"MCL1": 1,
"TNNC1": 1
}
}
}
},
"Structural": {
"Structural Other": {
"": {
"": {
"TUBA3C": 1,
"TUBB8": 1,
"TUBB4B": 1,
"TUBB4A": 1,
"TUBB3": 1,
"TUBB": 1,
"TUBA4A": 1,
"TUBB1": 2
}
}
}
}
}
Could you help me out in handling these data. Much appreciated help. Cheers!


