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

sketch ... --name is not documented in CLI help #3152

Closed
mr-eyes opened this issue May 12, 2024 · 1 comment · Fixed by #3162
Closed

sketch ... --name is not documented in CLI help #3152

mr-eyes opened this issue May 12, 2024 · 1 comment · Fixed by #3162

Comments

@mr-eyes
Copy link
Member

mr-eyes commented May 12, 2024

sourmash sketch dna --help, does not have --name parameter to give a specific name to the signature. Probably with other sketching modes.

@ctb
Copy link
Contributor

ctb commented May 12, 2024

well, sort of? -h shows:

File handling options:
  -f, --force           recompute signatures even if the file exists
  -o OUTPUT, --output OUTPUT
                        output computed signatures to this file
  --merge FILE, --name FILE
                        merge all input files into one signature file with the
                        specified name

it's caused confusion in the past as well, so maybe we can improve things, but it is there :)

It's also in the sourmash sketch docs -

First, you can use --name/--merge to build
a single (named) sketch out of multiple input files:

sourmash sketch dna -p k=31 sample_R1.fq.gz sample_R2.fq.gz \
    --name "sample" -o sample.zip

Here you need to specify a name because sourmash does not pick a default
name when given multiple files; you also need to provide an output file
name because sourmash doesn't pick a default output name in this situation.

Second, you can stream the input files into sourmash sketch via stdin:

gunzip -c sample_R?.fq.gz | sourmash sketch dna -p k=31 - \
    -o sample.zip

As above, you need to specify an output filename because sourmash
can't guess a good default for streaming input. The --name option
can still be specified if you want to name the output sketch something
other than -.

Thoughts as to how to improve things -

  • we could put --name before --merge in the argparse output;
  • we could add a section in the sourmash sketch docs that is explicitly about naming sketches;
  • we could also add something to the internals document talking about how signature names are output by the sourmash CLI;

@ctb ctb closed this as completed in #3162 Jun 4, 2024
ctb added a commit that referenced this issue Jun 4, 2024
**Note:** PR into #3161 

This PR cleans up and regularizes naming output on `sig` subcommands.
Specifically, it:

- [x] adds `--set-name` to `sig intersect` and `sig subtract` to set
names on output signatures.
- [x] confirms and tests default names for output from `sig inflate`,
`sig filter`, `sig downsample`, and `sig flatten`
- [x] updates documentation appropriately
- [x] aliases `--name` to `--set-name` on `sig merge`, and nominates
`--name` for deprecation and removal on v5
- [x] nominates `--name` on `sig extract`, `sig filter`, and `sig
flatten` for deprecation and removal on v5
- [x] highlights `--name` on `sketch dna`, `sketch protein`, and `sketch
translate` - ref #3152

Fixes #1801
Fixes #3152

Related issues:
* #3173

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

2 participants