From 51eb6db99836fb07c185b8542b19cfad53259b1a Mon Sep 17 00:00:00 2001 From: Redmar van den Berg <RedmarvandenBerg@lumc.nl> Date: Tue, 22 Oct 2019 11:26:05 +0200 Subject: [PATCH] Do not use '-' as a stand in for stdout --- vtools/cli.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vtools/cli.py b/vtools/cli.py index 7f95ef9..ac5c023 100644 --- a/vtools/cli.py +++ b/vtools/cli.py @@ -32,7 +32,7 @@ from .gcoverage import RefRecord, region_coverages "May be called multiple times", required=True) @click.option("-s", "--stats", type=click.Path(writable=True), - help="Path to output stats json file", default='-') + help="Path to output stats json file") @click.option("-dc", "--discordant", type=click.Path(writable=True), help="Path to output discordant VCF file", required=False) @@ -47,8 +47,11 @@ def evaluate_cli(call_vcf, positive_vcf, call_samples, positive_samples, st, disc = site_concordancy(c_vcf, p_vcf, call_samples, positive_samples, min_qual, min_depth) # Write the stats json file - with click.open_file(stats, 'w') as fout: - print(json.dumps(st), file=fout) + if stats is None: + print(json.dumps(st)) + else: + with click.open_file(stats, 'w') as fout: + print(json.dumps(st), file=fout) # If specified, write the discordant variants if discordant: -- GitLab