Commit cfd0cdac authored by van den Berg's avatar van den Berg
Browse files

Remove code to calculate vcf stats

parent d51305c4
......@@ -57,7 +57,6 @@ set_default('female_threshold', 0.6)
set_default("covstats", "src/covstats.py")
set_default("collect_stats", "src/collect_stats.py")
set_default("merge_stats", "src/merge_stats.py")
set_default("fastq_stats", "src/fastqc_stats.py")
set_default("stats_to_tsv", "src/stats_to_tsv.py")
set_default("py_wordcount", "src/pywc.py")
set_default("collect_metrics", "src/collect_metrics.py")
......@@ -125,7 +124,6 @@ rule all:
metrics_json = "metrics.json",
metrics_tsv = "metrics.tsv",
coverage_stats = coverage_stats,
#covstat_png=expand("{sample}/coverage/covstats.png", sample=settings['samples'])
rule create_markdup_tmp:
......@@ -413,19 +411,6 @@ rule vtools_coverage:
shell: "vtools-gcoverage -I {input.gvcf} -R {input.ref} > {output.tsv}"
## vcfstats
rule vcfstats:
"""Calculate vcf statistics"""
input:
vcf="{sample}/vcf/{sample}.vcf.gz",
tbi = "{sample}/vcf/{sample}.vcf.gz.tbi"
output:
stats="{sampel}/vcf/{sample}.vcfstats.json"
singularity: containers["vtools"]
shell: "vtools-stats -i {input.vcf} > {output.stats}"
# collection
if "bedfile" in settings:
rule collectstats:
......@@ -501,12 +486,11 @@ rule merge_stats:
"""Merge all stats of all samples"""
input:
cols=expand("{sample}/{sample}.stats.json", sample=settings['samples']),
vstat=expand("{sample}/vcf/{sample}.vcfstats.json", sample=settings['samples']),
mpy=settings["merge_stats"]
output:
stats="stats.json"
singularity: containers["vtools"]
shell: "python {input.mpy} --vcfstats {input.vstat} --collectstats {input.cols} "
shell: "python {input.mpy} --collectstats {input.cols} "
"> {output.stats}"
......
......@@ -31,14 +31,12 @@ def parse_json(path):
return json.load(handle)
def main(vcfstats, collectstats):
def main(collectstats):
data = dict()
data["sample_stats"] = list()
for vcf, stats in zip(vcfstats, collectstats):
v = parse_json(vcf)
for stats in collectstats:
cs = parse_json(stats)
cs['vcfstats'] = v
data["sample_stats"].append(cs)
print(json.dumps(data))
......@@ -46,14 +44,9 @@ def main(vcfstats, collectstats):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--vcfstats',
nargs='+',
required=True,
help='Path to the vcfstats json for each sample')
parser.add_argument('--collectstats',
nargs='+',
required=True,
help='Path to the collected stats for each sample')
args = parser.parse_args()
assert len(args.vcfstats) == len(args.collectstats)
main(args.vcfstats, args.collectstats)
main(args.collectstats)
......@@ -72,8 +72,6 @@ if __name__ == "__main__":
sdicts = []
#vcfstats = orig_dict['multisample_vcfstats']
for sample in orig_dict['sample_stats']:
sname = sample['sample_name']
sample_dict = OrderedDict()
......@@ -88,7 +86,6 @@ if __name__ == "__main__":
"usable_reads": sample['n_usable_reads'],
"usable_bases": sample['n_usable_bases'],
})
#sample_dict.update(get_vcf_stats(sname, vcfstats))
if "covstats" in sample:
for cov_d in sample['covstats']:
sample_dict.update(get_covstats(cov_d))
......
Supports Markdown
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