Skip to content

Commit

Permalink
Fix #146 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Jul 9, 2019
1 parent 53b88c9 commit db3599e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Mikado/configuration/daijin_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,29 @@ def create_daijin_config(args, level="ERROR", piped=False):

config["mikado"]["modes"] = args.modes

for method in args.asm_methods:
config["asm_methods"][method] = [""]
failed = False
if config["short_reads"]["r1"] and not args.aligners:
logger.critical(
"No short read aligner selected, but there are short read samples. Please select at least one alignment method.")
failed = True
if config["short_reads"]["r1"] and not args.asm_methods:
logger.critical(
"No short read assembler selected, but there are short read samples. Please select at least one assembly method.")
failed = True
if config["long_reads"]["files"] and not args.long_aln_methods:
logger.critical(
"No long read aligner selected, but there are long read samples. Please select at least one assembly method.")
failed = True

if failed:
sys.exit(1)

for method in args.aligners:
config["align_methods"][method] = [""]
for method in args.asm_methods:
config["asm_methods"][method] = [""]
for method in args.long_aln_methods:
config["long_read_align_methods"][method] = [""]

# Set and eventually copy the scoring file.
if args.scoring is not None:
Expand Down
3 changes: 3 additions & 0 deletions Mikado/daijin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def create_config_parser():
help="Strandedness of the reads. Specify it 0, 1, or number of samples times. Choices: %(choices)s.")
parser.add_argument("-al", "--aligners", choices=["gsnap", "star", "hisat", "tophat"], required=False,
default=[], nargs="*", help="Aligner(s) to use for the analysis. Choices: %(choices)s")
parser.add_argument("-lal", "--long-read-aligners", dest="long_aln_methods", choices=["star", "gmap"],
required=False, default=[], nargs="*",
help="Aligner(s) to use for long reads. Choices: %(choices)s")
parser.add_argument("-as", "--assemblers", dest="asm_methods", required=False,
choices=["class", "cufflinks", "stringtie", "trinity", "scallop"],
default=[], nargs="*", help="Assembler(s) to use for the analysis. Choices: %(choices)s")
Expand Down
1 change: 1 addition & 0 deletions Mikado/subprograms/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def create_config(args):
namespace.samples = []
namespace.strandedness = []
namespace.asm_methods = []
namespace.long_aln_methods = []
namespace.aligners = []
if args.mode is not None:
namespace.modes = args.mode[:]
Expand Down
1 change: 1 addition & 0 deletions Mikado/tests/test_system_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@ def test_daijin_config(self):
namespace.threads = 1
namespace.full = False
namespace.seed = None
namespace.long_aln_methods = []

for iteration in range(20):
with self.subTest(iteration=iteration):
Expand Down

0 comments on commit db3599e

Please sign in to comment.