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

Command descriptions mangled in --help output #1576

Closed
tsibley opened this issue Aug 13, 2024 · 2 comments
Closed

Command descriptions mangled in --help output #1576

tsibley opened this issue Aug 13, 2024 · 2 comments

Comments

@tsibley
Copy link
Member

tsibley commented Aug 13, 2024

Several commands describe themselves in their module docstring, which they provide to the argparse parser as their description. However, the argparse formatter configuration mangles these descriptions into one big paragraph, making them less readable. To pick the first example I saw, consider augur ancestral's docstring

"""
Infer ancestral sequences based on a tree.
The ancestral sequences are inferred using `TreeTime <https://academic.oup.com/ve/article/4/1/vex042/4794731>`_.
Each internal node gets assigned a nucleotide sequence that maximizes a
likelihood on the tree given its descendants and its parent node.
Each node then gets assigned a list of nucleotide mutations for any position
that has a mismatch between its own sequence and its parent's sequence.
The node sequences and mutations are output to a node-data JSON file.
If amino acid options are provided, the ancestral amino acid sequences for each
requested gene are inferred with the same method as the nucleotide sequences described above.
The inferred amino acid mutations will be included in the output node-data JSON
file, with the format equivalent to the output of `augur translate`.
The nucleotide and amino acid sequences are inferred separately in this command,
which can potentially result in mismatches between the nucleotide and amino
acid mutations. If you want amino acid mutations based on the inferred
nucleotide sequences, please use `augur translate`.
.. note::
The mutation positions in the node-data JSON are one-based.
"""

vs. its --help output:

$ augur ancestral --help
usage: augur ancestral [-h] --tree TREE [--alignment ALIGNMENT]             
                       [--vcf-reference FASTA | --root-sequence FASTA/GenBank]
                       [--inference {joint,marginal}]                                          
                       [--keep-ambiguous | --infer-ambiguous]                                  
                       [--keep-overhangs] [--annotation ANNOTATION]      
                       [--genes GENES [GENES ...]]
                       [--translations TRANSLATIONS]                                           
                       [--output-node-data OUTPUT_NODE_DATA]
                       [--output-sequences OUTPUT_SEQUENCES]          
                       [--output-translations OUTPUT_TRANSLATIONS]
                       [--output-vcf OUTPUT_VCF]
                       [--validation-mode {error,warn,skip}]                                   
                                                                                               
Infer ancestral sequences based on a tree. The ancestral sequences are                         
inferred using `TreeTime                                                                       
<https://academic.oup.com/ve/article/4/1/vex042/4794731>`_. Each internal node
gets assigned a nucleotide sequence that maximizes a likelihood on the tree   
given its descendants and its parent node. Each node then gets assigned a list
of nucleotide mutations for any position that has a mismatch between its own                   
sequence and its parent's sequence. The node sequences and mutations are    
output to a node-data JSON file. If amino acid options are provided, the
ancestral amino acid sequences for each requested gene are inferred with the
same method as the nucleotide sequences described above. The inferred amino
acid mutations will be included in the output node-data JSON file, with the
format equivalent to the output of `augur translate`. The nucleotide and amino
acid sequences are inferred separately in this command, which can potentially
result in mismatches between the nucleotide and amino acid mutations. If you
want amino acid mutations based on the inferred nucleotide sequences, please
use `augur translate`. .. note:: The mutation positions in the node-data JSON
are one-based.

@jameshadfield
Copy link
Member

Isn't this #313?

@tsibley
Copy link
Member Author

tsibley commented Aug 13, 2024

Doh, yes.

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

No branches or pull requests

2 participants