@@ -29,37 +29,36 @@ USAGE:
29
29
$ metamorph <command> [OPTIONS]
30
30
31
31
EXAMPLES:
32
- co-assembly dna-only:
33
- $ metamorph run --coa --input *.R?.fastq.gz --output output
34
- $ metamorph run -C --input *.R?.fastq.gz --output output
35
-
36
- per-sample assembly dna-only:
37
- $ metamorph run --input *.R?.fastq.gz --output output
38
-
39
- co-assembly rna & dna:
40
- $ metamorph run --coa --input *.R?.fastq.gz --rna rna/*.R?.fastq.gz --output output
41
- $ metamorph run -C --input *.R?.fastq.gz --rna rna/*.R?.fastq.gz --output output
42
-
43
- per-sample assembly rna & dna:
44
- $ metamorph run --input *.R?.fastq.gz --rna rna/*.R?.fastq.gz --output output
45
- """
32
+ dna-only:
33
+ $ metamorph run --input <sample_sheet> --output <output_dir>
34
+ sample sheet:
35
+ ________
36
+ | DNA |
37
+ | -------
38
+ pair1 | path |
39
+ pair2 | path |
40
+ --------
41
+
42
+ rna & dna:
43
+ $ metamorph run --input <sample_sheet> --output <output_dir>
44
+ sample sheet:
45
+ ________________
46
+ | DNA | RNA |
47
+ |---------------|
48
+ pair1 | path | path |
49
+ pair2 | path | path |
50
+ ---------------
51
+ """
46
52
from __future__ import print_function
47
53
from datetime import timezone , datetime
48
54
import argparse , sys , os , subprocess , json , textwrap
49
55
50
56
51
57
# Local imports
52
58
from src import version
53
- from src .run import init , setup , bind , dryrun , runner , valid_input
54
- from src .utils import (
55
- Colors ,
56
- err ,
57
- exists ,
58
- fatal ,
59
- check_cache ,
60
- require ,
61
- permissions
62
- )
59
+ from src .run import init , setup , bind , dryrun , runner
60
+ from src .utils import Colors , err , exists , fatal , check_cache , require , \
61
+ permissions , valid_trigger , valid_input
63
62
64
63
65
64
# Pipeline Metadata
@@ -156,7 +155,6 @@ def run(sub_args):
156
155
config = config
157
156
)
158
157
config ['bindpaths' ] = bindpaths
159
- config ['coassembly' ] = False
160
158
161
159
# Step 4b. Setup assembly mode
162
160
# modes: 0 - megahit + metaspades assembly
@@ -190,6 +188,7 @@ def run(sub_args):
190
188
if 'databases' in config :
191
189
bindpaths .extend ([mount ['from' ]+ ':' + mount ['to' ]+ ':' + mount ['mode' ] for mount in config ['databases' ]])
192
190
191
+ triggers = sub_args .triggers if sub_args .triggers else None
193
192
mjob = runner (mode = sub_args .mode ,
194
193
outdir = sub_args .output ,
195
194
alt_cache = sub_args .singularity_cache ,
@@ -199,6 +198,7 @@ def run(sub_args):
199
198
logger = logfh ,
200
199
additional_bind_paths = "," .join (bindpaths ),
201
200
tmp_dir = sub_args .tmp_dir ,
201
+ triggers = triggers
202
202
)
203
203
204
204
# Step 6. Wait for subprocess to complete,
@@ -391,7 +391,7 @@ def parsed_arguments(name, description):
391
391
module load singularity snakemake
392
392
393
393
# Step 2A.) Dry-run the pipeline
394
- ./{0} run --input .tests/*.R?.fastq.gz \\
394
+ ./{0} run --input <sample_sheet> \\
395
395
--output /data/$USER/output \\
396
396
--mode slurm \\
397
397
--dry-run
@@ -400,30 +400,36 @@ def parsed_arguments(name, description):
400
400
# The slurm mode will submit jobs to
401
401
# the cluster. It is recommended running
402
402
# the pipeline in this mode.
403
- ./{0} run --input .tests/*.R?.fastq.gz \\
403
+ ./{0} run --input <sample_sheet> \\
404
404
--output /data/$USER/output \\
405
405
--mode slurm
406
406
407
407
# Step 3B.) Run the {0} pipeline in co-assembly fashion
408
408
# with slurm
409
- ./{0} run --coa -- input .tests/*.R?.fastq.gz \\
409
+ ./{0} run --input .tests/*.R?.fastq.gz \\
410
410
--output /data/$USER/output \\
411
411
--mode slurm
412
412
413
413
{2}{3}EXAMPLES:{4}
414
- co-assembly dna-only:
415
- $ metamorph run --coa --input *.R?.fastq.gz --output output
416
- $ metamorph run -C --input *.R?.fastq.gz --output output
417
-
418
- per-sample assembly dna-only:
419
- $ metamorph run --input *.R?.fastq.gz --output output
420
-
421
- co-assembly rna & dna:
422
- $ metamorph run --coa --input *.R?.fastq.gz --rna rna/*.R?.fastq.gz --output output
423
- $ metamorph run -C --input *.R?.fastq.gz --rna rna/*.R?.fastq.gz --output output
424
-
425
- per-sample assembly rna & dna:
426
- $ metamorph run --input *.R?.fastq.gz --rna rna/*.R?.fastq.gz --output output
414
+ dna-only:
415
+ $ metamorph run --input <sample_sheet> --output <output_dir>
416
+ sample sheet:
417
+ ________
418
+ | DNA |
419
+ | -------
420
+ pair1 | path |
421
+ pair2 | path |
422
+ --------
423
+
424
+ rna & dna:
425
+ $ metamorph run --input <sample_sheet> --output <output_dir>
426
+ sample sheet:
427
+ ________________
428
+ | DNA | RNA |
429
+ |---------------|
430
+ pair1 | path | path |
431
+ pair2 | path | path |
432
+ ---------------
427
433
428
434
429
435
{2}{3}VERSION:{4}
@@ -466,9 +472,6 @@ def parsed_arguments(name, description):
466
472
action = 'help' ,
467
473
help = argparse .SUPPRESS
468
474
)
469
-
470
- # Analysis options
471
- # ... add here
472
475
473
476
# Orchestration Options
474
477
# Execution Method, run locally
@@ -492,6 +495,16 @@ def parsed_arguments(name, description):
492
495
help = argparse .SUPPRESS
493
496
)
494
497
498
+ # Snakemake rerun triggers
499
+ subparser_run .add_argument (
500
+ '-t' , '--triggers' ,
501
+ type = valid_trigger ,
502
+ required = False ,
503
+ default = None ,
504
+ nargs = "*" ,
505
+ help = argparse .SUPPRESS
506
+ )
507
+
495
508
# Dry-run
496
509
# Do not execute the workflow,
497
510
# prints what steps remain
@@ -744,7 +757,6 @@ def parsed_arguments(name, description):
744
757
745
758
746
759
def main ():
747
-
748
760
# Sanity check for usage
749
761
if len (sys .argv ) == 1 :
750
762
# Nothing was provided
0 commit comments