iqbal-lab / Mykrobe-predictor

Antibiotic resistance predictions in minutes on a laptop
Other
50 stars 19 forks source link

Staph generated JSON is missing a comma after called_variants; #19

Closed iqbal-lab closed 9 years ago

iqbal-lab commented 9 years ago

At commit f778d86c63943c1e94a812cb111ab6f318d914b6

e.g.

"called_variants" :{ "gyrA_S84L" :{ "R_per_cov": "100", "S_per_cov": "0", "R_median_cov": "101", "S_median_cov": "0", "induced_resistance": "Ciprofloxacin" } } <—— NEED A COMMA HERE "called_genes" :{

Phelimb commented 9 years ago

This was introduced in f778d86c63943c1e94a812cb111ab6f318d914b6

print_json_called_variants_end(false); prints a comma print_json_called_variants_end(true); doesn't

What was the reason for changing false - > true

iqbal-lab commented 9 years ago

Ah that was me. I remember thinking it was clever of me changing that. I think it's because I was removing the timestamp printing at the end, so something that used to be in the middle (needing a comma) was now at the end (not needing one). Or that was the rationale.

iqbal-lab commented 9 years ago

Actually, this bug fix creates a new problem

Hi Zam

Unfortunately it is still not generating valid JSON. There is now an extra comma, this stops the app from reading the data.

I appreciate that this is annoying.

Simon

{ "expected_depth": "65", "phylogenetics": { "species": { "M. Tuberculosis": "Major" }, "lineage": { "European/American": "Major" } }, "susceptibility" :{ "rifampicin": "S", "isoniazid": "S", "pyrazinamide": "S", "ethambutol": "R", "kanamycin": "S", "capreomycin": "S", "amikacin": "S", "kanamycin": "S", "streptomycin": "S", "quinolones": "R" }, "called_variants" :{ "embB_M306X" :{ "R_per_cov": "100", "S_per_cov": "0", "R_median_cov": "74", "S_median_cov": "0", "induced_resistance": "Ethambutol" }, "gyrA_D94X" :{ "R_per_cov": "100", "S_per_cov": "0", "R_median_cov": "78", "S_median_cov": "0", "induced_resistance": "Quinolones" } }, <——— extraneous comma }