Commit 70d3ac7f authored by van den Berg's avatar van den Berg
Browse files

Write stats to stdout by default

This is also the default behaviour in master. This change restores
the default behaviour, while still preserving the option to write
the stats json directly to a file by specifying --stats.
parent 5b51b794
......@@ -154,10 +154,10 @@ Options:
called multiple times [required]
-ps, --positive-samples TEXT Sample(s) in positive-vcf to consider. May be
called multiple times [required]
-s, --stats PATH Path to output stats json file [required]
-s, --stats PATH Path to output stats json file
-dc, --discordant PATH Path to output discordant VCF file
--help Show this message and exit
--help Show this message and exit.
## License
......@@ -32,7 +32,7 @@ from .gcoverage import RefRecord, region_coverages
"May be called multiple times",
@click.option("-s", "--stats", type=click.Path(writable=True),
help="Path to output stats json file", required=True)
help="Path to output stats json file", default='-')
@click.option("-dc", "--discordant", type=click.Path(writable=True),
help="Path to output discordant VCF file",
......@@ -43,12 +43,12 @@ def evaluate_cli(call_vcf, positive_vcf, call_samples, positive_samples, stats,
st, disc = site_concordancy(c_vcf, p_vcf, call_samples,
# Write the stats json file
with open(stats, 'w') as fout:
with click.open_file(stats, 'w') as fout:
print(json.dumps(st), file=fout)
# If specified, write the discordant variants
if discordant:
with open(discordant, 'w') as fout:
with click.open_file(discordant, 'w') as fout:
for record in disc:
print(record, file=fout, end='')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment