Skip to content

Commit 4c0be04

Browse files
committed
move ignore-bx to workflow controls, add it as an option to qc
1 parent 31379c9 commit 4c0be04

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

harpy/align.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ def align():
3333
"harpy align bwa": [
3434
{
3535
"name": "Parameters",
36-
"options": ["--extra-params", "--genome", "--ignore-bx", "--keep-unmapped", "--molecule-distance", "--min-quality"],
36+
"options": ["--extra-params", "--genome", "--keep-unmapped", "--molecule-distance", "--min-quality"],
3737
},
3838
{
3939
"name": "Workflow Controls",
40-
"options": ["--container", "--contigs", "--depth-window", "--hpc", "--output-dir", "--quiet", "--skip-reports", "--snakemake", "--threads", "--help"],
40+
"options": ["--container", "--contigs", "--depth-window", "--hpc", "--ignore-bx", "--output-dir", "--quiet", "--skip-reports", "--snakemake", "--threads", "--help"],
4141
},
4242
],
4343
"harpy align ema": [
@@ -53,11 +53,11 @@ def align():
5353
"harpy align strobe": [
5454
{
5555
"name": "Parameters",
56-
"options": ["--extra-params", "--genome", "--ignore-bx", "--keep-unmapped", "--molecule-distance", "--min-quality", "--read-length"],
56+
"options": ["--extra-params", "--genome", "--keep-unmapped", "--molecule-distance", "--min-quality", "--read-length"],
5757
},
5858
{
5959
"name": "Workflow Controls",
60-
"options": ["--container", "--contigs", "--depth-window", "--hpc", "--output-dir", "--quiet", "--skip-reports", "--snakemake", "--threads", "--help"],
60+
"options": ["--container", "--contigs", "--depth-window", "--hpc", "--ignore-bx", "--output-dir", "--quiet", "--skip-reports", "--snakemake", "--threads", "--help"],
6161
},
6262
]
6363
}
@@ -66,7 +66,6 @@ def align():
6666
@click.option('-g', '--genome', type=InputFile("fasta", gzip_ok = True), required = True, help = 'Genome assembly for read mapping')
6767
@click.option('-w', '--depth-window', default = 50000, show_default = True, type = int, help = 'Interval size (in bp) for depth stats')
6868
@click.option('-x', '--extra-params', type = BwaParams(), help = 'Additional bwa mem parameters, in quotes')
69-
@click.option('-i', '--ignore-bx', is_flag = True, default = False, help = 'Ignore parts of the workflow specific to linked-read sequences')
7069
@click.option('-u', '--keep-unmapped', is_flag = True, default = False, help = 'Retain unmapped sequences in the output')
7170
@click.option('-q', '--min-quality', default = 30, show_default = True, type = click.IntRange(min = 0, max = 40), help = 'Minimum mapping quality to pass filtering')
7271
@click.option('-d', '--molecule-distance', default = 100000, show_default = True, type = click.IntRange(min = 0, max_open = True), help = 'Distance cutoff to split molecules (bp)')
@@ -76,6 +75,7 @@ def align():
7675
@click.option('--contigs', type = ContigList(), help = 'File or list of contigs to plot')
7776
@click.option('--setup-only', is_flag = True, hidden = True, default = False, help = 'Setup the workflow and exit')
7877
@click.option('--hpc', type = HPCProfile(), help = 'Directory with HPC submission `config.yaml` file')
78+
@click.option('--ignore-bx', is_flag = True, default = False, help = 'Ignore parts of the workflow specific to linked-read sequences')
7979
@click.option('--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
8080
@click.option('--skip-reports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
8181
@click.option('--snakemake', type = SnakemakeParams(), help = 'Additional Snakemake parameters, in quotes')
@@ -264,7 +264,6 @@ def ema(inputs, output_dir, platform, barcode_list, fragment_density, genome, de
264264
@click.option('-g', '--genome', type=InputFile("fasta", gzip_ok = True), required = True, help = 'Genome assembly for read mapping')
265265
@click.option('-w', '--depth-window', default = 50000, show_default = True, type = int, help = 'Interval size (in bp) for depth stats')
266266
@click.option('-x', '--extra-params', type = StrobeAlignParams(), help = 'Additional aligner parameters, in quotes')
267-
@click.option('-i', '--ignore-bx', is_flag = True, default = False, help = 'Ignore parts of the workflow specific to linked-read sequences')
268267
@click.option('-u', '--keep-unmapped', is_flag = True, default = False, help = 'Retain unmapped sequences in the output')
269268
@click.option('-q', '--min-quality', default = 30, show_default = True, type = click.IntRange(min = 0, max = 40), help = 'Minimum mapping quality to pass filtering')
270269
@click.option('-d', '--molecule-distance', default = 100000, show_default = True, type = click.IntRange(min = 0, max_open = True), help = 'Distance cutoff to split molecules (bp)')
@@ -275,6 +274,7 @@ def ema(inputs, output_dir, platform, barcode_list, fragment_density, genome, de
275274
@click.option('--container', is_flag = True, default = False, help = 'Use a container instead of conda')
276275
@click.option('--setup-only', is_flag = True, hidden = True, default = False, help = 'Setup the workflow and exit')
277276
@click.option('--hpc', type = HPCProfile(), help = 'Directory with HPC submission `config.yaml` file')
277+
@click.option('--ignore-bx', is_flag = True, default = False, help = 'Ignore parts of the workflow specific to linked-read sequences')
278278
@click.option('--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
279279
@click.option('--skip-reports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
280280
@click.option('--snakemake', type = SnakemakeParams(), help = 'Additional Snakemake parameters, in quotes')

harpy/qc.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"name": "Workflow Controls",
24-
"options": ["--container", "--hpc", "--output-dir", "--quiet", "--skip-reports", "--snakemake", "--threads", "--help"],
24+
"options": ["--container", "--hpc", "--ignore-bx", "--output-dir", "--quiet", "--skip-reports", "--snakemake", "--threads", "--help"],
2525
},
2626
]
2727
}
@@ -38,11 +38,12 @@
3838
@click.option('--container', is_flag = True, default = False, help = 'Use a container instead of conda')
3939
@click.option('--setup-only', is_flag = True, hidden = True, show_default = True, default = False, help = 'Setup the workflow and exit')
4040
@click.option('--hpc', type = HPCProfile(), help = 'Directory with HPC submission `config.yaml` file')
41+
@click.option('--ignore-bx', is_flag = True, default = False, help = 'Ignore parts of the workflow specific to linked-read sequences')
4142
@click.option('--quiet', is_flag = True, default = False, help = 'Don\'t show output text while running')
4243
@click.option('--skip-reports', is_flag = True, default = False, help = 'Don\'t generate HTML reports')
4344
@click.option('--snakemake', type = SnakemakeParams(), help = 'Additional Snakemake parameters, in quotes')
4445
@click.argument('inputs', required=True, type=click.Path(exists=True, readable=True), nargs=-1)
45-
def qc(inputs, output_dir, min_length, max_length, trim_adapters, deduplicate, deconvolve, extra_params, threads, snakemake, skip_reports, quiet, hpc, container, setup_only):
46+
def qc(inputs, output_dir, min_length, max_length, trim_adapters, deduplicate, deconvolve, extra_params, ignore_bx, threads, snakemake, skip_reports, quiet, hpc, container, setup_only):
4647
"""
4748
Remove adapters and quality-control sequences
4849
@@ -92,6 +93,7 @@ def qc(inputs, output_dir, min_length, max_length, trim_adapters, deduplicate, d
9293
"workflow" : "qc",
9394
"snakemake_log" : sm_log,
9495
"output_directory" : output_dir,
96+
"ignore_bx" : ignore_bx,
9597
"trim_adapters" : trim_adapters,
9698
"deduplicate" : deduplicate,
9799
"min_len" : min_length,

harpy/snakefiles/qc.smk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ envdir = os.path.join(os.getcwd(), outdir, "workflow", "envs")
1919
min_len = config["min_len"]
2020
max_len = config["max_len"]
2121
extra = config.get("extra", "")
22+
ignore_bx = config["ignore_bx"]
2223
trim_adapters = config.get("trim_adapters", None)
2324
dedup = config["deduplicate"]
2425
deconvolve = config.get("deconvolve", False)
@@ -195,7 +196,7 @@ rule workflow_summary:
195196
default_target: True
196197
input:
197198
fq = collect(outdir + "/{sample}.{FR}.fq.gz", FR = ["R1", "R2"], sample = samplenames),
198-
bx_report = outdir + "/reports/barcode.summary.html" if not skip_reports else [],
199+
bx_report = outdir + "/reports/barcode.summary.html" if not skip_reports and not ignore_bx else [],
199200
agg_report = outdir + "/reports/qc.report.html" if not skip_reports else []
200201
params:
201202
minlen = f"--length_required {min_len}",

0 commit comments

Comments
 (0)