Skip to content

Commit

Permalink
Amending docs and CLI (for #270)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Apr 15, 2020
1 parent e57aa8a commit f6ea9a1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Mikado/preparation/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def prepare(args, logger):

if not args.json_conf["prepare"]["files"]["keep_redundant"]:
args.json_conf["prepare"]["files"]["keep_redundant"] = (
[getattr(args, "keep_redundant", False)] * len(args.json_conf["prepare"]["files"]["gff"]))
[getattr(args, "keep_redundant", True)] * len(args.json_conf["prepare"]["files"]["gff"]))

shelve_names = [path_join(args.json_conf["prepare"]["files"]["output_dir"],
"mikado_shelf_{}.db".format(str(_).zfill(5))) for _ in
Expand Down
11 changes: 6 additions & 5 deletions Mikado/subprograms/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,12 @@ def configure_parser():
default=False, action="store_true")
files.add_argument("--gff", help="Input GFF/GTF file(s), separated by comma", type=str,
default="")
files.add_argument("--list",
help="""Tab-delimited file containing rows with the following format:
<file> <label> <strandedness> <score(optional)> <is_reference(optional)> <always_keep(optional)
strandedness, is_reference and always_keep must be boolean values (True, False)
score must be a valid floating number.""")
files.add_argument("--list", type=argparse.FileType("r"),
help="""Tab-delimited file containing rows with the following format:
<file> <label> <strandedness(def. False)> <score(optional, def. 0)> <is_reference(optional, def. False)> <keep_redundant(optional, def. True)>
strandedness, is_reference and keep_redundant must be boolean values (True, False)
score must be a valid floating number.
""")
parser.add_argument("--reference", help="Fasta genomic reference.", default=None)
serialisers = parser.add_argument_group(
"Options related to the serialisation step")
Expand Down
7 changes: 4 additions & 3 deletions Mikado/subprograms/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ def positive(string):
help="Comma-delimited list of strand specific assemblies.")
parser.add_argument("--list", type=argparse.FileType("r"),
help="""Tab-delimited file containing rows with the following format:
<file> <label> <strandedness> <score(optional)> <is_reference(optional)> <always_keep(optional)
strandedness, is_reference and always_keep must be boolean values (True, False)
<file> <label> <strandedness, def. False> <score(optional, def. 0)> <is_reference(optional, def. False)> <keep_redundant(optional, def. True)>
strandedness, is_reference and keep_redundant must be boolean values (True, False)
score must be a valid floating number.
""")
parser.add_argument("-l", "--log", type=argparse.FileType("w"), default=None,
Expand Down Expand Up @@ -311,7 +311,8 @@ def positive(string):
help="Configuration file.")
parser.add_argument("-k", "--keep-redundant", default=None,
dest="keep_redundant", action="store_true",
help="Boolean flag. If invoked, Mikado prepare will retain redundant models.")
help="Boolean flag. If invoked, Mikado prepare will retain redundant models,\
ignoring the per-sample instructions.")
parser.add_argument("--seed", type=int, default=None,
help="Random seed number.")
parser.add_argument("gff", help="Input GFF/GTF file(s).", nargs="*")
Expand Down
2 changes: 1 addition & 1 deletion Mikado/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def parse_list_file(json_conf: dict, list_file):
score = 0
json_conf["prepare"]["files"]["source_score"][label] = score
keep = False
for arr, pos, default in [("reference", 4, False), ("keep_redundant", 5, False)]:
for arr, pos, default in [("reference", 4, False), ("keep_redundant", 5, True)]:
try:
val = fields[pos]
if val.lower() in ("false", "true"):
Expand Down
6 changes: 4 additions & 2 deletions docs/Usage/Configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ Usage:
--no-files Remove all files-specific options from the printed configuration file.
Invoking the "--gff" option will disable this flag.
--gff GFF Input GFF/GTF file(s), separated by comma
--list LIST Tab-delimited file containing rows with the following format
<file> <label> <strandedness> <score(optional)> <always_keep(optional)>
--list LIST Tab-delimited file containing rows with the following format:
<file> <label> <strandedness, def. False> <score(optional, def. 0)> <is_reference(optional, def. False)> <keep_redundant(optional, def. True)>
strandedness, is_reference and keep_redundant must be boolean values (True, False)
score must be a valid floating number.
--reference REFERENCE
Fasta genomic reference.
--strand-specific-assemblies STRAND_SPECIFIC_ASSEMBLIES
Expand Down
6 changes: 4 additions & 2 deletions docs/Usage/Prepare.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ Command line usage:
strand.
-sa STRAND_SPECIFIC_ASSEMBLIES, --strand-specific-assemblies STRAND_SPECIFIC_ASSEMBLIES
Comma-delimited list of strand specific assemblies.
--list LIST Tab-delimited file containing rows with the following
format <file> <label> <strandedness>
--list LIST Tab-delimited file containing rows with the following format:
<file> <label> <strandedness, def. False> <score(optional, def. 0)> <is_reference(optional, def. False)> <keep_redundant(optional, def. True)>
strandedness, is_reference and keep_redundant must be boolean values (True, False)
score must be a valid floating number.
-l LOG, --log LOG Log file. Optional.
--lenient Flag. If set, transcripts with only non-canonical
splices will be output as well.
Expand Down

0 comments on commit f6ea9a1

Please sign in to comment.