Skip to content

Commit

Permalink
Update argument defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
rafelafrance committed Mar 12, 2021
1 parent 7804fcd commit 8febbed
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 42 deletions.
29 changes: 15 additions & 14 deletions atram.py
Expand Up @@ -71,12 +71,12 @@ def parse_command_line():
group.add_argument(
'-a', '--assembler', default='none',
choices=['abyss', 'trinity', 'velvet', 'spades', 'none'],
help="""Which assembler to use. Choosing "none" (the default) will do
a single blast run and stop before any assembly.""")
help="""Which assembler to use. Choosing "none" will do a single blast run
and stop before any assembly. (default %(default)s)""")

group.add_argument(
'-i', '--iterations', type=int, default=5, metavar='N',
help="""The number of pipeline iterations. The default is "5".""")
help="""The number of pipeline iterations. (default %(default)s)""")

group = parser.add_argument_group('optional arguments')

Expand All @@ -87,8 +87,8 @@ def parse_command_line():

group.add_argument(
'--fraction', type=float, default=1.0,
help="""Use only the specified fraction of the aTRAM database. The
default is 1.0.""")
help="""Use only the specified fraction of the aTRAM database.
(default %(default)s)""")

cpus = min(10, os.cpu_count() - 4 if os.cpu_count() > 4 else 1)
group.add_argument(
Expand All @@ -102,8 +102,8 @@ def parse_command_line():
'--log-level', choices=['debug', 'info', 'error', 'fatal'],
default='info',
help="""Log messages of the given level (or above). 'debug' shows the
most messages and 'fatal' shows the least. The default is
'info'""")
most messages and 'fatal' shows the least.
(default %(default)s)""")

group.add_argument(
'--path',
Expand All @@ -123,8 +123,8 @@ def parse_command_line():
group.add_argument(
'-T', '--timeout', metavar='SECONDS', default=600, type=int,
help="""How many seconds to wait for an assembler or BLAST before
stopping the run. To wait forever set this to 0. The default
is "600" (10 minutes).""")
stopping the run. To wait forever set this to 0.
(default %(default)s)""")

group = parser.add_argument_group(
'optional values for filtering contigs')
Expand All @@ -136,14 +136,15 @@ def parse_command_line():

group.add_argument(
'--bit-score', type=float, default=70.0, metavar='SCORE',
help="""Remove contigs that have a value less than this. The default
is "70.0". This is turned off by the --no-filter argument.""")
help="""Remove contigs that have a value less than this.
(default %(default)s) This is turned off by the
--no-filter argument.""")

group.add_argument(
'--contig-length', '--length', type=int, default=100,
help="""Remove blast hits that are shorter than this length. The
default is "100". This is turned off by the --no-filter argument.
""")
help="""Remove blast hits that are shorter than this length.
(default %(default)s) This is turned off by the
--no-filter argument.""")

blast.command_line_args(parser)
assembly.command_line_args(parser)
Expand Down
14 changes: 7 additions & 7 deletions atram_framer.py
Expand Up @@ -43,8 +43,8 @@ def parse_command_line():

parser.add_argument(
'-m', '--min-length', metavar='LENGTH', default=100, type=int,
help="""Remove contigs that are less than this length. The default is
100.""")
help="""Remove contigs that are less than this length.
(default %(default)s)""")

parser.add_argument(
'-t', '--temp-dir', metavar='DIR',
Expand All @@ -61,8 +61,8 @@ def parse_command_line():
'--log-level', choices=['debug', 'info', 'error', 'fatal'],
default='info',
help="""Log messages of the given level (or above). 'debug' shows the
most messages and 'fatal' shows the least. The default is
'info'""")
most messages and 'fatal' shows the least.
(default %(default)s)""")

parser.add_argument(
'-o', '--output-prefix',
Expand All @@ -76,8 +76,8 @@ def parse_command_line():
help="""Use this to filter files in the assemblies directory. For
example '*filtered*.fasta' will select all fasta files in the
assemblies directory with the word filtered in them. The default
is to select all fasta files in the assemblies directory
'*.fasta'.""")
is to select all fasta files in the assemblies directory.
(default %(default)s)""")

parser.add_argument(
'--reference-name', action='store_true',
Expand All @@ -89,7 +89,7 @@ def parse_command_line():
parser.add_argument(
'--long-contig', type=float, default=0.7,
help="""A long contig is considered to be this fraction [0-1] of the
longest contig assembled by exonerate. The default is 0.7.""")
longest contig assembled by exonerate. (default %(default)s)""")

args = parser.parse_args()

Expand Down
10 changes: 5 additions & 5 deletions atram_preprocessor.py
Expand Up @@ -87,14 +87,14 @@ def parse_command_line():
'-b', '--blast-db', '--db', default=blast_db, metavar='DB',
help="""This is the prefix of all of the blast database files. So you
can identify different blast database sets. You may include a
directory as part of the prefix. The default is "{}".
directory as part of the prefix. (default %(default)s)
""".format(blast_db))

cpus = min(10, os.cpu_count() - 4 if os.cpu_count() > 4 else 1)
group.add_argument(
'--cpus', '--processes', '--max-processes', type=int, default=cpus,
help="""Number of CPU threads to use. On this machine the default is
("{}")""".format(cpus))
help="""Number of CPU threads to use. (default %(default)s)
""".format(cpus))

group.add_argument(
'-t', '--temp-dir', metavar='DIR',
Expand All @@ -111,8 +111,8 @@ def parse_command_line():
'--log-level', choices=['debug', 'info', 'error', 'fatal'],
default='info',
help="""Log messages of the given level (or above). 'debug' shows the
most messages and 'fatal' shows the least. The default is
'info'""")
most messages and 'fatal' shows the least.
(default %(default)s)""")

group.add_argument(
'-s', '--shards', '--number', type=int, metavar='SHARDS',
Expand Down
12 changes: 6 additions & 6 deletions atram_stitcher.py
Expand Up @@ -45,7 +45,7 @@ def parse_command_line():
parser.add_argument(
'-O', '--overlap', type=int, default=10,
help="""Contigs must overlap by this many codons before it is
considered a real overlap.""")
considered a real overlap. (default %(default)s)""")

parser.add_argument(
'-t', '--temp-dir', metavar='DIR',
Expand All @@ -62,13 +62,13 @@ def parse_command_line():
'--log-level', choices=['debug', 'info', 'error', 'fatal'],
default='info',
help="""Log messages of the given level (or above). 'debug' shows the
most messages and 'fatal' shows the least. The default is
'info'""")
most messages and 'fatal' shows the least.
(default %(default)s)""")

parser.add_argument(
'-i', '--iterations', type=int, default=2, metavar='N',
help="""The number of times to run the main stitcher loop. This
must be either 1 or 2, the default is 2.""")
must be either 1 or 2. (default %(default)s)""")

parser.add_argument(
'-o', '--output-prefix',
Expand All @@ -82,8 +82,8 @@ def parse_command_line():
help="""Use this to filter files in the assemblies directory. For
example '*filtered*.fasta' will select all fasta files in the
assemblies directory with the word filtered in them. The default
is to select all fasta files in the assemblies directory
'*.fasta'.""")
is to select all fasta files in the assemblies directory.
(default %(default)s)""")

parser.add_argument(
'--reference-name', action='store_true',
Expand Down
2 changes: 1 addition & 1 deletion lib/assemblers/abyss.py
Expand Up @@ -75,7 +75,7 @@ def command_line_args(parser):

group.add_argument(
'--abyss-kmer', type=int, default=64,
help="""k-mer size. I passes k=<int> (default 64).""")
help="""k-mer size. It passes k=<int>. (default %(default)s)""")

group.add_argument(
'--abyss-np', type=int,
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblers/spades.py
Expand Up @@ -64,7 +64,7 @@ def command_line_args(parser):
group.add_argument(
'--spades-threads', type=int, default=cpus,
help="""Number of threads to use.
Default will use {} threads.""".format(cpus))
(default %(default)s)""".format(cpus))

total_mem = psutil.virtual_memory().available >> 30
max_mem = max(1.0, total_mem >> 1)
Expand All @@ -84,7 +84,7 @@ def command_line_args(parser):
'--spades-cov-cutoff', default='off',
help="""Read coverage cutoff value. Must be a positive float value,
or "auto", or "off". It passes --cov-cutoff
<keyword or int>.""")
<keyword or int>. (default %(default)s)""")

@staticmethod
def validate_cov_cutoff(log, cov_cutoff):
Expand Down
10 changes: 5 additions & 5 deletions lib/assemblers/velvet.py
Expand Up @@ -73,19 +73,19 @@ def command_line_args(parser):

group.add_argument(
'--velvet-kmer', type=int, default=31,
help="""k-mer size (default 31).""")
help="""k-mer size. ((default %(default)s)""")

group.add_argument(
'--velvet-exp-cov', type=int, default=30,
help="""The expected coverage of the region. -exp_cov <int>
(default 30).""")
help="""The expected coverage of the region. -exp_cov <int>.
((default %(default)s)""")

group.add_argument(
'--velvet-ins-length', type=int, default=300,
help="""The size of the fragments used in the short-read library.
-ins_length <int> (default 300).""")
-ins_length <int>. ((default %(default)s)""")

group.add_argument(
'--velvet-min-contig-lgth', type=int, default=100,
help="""The minimum contig length used by the assembler itself.
-min_contig_lgth <int> (default is 100).""")
-min_contig_lgth <int>. ((default %(default)s)""")
4 changes: 2 additions & 2 deletions lib/blast.py
Expand Up @@ -134,10 +134,10 @@ def command_line_args(parser):
group.add_argument('--blast-db-gencode', '--db-gencode', type=int,
default=1, metavar='CODE',
help="""The genetic code to use during blast runs.
The default is "1".""")
(default %(default)s)""")

group.add_argument('--blast-evalue', '--evalue', type=float, default=1e-10,
help="""The default evalue is "1e-10".""")
help="""(default %(default)s)""")

group.add_argument('--blast-word-size', '--word-size', type=int,
help="""Word size for wordfinder algorithm.
Expand Down

0 comments on commit 8febbed

Please sign in to comment.