-
Notifications
You must be signed in to change notification settings - Fork 577
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
Add long options to samtools view
#1442
Conversation
Looks good in the main. I'm not sure if I like |
I was pretty unimpressed that I couldn't come up with anything better than
Let's all mull those ones over for a while… |
I think
Hmmm… what for that last something… There is something to be said for the symmetry of |
It's hard! The double negative in the language is bad enough: "Only include in output reads that have any of the FLAGs in INT not present". I had to think hard for a while. Firstly "not present" is better expressed as "absent", and secondly the double negative may be better expressed as a positive. I think it's the difference in language that is If we got rid of that fixed sentence start, we may write:
If we wish to start everything with the same sentence, then maybe flip the initial sentence to filter-out instead of filter-in, as that feels more natural to "filter" to me anyway. Ie "Filtering options (exclude from output reads that ...)"
|
I had it as “absent” but felt that it was too easy for the eye to skip over the half-a-word difference from the other lines without noticing. I'll call this a vote (and I'm inclined to agree) for the status quo:
|
Compatibility with mpileup is good, but I note it has also reversed the filtering language to describe what to skip, rather than what to keep. Also I wouldn't be averse to changing mpileup's description if we come up with something better, but changing long-opts is obviously not good unless we add aliases. That does mean of course It just feels odd that we have a long-opt |
That phrasing was introduced by you in 8b779df. The
That Anyway, that mostly unchanged usage phrasing is not the major problem here. The thing that's holding this PR up is what words to choose for |
This comment has been minimized.
This comment has been minimized.
My choice would still be for |
Rebased now that #1441 has been merged. Still no final epiphany on the last couple of long options, and the new |
Just to get things moving, how about --reject-all-flags? |
... or we could remove the long opt for |
Yep, happy to do that just to get this moving. With |
Yes, probably. |
Actually, it may be best to leave all of
so it's probably best to avoid adding another variant for now. We can make a follow-up pull request to try to unify them, as much as we can. |
I think the situation is not as irregular as all that:
I had previously categorised only
So I think adding Need to decide whether to add them as verbs ( (I can never remember which option I want to use and have to look it up each time. What I would really like to have for this is to come up with some [Aug 2022 due to #1702: Edited to add the hilariously irregular Footnotes
|
Reading over the existing filtering long options in other subcommands, I think actually the simpler verb form for these is generally the way to go. So for your consideration, I've pushed a version of this that adds Hopefully this may be suitable for merging and then we can try to approach cross-subcommand nirvana later (Note that GNU |
I guess we can live with |
D'oh. Thanks. |
Categorise view options in usage, similarly to mpileup's usage. Add long options to man page. Reword -m description in usage based on man page and implementation. Add new samtools view --no-header option to restore the default behaviour after -h/-H and for symmetry with bcftools view.
Add region query long options with similar names to those used by bcftools. --target[s]-file is an alias for -L, and for simplicity implement --region[s]-file as equivalent to -M -L FILE. Document accordingly, and move the existing -M description to a new -? note.
Now that there is a way to set a fraction without simultaneously setting the seed, mention the default seed ("[0]"). Fixes samtools#217.
Make these recently added option names follow the same convention as the new --require/--excl[ude]-flags options.
[Another PR that's been gestating for rather too long…]
This adds long option equivalents for all of
view
's command-line options. The added expressiveness of the long names I think clarifies some of the usage explanations (while staying within 80 characters!).It also adds
‑‑region-file
and‑‑regions-file
as synonyms for the-M -L
combination. Along with the‑‑target-file
/‑‑targets-file
long forms for plain-L
, this meanssamtools view
has the same long options for jump-to-region and stream-filtering-by-region as bcftools. And hopefully highlighting‑‑region-file
as an option will help raise the visibility of-M
.Also
-s
subsampling is split into two long options, thus finally fixing #217.Proposed usage display: