This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added population allele frequencies to MAF filtering, and set mutsig …
…a threshold of 10 samples or tumor/normal pairs for mutsig to run
- Loading branch information
Justin Britt Lack
committed
Dec 14, 2017
1 parent
6492220
commit ebf060e
Showing
11 changed files
with
141 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
rule database_somatic_tumoronly: | ||
input: mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_merged.maf", | ||
input: mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: mutect2dbase=config['project']['workpath']+"/mutect2_out/mutect2_variants.database", | ||
params: rname="pl:database" | ||
shell: "cd mutect2_out; sed '1!b;s/#//g' {input.mutect2maf} > temp.database; module load R/3.4.0_gcc-6.2.0; Rscript ../Scripts/dedupcol.R; echo -n \"create table vcf (\\\"\" > sqlite3.commands; sed -n 1p temp.database | sed 's/#//g' | sed 's/\\t/\" text, \"/g' | sed '${{s/$/\\\" text);/}}' >> sqlite3.commands; echo \".separator \\\"\\\\t\\\"\" >> sqlite3.commands; echo \".import temp.database vcf\" >> sqlite3.commands; tail -n +2 temp.database > temp.temp.database; mv temp.temp.database temp.database; sqlite3 {output.mutect2dbase} < sqlite3.commands" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
rule maftools: | ||
input: mutect2=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf", | ||
mutect=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants.maf", | ||
strelka=config['project']['workpath']+"/strelka_out/oncotator_out/strelka_variants.maf", | ||
output: mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_merged.maf", | ||
mutectmaf=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_merged.maf", | ||
strelkamaf=config['project']['workpath']+"/strelka_out/oncotator_out/strelka_merged.maf", | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{x}.maf",x=pairs), | ||
expand(config['project']['workpath']+"/strelka_out/oncotator_out/{x}.maf",x=pairs), | ||
expand(config['project']['workpath']+"/mutect_out/oncotator_out/{x}.maf",x=pairs), | ||
output: mutectpre=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants.maf", | ||
mutect2pre=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf", | ||
strelkapre=config['project']['workpath']+"/strelka_out/oncotator_out/strelka_variants.maf", | ||
mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
mutectmaf=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_filtered.maf", | ||
strelkamaf=config['project']['workpath']+"/strelka_out/oncotator_out/strelka_filtered.maf", | ||
mutect2summary=config['project']['workpath']+"/mutect2_out/mutect2_maf_summary.pdf", | ||
mutect2oncoprint=config['project']['workpath']+"/mutect2_out/mutect2_oncoplot.pdf", | ||
mutectsummary=config['project']['workpath']+"/mutect_out/mutect_maf_summary.pdf", | ||
mutectoncoprint=config['project']['workpath']+"/mutect_out/mutect_oncoplot.pdf", | ||
strelkasummary=config['project']['workpath']+"/strelka_out/strelka_maf_summary.pdf", | ||
strelkaoncoprint=config['project']['workpath']+"/strelka_out/strelka_oncoplot.pdf", | ||
params: dir=config['project']['workpath'],rname="pl:maftools" | ||
shell: "perl Scripts/prep_mafs.pl {input.mutect2} mutect2; perl Scripts/prep_mafs.pl {input.mutect} mutect; perl Scripts/prep_mafs.pl {input.strelka} strelka; module load R/3.4.0_gcc-6.2.0; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_merged.maf {params.dir}/mutect2_out/mutect2_maf_summary {output.mutect2oncoprint}; Rscript Scripts/maftools.R {params.dir}/mutect_out/oncotator_out/ mutect_merged.maf {params.dir}/mutect_out/mutect_maf_summary {output.mutectoncoprint}; Rscript Scripts/maftools.R {params.dir}/strelka_out/oncotator_out/ strelka_merged.maf {params.dir}/strelka_out/strelka_maf_summary {output.strelkaoncoprint}" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > mutect2_out/oncotator_out/mutect2_variants.maf; cat mutect_out/oncotator_out/*.maf > mutect_out/oncotator_out/mutect_variants.maf; cat strelka_out/oncotator_out/*.maf > strelka_out/oncotator_out/strelka_variants.maf; perl Scripts/prep_mafs.pl mutect2_out/oncotator_out/mutect2_variants.maf mutect2; perl Scripts/prep_mafs.pl mutect_out/oncotator_out/mutect_variants.maf mutect; perl Scripts/prep_mafs.pl strelka_out/oncotator_out/strelka_variants.maf strelka; module load R/3.4.0_gcc-6.2.0; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_filtered.maf {params.dir}/mutect2_out/mutect2_maf_summary {output.mutect2oncoprint}; Rscript Scripts/maftools.R {params.dir}/mutect_out/oncotator_out/ mutect_filtered.maf {params.dir}/mutect_out/mutect_maf_summary {output.mutectoncoprint}; Rscript Scripts/maftools.R {params.dir}/strelka_out/oncotator_out/ strelka_filtered.maf {params.dir}/strelka_out/strelka_maf_summary {output.strelkaoncoprint}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
rule maftools_tumoronly: | ||
input: mutect2=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf", | ||
output: mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_merged.maf", | ||
input: mutect2mafs=expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{x}.maf"), | ||
output: mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
mutect2summary=config['project']['workpath']+"/mutect2_out/mutect2_maf_summary.pdf", | ||
mutect2oncoprint=config['project']['workpath']+"/mutect2_out/mutect2_oncoplot.pdf", | ||
params: dir=config['project']['workpath'],rname="pl:maftools" | ||
shell: "perl Scripts/prep_mafs.pl {input.mutect2} mutect2; module load R/3.4.0_gcc-6.2.0; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_merged.maf {params.dir}/mutect2_out/mutect2_maf_summary {output.mutect2oncoprint}" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > mutect2_out/oncotator_out/mutect2_variants.maf; perl Scripts/prep_mafs.pl mutect2_out/oncotator_out/mutect2_variants.maf mutect2; module load R/3.4.0_gcc-6.2.0; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_filtered.maf {params.dir}/mutect2_out/mutect2_maf_summary {output.mutect2oncoprint}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
if config['project']['annotation'] == "hg19": | ||
rule mutsig_mutect: | ||
input: expand(config['project']['workpath']+"/mutect_out/oncotator_out/{p}.maf",p=pairs) | ||
num = sum(1 for line in open('pairs')) | ||
|
||
if num > 10: | ||
if config['project']['annotation'] == "hg19": | ||
rule mutsig_mutect: | ||
input: config['project']['workpath']+"/mutect_out/oncotator_out/mutect_filtered.maf" | ||
output: genes=config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt", | ||
params: rname="pl:mutsig_mutect" | ||
shell: "module load MutSig; MutSigCV {input} $MUTSIG_REF/exome_full192.coverage.txt $MUTSIG_REF/gene.covariates.txt mutect_out/mutsigCV_out/somatic $MUTSIG_REF/mutation_type_dictionary_file.txt $MUTSIG_REF/chr_files_hg19" | ||
|
||
elif config['project']['annotation'] == "hg38": | ||
rule mutsig_mutect: | ||
input: config['project']['workpath']+"/mutect_out/oncotator_out/mutect_filtered.maf" | ||
output: genes=config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants.maf" | ||
params: rname="pl:mutsig_mutect" | ||
shell: "cat mutect_out/oncotator_out/*.maf > {output.maf}; module load MutSig; MutSigCV {output.maf} $MUTSIG_REF/exome_full192.coverage.txt $MUTSIG_REF/gene.covariates.txt mutect_out/mutsigCV_out/somatic $MUTSIG_REF/mutation_type_dictionary_file.txt $MUTSIG_REF/chr_files_hg19" | ||
shell: "echo \"null\" > {output.genes}" | ||
|
||
elif config['project']['annotation'] == "hg38": | ||
rule mutsig_mutect: | ||
input: expand(config['project']['workpath']+"/mutect_out/oncotator_out/{p}.maf",p=pairs) | ||
elif config['project']['annotation'] == "mm10": | ||
rule mutsig_mutect: | ||
input: config['project']['workpath']+"/mutect_out/oncotator_out/mutect_filtered.maf" | ||
output: genes=config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants.maf" | ||
params: rname="pl:mutsig_mutect" | ||
shell: "cat mutect_out/oncotator_out/*.maf > {output.maf}; echo \"null\" > {output.genes}" | ||
shell: "echo \"null\" > {output.genes}" | ||
|
||
elif config['project']['annotation'] == "mm10": | ||
rule mutsig_mutect: | ||
input: expand(config['project']['workpath']+"/mutect_out/oncotator_out/{p}.maf",p=pairs) | ||
else: | ||
rule mutsig_mutect: | ||
input: config['project']['workpath']+"/mutect_out/oncotator_out/mutect_filtered.maf" | ||
output: genes=config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants.maf" | ||
params: rname="pl:mutsig_mutect" | ||
shell: "cat mutect_out/oncotator_out/*.maf > {output.maf}; echo \"null\" > {output.genes}" | ||
shell: "echo \"null\" > {output.genes}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
if config['project']['annotation'] == "hg19": | ||
rule mutsig_mutect2: | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{p}.maf",p=pairs) | ||
num = sum(1 for line in open('pairs')) | ||
|
||
if num > 10: | ||
if config['project']['annotation'] == "hg19": | ||
rule mutsig_mutect2: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf" | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > {output.maf}; module load MutSig; MutSigCV {output.maf} $MUTSIG_REF/exome_full192.coverage.txt $MUTSIG_REF/gene.covariates.txt mutect2_out/mutsigCV_out/somatic $MUTSIG_REF/mutation_type_dictionary_file.txt $MUTSIG_REF/chr_files_hg19" | ||
shell: "module load MutSig; MutSigCV {input} $MUTSIG_REF/exome_full192.coverage.txt $MUTSIG_REF/gene.covariates.txt mutect2_out/mutsigCV_out/somatic $MUTSIG_REF/mutation_type_dictionary_file.txt $MUTSIG_REF/chr_files_hg19" | ||
|
||
elif config['project']['annotation'] == "hg38": | ||
rule mutsig_mutect2: | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{p}.maf",p=pairs) | ||
elif config['project']['annotation'] == "hg38": | ||
rule mutsig_mutect2: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "echo \"null\" > {output.genes}" | ||
|
||
elif config['project']['annotation'] == "mm10": | ||
rule mutsig_mutect2: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf" | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > {output.maf}; echo \"null\" > {output.genes}" | ||
shell: "echo \"null\" > {output.genes}" | ||
|
||
elif config['project']['annotation'] == "mm10": | ||
rule mutsig_mutect2: | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{p}.maf",p=pairs) | ||
else: | ||
rule mutsig_mutect2: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf" | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > {output.maf}; echo \"null\" > {output.genes}" | ||
shell: "echo \"null\" > {output.genes}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
if config['project']['annotation'] == "hg19": | ||
rule mutsig_mutect2_tumoronly: | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{s}.maf",s=samples) | ||
import glob | ||
samps = len(glob.glob1(myPath,"*.recal.bam")) | ||
|
||
if samps>10: | ||
if config['project']['annotation'] == "hg19": | ||
rule mutsig_mutect2_tumoronly: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf" | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > {output.maf}; module load MutSig; MutSigCV {output.maf} $MUTSIG_REF/exome_full192.coverage.txt $MUTSIG_REF/gene.covariates.txt mutect2_out/mutsigCV_out/somatic $MUTSIG_REF/mutation_type_dictionary_file.txt $MUTSIG_REF/chr_files_hg19" | ||
shell: "module load MutSig; MutSigCV {input} $MUTSIG_REF/exome_full192.coverage.txt $MUTSIG_REF/gene.covariates.txt mutect2_out/mutsigCV_out/somatic $MUTSIG_REF/mutation_type_dictionary_file.txt $MUTSIG_REF/chr_files_hg19" | ||
|
||
elif config['project']['annotation'] == "hg38": | ||
rule mutsig_mutect2_tumoronly: | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{s}.maf",s=samples) | ||
elif config['project']['annotation'] == "hg38": | ||
rule mutsig_mutect2_tumoronly: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "echo \"null\" > {output.genes}" | ||
|
||
elif config['project']['annotation'] == "mm10": | ||
rule mutsig_mutect2_tumoronly: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf" | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > {output.maf}; echo \"null\" > {output.genes}" | ||
shell: "echo \"null\" > {output.genes}" | ||
|
||
elif config['project']['annotation'] == "mm10": | ||
rule mutsig_mutect2_tumoronly: | ||
input: expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{s}.maf",s=samples) | ||
else: | ||
rule mutsig_mutect2_tumoronly: | ||
input: config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_filtered.maf", | ||
output: genes=config['project']['workpath']+"/mutect2_out/mutsigCV_out/somatic.sig_genes.txt", | ||
maf=config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf" | ||
params: rname="pl:mutsig_mutect2" | ||
shell: "cat mutect2_out/oncotator_out/*.maf > {output.maf}; echo \"null\" > {output.genes}" | ||
shell: "echo \"null\" > {output.genes}" |
Oops, something went wrong.