OpenGene / GeneFuse

Gene fusion detection and visualization
MIT License
114 stars 62 forks source link

JSON output corrupted due to a not escaped double-quotes character #39

Open FrancescaMiccolis opened 1 year ago

FrancescaMiccolis commented 1 year ago

I'm using genefuse JSON output to handle fusions information in order to prioritize them, so I'm using a Python script to read the JSON file. Sometimes the JSON output is corrupted because in the "qual" value of each read it could be used the double-quotes symbol. For example: "reads":[ { "break":33, "strand":"reversed", "seq":"TTTTTTATAGGATTTGGGAAGGTAATGGAAAATTCCAGTCAAAGGGGGTTGTTCTCTGGTGGGCAGGGGCGGGGGTCACAAGGTGCTCAGTGGGGGAG", "qual":"9.B>?<5:=B94ACABA;BA@79B>B?6@A?@BB"@=<@:A=9@ABB>BB>B>?B.@A6BB?@>?@@B?7AAB>=<B=AA@A7B@:?<A9AA@@?=??" },

When genefuse writes the JSON file the double-quotes is not escaped, so trying to read the JSON file cause an error. At the moment I'm avoiding the problem using a regex pattern to manipulate the JSON file and make it correct. I hope there's a way to update the construction of the JSON output in order to add the escape slash before double-quotes in "qual" value.

Tina610 commented 1 year ago

I also encountered a situation where the value of the json file contained double quotes,"json.decoder.JSONDecodeError: Expecting ',' delimiter:"。The generated json output format is incorrect