Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cnvpytor cluster resources #1083

Merged
merged 6 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BALSAMIC/assets/scripts/edit_vcf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def edit_vcf_info(input_vcf, output_vcf, variant_caller):

new_vcf = Writer(output_vcf, vcf)

with gzip.open(output_vcf, "wb"):
with open(output_vcf, "wb"):
for variant in vcf:
variant.INFO["FOUND_IN"] = variant_caller + "|" + output_vcf
new_vcf.write_record(variant)
Expand Down
2 changes: 1 addition & 1 deletion BALSAMIC/config/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
"time": "12:00:00",
"n": 24
},
"cnvpytor_sv_tumor_normal": {
"cnvpytor_tumor_only": {
"time": "05:00:00",
"n": 24
},
Expand Down
8 changes: 4 additions & 4 deletions BALSAMIC/constants/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,23 @@
"output_path": "genome",
},
"delly_mappability": {
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/86aab2d10c5ffc009bc8c68ad077ab7283d8fe06/cancer/references/GRCh38.delly.blacklist.gz",
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/ea051b864d18945980f0ded6b16a5d192bd736a5/cancer/references/GRCh38.delly.blacklist.gz",
"file_type": "text",
"gzip": False,
"genome_version": "hg38",
"output_file": "delly_mappability.gz",
"output_path": "genome",
},
"delly_mappability_gindex": {
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/86aab2d10c5ffc009bc8c68ad077ab7283d8fe06/cancer/references/GRCh38.delly.blacklist.gz.gzi",
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/ea051b864d18945980f0ded6b16a5d192bd736a5/cancer/references/GRCh38.delly.blacklist.gz.gzi",
"file_type": "text",
"gzip": False,
"genome_version": "hg38",
"output_file": "delly_mappability.gz.gzi",
"output_path": "genome",
},
"delly_mappability_findex": {
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/86aab2d10c5ffc009bc8c68ad077ab7283d8fe06/cancer/references/GRCh38.delly.blacklist.gz.fai",
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/ea051b864d18945980f0ded6b16a5d192bd736a5/cancer/references/GRCh38.delly.blacklist.gz.fai",
"file_type": "text",
"gzip": False,
"genome_version": "hg38",
Expand All @@ -166,7 +166,7 @@
"output_path": "genome",
},
"ascat_chryloci": {
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/35465e2644f76f2d59427a9b379d34ecea71f259/cancer/references/hg38_Y.loci",
"url": "https://raw.githubusercontent.com/Clinical-Genomics/reference-files/ea051b864d18945980f0ded6b16a5d192bd736a5/cancer/references/hg38_Y.loci",
"file_type": "text",
"gzip": False,
"genome_version": "hg38",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,22 @@ rule bcftools_filter_vardict_research_tumor_normal:
bcftools view {input.vcf_snv_research} | \
bcftools filter --threads {threads} --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools view -f PASS -o {output.vcf_pass_vardict}.temp -O z;

tabix -p vcf -f {output.vcf_pass_vardict}.temp;
bcftools view -f PASS -o {output.vcf_pass_vardict}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_vardict}.temp \
--output_vcf {output.vcf_pass_vardict} \
--input_vcf {output.vcf_pass_vardict}.temp1 \
--output_vcf {output.vcf_pass_vardict}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_vardict}.temp2 > {output.vcf_pass_vardict}

tabix -p vcf -f {output.vcf_pass_vardict};

bcftools +counts {output.vcf_pass_vardict} > {output.bcftools_counts_research};

rm {output.vcf_pass_vardict}.temp;
rm {output.vcf_pass_vardict}.temp1;

rm {output.vcf_pass_vardict}.temp2;
"""


Expand Down Expand Up @@ -107,20 +109,22 @@ rule bcftools_filter_TNscope_umi_research_tumor_normal:
bcftools view -f PASS,triallelic_site --threads {threads} {input.vcf_snv_research} | \
bcftools filter --threads {threads} --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp -O z;

tabix -p vcf -f {output.vcf_pass_tnscope_umi}.temp;
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp \
--output_vcf {output.vcf_pass_tnscope_umi} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp1 \
--output_vcf {output.vcf_pass_tnscope_umi}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_tnscope_umi}.temp2 > {output.vcf_pass_tnscope_umi}

tabix -p vcf -f {output.vcf_pass_tnscope_umi};

bcftools +counts {output.vcf_pass_tnscope_umi} > {output.bcftools_counts_research};

rm {output.vcf_pass_tnscope_umi}.temp;
rm {output.vcf_pass_tnscope_umi}.temp1;

rm {output.vcf_pass_tnscope_umi}.temp2;
"""


Expand Down Expand Up @@ -153,20 +157,22 @@ bcftools view {input.vcf_snv_clinical} | \
bcftools filter --threads {threads} --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools filter --threads {threads} --include 'INFO/Frq <= {params.loqusdb_clinical_freq[0]} || INFO/Frq == \".\"' --soft-filter '{params.loqusdb_clinical_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS -o {output.vcf_pass_vardict}.temp -O z;

tabix -p vcf -f {output.vcf_pass_vardict}.temp;
bcftools view --threads {threads} -f PASS -o {output.vcf_pass_vardict}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_vardict}.temp \
--output_vcf {output.vcf_pass_vardict} \
--input_vcf {output.vcf_pass_vardict}.temp1 \
--output_vcf {output.vcf_pass_vardict}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_vardict}.temp2 > {output.vcf_pass_vardict}

tabix -p vcf -f {output.vcf_pass_vardict};

bcftools +counts {output.vcf_pass_vardict} > {output.bcftools_counts_clinical};

rm {output.vcf_pass_vardict}.temp;
rm {output.vcf_pass_vardict}.temp1;

rm {output.vcf_pass_vardict}.temp2;
"""


Expand Down Expand Up @@ -199,18 +205,20 @@ bcftools view -f PASS,triallelic_site --threads {threads} {input.vcf_snv_clinic
bcftools filter --threads {threads} --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools filter --threads {threads} --include 'INFO/Frq <= {params.loqusdb_clinical_freq[0]} || INFO/Frq == \".\"' --soft-filter '{params.loqusdb_clinical_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp -O z;

tabix -p vcf -f {output.vcf_pass_tnscope_umi}.temp;
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp \
--output_vcf {output.vcf_pass_tnscope_umi} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp1 \
--output_vcf {output.vcf_pass_tnscope_umi}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_tnscope_umi}.temp2 > {output.vcf_pass_tnscope_umi}

tabix -p vcf -f {output.vcf_pass_tnscope_umi};

bcftools +counts {output.vcf_pass_tnscope_umi} > {output.bcftools_counts_clinical};

rm {output.vcf_pass_tnscope_umi}.temp;
rm {output.vcf_pass_tnscope_umi}.temp1;

rm {output.vcf_pass_tnscope_umi}.temp2;
"""
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,22 @@ rule bcftools_filter_vardict_research_tumor_only:
bcftools view {input.vcf_snv_research} | \
bcftools filter --threads {threads} --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS -o {output.vcf_pass_vardict}.temp -O z;

tabix -p vcf -f {output.vcf_pass_vardict}.temp;
bcftools view --threads {threads} -f PASS -o {output.vcf_pass_vardict}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_vardict}.temp \
--output_vcf {output.vcf_pass_vardict} \
--input_vcf {output.vcf_pass_vardict}.temp1 \
--output_vcf {output.vcf_pass_vardict}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_vardict}.temp2 > {output.vcf_pass_vardict}

tabix -p vcf -f {output.vcf_pass_vardict};

bcftools +counts {output.vcf_pass_vardict} > {output.bcftools_counts_research};

rm {output.vcf_pass_vardict}.temp;
rm {output.vcf_pass_vardict}.temp1;

rm {output.vcf_pass_vardict}.temp2;
"""


Expand Down Expand Up @@ -107,20 +109,22 @@ rule bcftools_filter_TNscope_umi_research_tumor_only:
bcftools view {input.vcf_snv_research} | \
bcftools filter --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp -O z;

tabix -p vcf -f {output.vcf_pass_tnscope_umi}.temp;
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp \
--output_vcf {output.vcf_pass_tnscope_umi} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp1 \
--output_vcf {output.vcf_pass_tnscope_umi}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_tnscope_umi}.temp2 > {output.vcf_pass_tnscope_umi}

tabix -p vcf -f {output.vcf_pass_tnscope_umi};

bcftools +counts {output.vcf_pass_tnscope_umi} > {output.bcftools_counts_research};

rm {output.vcf_pass_tnscope_umi}.temp;
rm {output.vcf_pass_tnscope_umi}.temp1;

rm {output.vcf_pass_tnscope_umi}.temp2;
"""


Expand Down Expand Up @@ -153,20 +157,22 @@ bcftools view {input.vcf_snv_clinical} | \
bcftools filter --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools filter --threads {threads} --include 'INFO/Frq <= {params.loqusdb_clinical_freq[0]} || INFO/Frq == \".\"' --soft-filter '{params.loqusdb_clinical_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS -o {output.vcf_pass_vardict}.temp -O z;

tabix -p vcf -f {output.vcf_pass_vardict}.temp;
bcftools view --threads {threads} -f PASS -o {output.vcf_pass_vardict}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_vardict}.temp \
--output_vcf {output.vcf_pass_vardict} \
--input_vcf {output.vcf_pass_vardict}.temp1 \
--output_vcf {output.vcf_pass_vardict}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_vardict}.temp2 > {output.vcf_pass_vardict}

tabix -p vcf -f {output.vcf_pass_vardict};

bcftools +counts {output.vcf_pass_vardict} > {output.bcftools_counts_clinical};

rm {output.vcf_pass_vardict}.temp;
rm {output.vcf_pass_vardict}.temp1;

rm {output.vcf_pass_vardict}.temp2;
"""


Expand Down Expand Up @@ -199,18 +205,20 @@ bcftools view {input.vcf_snv_clinical} | \
bcftools filter --include 'INFO/GNOMADAF_popmax <= {params.pop_freq[0]} || INFO/GNOMADAF_popmax == \".\"' --soft-filter '{params.pop_freq[1]}' --mode '+' | \
bcftools filter --threads {threads} --include 'INFO/SWEGENAF <= {params.swegen_freq[0]} || INFO/SWEGENAF == \".\"' --soft-filter '{params.swegen_freq[1]}' --mode '+' |\
bcftools filter --threads {threads} --include 'INFO/Frq <= {params.loqusdb_clinical_freq[0]} || INFO/Frq == \".\"' --soft-filter '{params.loqusdb_clinical_freq[1]}' --mode '+' |\
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp -O z;

tabix -p vcf -f {output.vcf_pass_tnscope_umi}.temp;
bcftools view --threads {threads} -f PASS,triallelic_site -o {output.vcf_pass_tnscope_umi}.temp1 -O z;

python {params.edit_vcf_script} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp \
--output_vcf {output.vcf_pass_tnscope_umi} \
--input_vcf {output.vcf_pass_tnscope_umi}.temp1 \
--output_vcf {output.vcf_pass_tnscope_umi}.temp2 \
--variant_caller {params.variant_caller};

bgzip -@ {threads} -l 9 -c {output.vcf_pass_tnscope_umi}.temp2 > {output.vcf_pass_tnscope_umi}

tabix -p vcf -f {output.vcf_pass_tnscope_umi};

bcftools +counts {output.vcf_pass_tnscope_umi} > {output.bcftools_counts_clinical};

rm {output.vcf_pass_tnscope_umi}.temp;
rm {output.vcf_pass_tnscope_umi}.temp1;

rm {output.vcf_pass_tnscope_umi}.temp2;
"""
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ echo -e \"{params.tumor}\\tTUMOR\" > {output.namemap};
rm -rf {params.tmpdir};
"""

rule cnvpytor_cnv_tumor_only:
rule cnvpytor_tumor_only:
input:
bamT = bam_dir + tumor_bam,
vcfT = vcf_dir + "SNV.somatic." + config["analysis"]["case_id"] + ".tnscope.vcf.gz",
map = config["reference"]["delly_mappability"],
output:
cnv_cnvpytor = vcf_dir + "CNV.somatic." + config["analysis"]["case_id"] + ".cnvpytor.vcf.gz",
circular_cnvpytor = vcf_dir + "CNV.somatic." + config["analysis"]["case_id"] + ".cnvpytor.circular.png",
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
[X.X.X]

Fixed:
^^^^^^
* Reference files for hg38 https://github.com/Clinical-Genomics/BALSAMMIC/pull/1081

Added:
^^^^^^
* Cluster resources for CNVPytor tumor only https://github.com/Clinical-Genomics/BALSAMIC/pull/1083
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved

[11.1.0]
--------

Expand Down Expand Up @@ -25,7 +35,7 @@ Changed:

Fixed:
^^^^^^
* MacDepth in quality filter for SV https://github.com/Clinical-Genomics/BALSAMIC/pull/1051
* MaxDepth in quality filter for SV https://github.com/Clinical-Genomics/BALSAMIC/pull/1051

[11.0.1]
--------
Expand Down