Closed sage-wright closed 1 year ago
Hello!
I came across a Python parsing error when running parse_mykrobe_predict.py on a S. Sonnei sample with less than 90% coverage.
parse_mykrobe_predict.py
The particular error was as follows:
final_results.to_csv(args.prefix + "_predictResults.tsv", index=False, sep="\t", columns=["genome", "species", "final genotype", "name", "confidence", "num QRDR", "parC_S80I", "gyrA_S83L", "gyrA_S83A", "gyrA_D87G", "gyrA_D87N", "gyrA_D87Y", "lowest support for genotype marker", "poorly supported markers", "max support for additional markers", "additional markers", "node support"]) ... [more python traceback messages] ... KeyError: "['species', 'lowest support for genotype marker'] not in index"
I was able to track this down to line 237: https://github.com/katholt/sonneityping/blob/b4ba875257b63f7544eeac037f921914ee238704/parse_mykrobe_predict.py#L237 where 'lowest support for genotype marker' is misspelt as 'lowest supprot'. In addition, 'species' is not included as a column in the data frame which causes the second additional parsing error.
'lowest support for genotype marker'
'lowest supprot'
'species'
I also noticed that a similar parsing error would occur in line 229 since 'species' is also not included as a column in the data frame: https://github.com/katholt/sonneityping/blob/b4ba875257b63f7544eeac037f921914ee238704/parse_mykrobe_predict.py#L229
I have made a PR (#7) that addresses this problem, but I thought I would create an issue as well in case another person runs into a similar problem and checks here first.
Thank you so much!
Thanks for picking this up! I have merged your pull request :)
Hello!
I came across a Python parsing error when running
parse_mykrobe_predict.py
on a S. Sonnei sample with less than 90% coverage.The particular error was as follows:
I was able to track this down to line 237: https://github.com/katholt/sonneityping/blob/b4ba875257b63f7544eeac037f921914ee238704/parse_mykrobe_predict.py#L237 where
'lowest support for genotype marker'
is misspelt as'lowest supprot'
. In addition,'species'
is not included as a column in the data frame which causes the second additional parsing error.I also noticed that a similar parsing error would occur in line 229 since
'species'
is also not included as a column in the data frame: https://github.com/katholt/sonneityping/blob/b4ba875257b63f7544eeac037f921914ee238704/parse_mykrobe_predict.py#L229I have made a PR (#7) that addresses this problem, but I thought I would create an issue as well in case another person runs into a similar problem and checks here first.
Thank you so much!