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

multigather only saves first match to CSV #2321

Closed
ctb opened this issue Oct 10, 2022 · 0 comments · Fixed by #2322
Closed

multigather only saves first match to CSV #2321

ctb opened this issue Oct 10, 2022 · 0 comments · Fixed by #2322

Comments

@ctb
Copy link
Contributor

ctb commented Oct 10, 2022

when running:

sourmash multigather --query SRR606249-abund-10k.sig.zip --db out.txt -k 31 --threshold-bp=0

the resulting file SRR606249.trim.fq.gz.csv (which is based on the query signature filename property... ugh) only contains the first result.

this code is at fault in commands.py::multigather:

            w = None
            with FileOutputCSV(output_csv) as fp:
                for result in found:
                    if w is None:
                        w = result.init_dictwriter(fp)
                        result.write(w)

where the last line should be deindented so that it is run every time through the loop.

@ctb ctb closed this as completed in #2322 Oct 14, 2022
ctb added a commit that referenced this issue Oct 14, 2022
…2322)

This PR fixes #2321 so that more than one output line is placed in the
CSV. Oops!

It also adds a notification of what the CSV output file name is.

Last but not least, it supports `--output-dir` as a way to set the base
path for all output files.

Fixes #2321.

TODO:

- [x] add tests
- [x] make sure filename output behavior is documented
- [x] consider adding an option to have multigather save CSV results in
some other way, like by md5 or ...something. - punted to
#2328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant