Skip to content

Commit 4d1c173

Browse files
committed
Initial rework of subcommands and help text
1 parent c52c21d commit 4d1c173

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

newmap/main.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
# Defaults for mappability output
2424
DEFAULT_KMER_SIZE = 24
2525

26+
INDEX_SUBCOMMAND = "index"
27+
UNIQUE_LENGTHS_SUBCOMMAND = "search"
28+
GENERATE_MAPPABILITY_SUBCOMMAND = "track"
29+
2630

2731
def parse_subcommands():
2832
parser = ArgumentParser(
@@ -35,16 +39,16 @@ def parse_subcommands():
3539
version=f"%(prog)s {__version__}")
3640

3741
subparsers = parser.add_subparsers(
38-
title="Newmap subcommands",
39-
description="Valid subcommands",
40-
help="see --help on each command for additional information",
42+
title="To generate mappability data, the following subcommands must "
43+
"be run in order",
44+
metavar="",
4145
required=True)
4246

4347
# Create a subparser for the "generate-index" command
4448
generate_index_parser = subparsers.add_parser(
45-
"generate-index",
46-
description="Generate a FM index from a fasta "
47-
"file")
49+
INDEX_SUBCOMMAND,
50+
help="Create an FM index from a "
51+
"sequence to generate mappability data for.")
4852
generate_index_parser.set_defaults(func=generate_index.main)
4953

5054
# TODO: Consider changing to -i and -o for input and output
@@ -81,11 +85,10 @@ def parse_subcommands():
8185

8286
# Create a subparser for the "unique-lengths" command
8387
unique_length_parser = subparsers.add_parser(
84-
"unique-lengths",
85-
description="Creates a binary file with the "
86-
"shortest unique k-mer length at each "
87-
"sequence position from the range of "
88-
"k-mer lengths given")
88+
UNIQUE_LENGTHS_SUBCOMMAND,
89+
help="Finds the shortest unique sequence length "
90+
"at each position in the input fasta file. "
91+
"Saves the results to a binary array.")
8992

9093
unique_length_parser.set_defaults(func=unique_counts.main)
9194

@@ -130,7 +133,7 @@ def parse_subcommands():
130133
default=DEFAULT_KMER_BATCH_SIZE,
131134
type=int,
132135
help="Maximum number of kmers to batch per reference sequence from "
133-
"given fasta file. "
136+
"input fasta file. "
134137
"Use to control memory usage. "
135138
"Default is {}".format(DEFAULT_KMER_BATCH_SIZE))
136139

@@ -148,9 +151,9 @@ def parse_subcommands():
148151

149152
# Create a subparser for the "generate-mappability" command
150153
generate_mappability_parser = subparsers.add_parser(
151-
"generate-mappability",
152-
description="Converts unique kmer length files to mappability "
153-
"file output")
154+
GENERATE_MAPPABILITY_SUBCOMMAND,
155+
help="Converts a binary array of unique sequence length files to "
156+
"mappability file output(s) for a given length")
154157

155158
generate_mappability_parser.set_defaults(
156159
func=unique_counts_conversion.main)

0 commit comments

Comments
 (0)