pha4ge / hAMRonization

Parse multiple Antimicrobial Resistance Analysis Reports into a common data structure
GNU Lesser General Public License v3.0
138 stars 27 forks source link

help understanding resfinder run #57

Closed ewissel closed 3 years ago

ewissel commented 3 years ago

Hi devs, I'm trying to run hamronize on some results I generated from the latest resfinder docker image. Here is the command I am trying to run:

hamronize resfinder resfinder/resfinder/results/ResFinder_results_tab.txt  --reference_database_version db_v_1 --analysis_software_version tool_v_1 --output hamr_out/resfinder_out.tsv  

I get the following error:

Traceback (most recent call last):
  File "/home/ewissel/miniconda3/bin/hamronize", line 8, in <module>
    sys.exit(main())
  File "/home/ewissel/miniconda3/lib/python3.7/site-packages/hAMRonization/hamronize.py", line 7, in main
    hAMRonization.Interfaces.generic_cli_interface()
  File "/home/ewissel/miniconda3/lib/python3.7/site-packages/hAMRonization/Interfaces.py", line 275, in generic_cli_interface
    output_format=args.format)
  File "/home/ewissel/miniconda3/lib/python3.7/site-packages/hAMRonization/Interfaces.py", line 115, in write
    first_result = next(self)
  File "/home/ewissel/miniconda3/lib/python3.7/site-packages/hAMRonization/Interfaces.py", line 75, in __next__
    return next(self.hAMRonized_results)
  File "/home/ewissel/miniconda3/lib/python3.7/site-packages/hAMRonization/ResFinderIO.py", line 48, in parse
    report = json.load(handle)
  File "/home/ewissel/miniconda3/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/home/ewissel/miniconda3/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/home/ewissel/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/ewissel/miniconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The only json produced by my resfinder run is the std_format_under_development.json, and I don't think hamronize is indicating it wants to use this file over the resfinder results table. Is this an issue with my resfinder run (hamronize expects resfinder to produce different jsons), an issue with my input arguments, or something else?

fmaguire commented 3 years ago

Use hamronize resfinder4 for resfinder v4. The output file and format changed a lot between v3 and v4 so they are separate parsers within hamronization.

hamronize --help (and the README) list examples of the input files used for each parser, if you are still unsure you can look at the test files: https://github.com/pha4ge/hAMRonization/tree/master/test/dummy to look at the exact output file format expected for each tool's parser.

To maximise utility of your output try and use accurate values in the additional metadata supplied e.g., the actual resfinder database version used in --reference_database_version and the actual resfinder tool version in --analysis_software_version