Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hamronize summarize - local variable 'parsed_report' reference before assignment #66

Closed
cimendes opened this issue Oct 12, 2021 · 3 comments
Labels
bug Something isn't working p1

Comments

@cimendes
Copy link
Member

Describe the bug
Summarize function failed when no genes were present in the input files. This should be caught and handled by summarize function.

@cimendes cimendes added the bug Something isn't working label Oct 12, 2021
@cimendes cimendes added the p1 label Jan 4, 2022
@gdemoro
Copy link

gdemoro commented Sep 16, 2022

this bug is still present in the latest version (1.0.4)

@jfy133
Copy link

jfy133 commented Sep 20, 2022

I would like to report the same issue, which is a problem for pipelines when we try to automate a lot of these. We are using hAMRonization heavily (because it's an awesome tool, thank you for it!) in nf-core/funcscan, but when testing this in a large pipeline run with ~126 samples, it caused the whole pipeline to fail due to this error.

The actual error arguably comes from the upstream per-tool subcommands, which produce 'nonsense' output of a single ]

Example, for abrigate output:

$ cat ABM006-megahit.txt
#FILE	SEQUENCE	START	END	STRAND	GENE	COVERAGE	COVERAGE_MAP	GAPS	%COVERAGE	%IDENTITY	DATABASE	ACCESSION	PRODUCT	RESISTANCE
$ hamronize \
    abricate \
    ABM006-megahit.txt \
     \
    --format json \
    --analysis_software_version 1.0.1 \
    --reference_database_version 2021-Mar-27 \
    > ABM006-megahit.txt.abricate.json
$ cat ABM006-megahit.txt.abricate.json 
]

So from a pipeline perspective, alternatively, it would also work at pipeline levels to have the check/failure at the tool specific subcommand. If it could produce an error message and a exit code other than 0 or 1, it would allow us to 'ignore' if the tool-level command fails.

fmaguire added a commit that referenced this issue Sep 25, 2022
- Addresses #66
- Enable parsing empty individual tool reports into valid json/tsv
- Enable summarize of empty individual reports (json + tsv)
- Add tests for generation of empty hamronized reports
- Add tests for generation of summaries with empty reports
- Add tests for generation of summaries from mix of json and tsv
@fmaguire
Copy link
Member

Sorry about the delay, didn't realise people were actually running into this issue in the wild!
This should now work as intended (release to follow imminently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1
Projects
None yet
Development

No branches or pull requests

4 participants