Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fixing .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tovahmarkowitz committed Nov 27, 2018
2 parents 21d2437 + 85da386 commit 3ab0d0e
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
!.gitignore
**/*~
**/*.bak
**/*.DS_Store
**/*.DS_Store
5 changes: 3 additions & 2 deletions Results-template/Scripts/maftools.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ mymaf <- read.maf(FILE1)
mymaf<-subsetMaf(maf=mymaf,query = "gnomAD_AF<0.001",mafObj = TRUE,restrictTo = "mutations")
mymaf<-subsetMaf(maf=mymaf,query = "ExAC_AF<0.001",mafObj = TRUE,restrictTo = "mutations")
mymaf<-subsetMaf(maf=mymaf,query = "AF<0.01",mafObj = TRUE,restrictTo = "mutations")
mymaf<-subsetMaf(maf=mymaf,query = "tumor_freq>0.05",mafObj = TRUE,restrictTo = "mutations")
mymaf<-subsetMaf(maf=mymaf,query = "t_alt_count>2",mafObj = TRUE,restrictTo = "mutations")
mymaf<-subsetMaf(maf=mymaf,query = "t_ref_count>9",mafObj = TRUE,restrictTo = "mutations")
#read list of blacklist genes
flags <- c("TTN","MUC16","OBSCN","AHNAK2","SYNE1","FLG","MUC5B","DNAH17","PLEC","DST","SYNE2","NEB","HSPG2","LAMA5","AHNAK","HMCN1","USH2A","DNAH11","MACF1","MUC17","DNAH5","GPR98","FAT1","PKD1","MDN1","RNF213","RYR1","DNAH2","DNAH3","DNAH8","DNAH1","DNAH9","ABCA13","SRRM2","CUBN","SPTBN5","PKHD1","LRP2","FBN3","CDH23","DNAH10","FAT4","RYR3","PKHD1L1","FAT2","CSMD1","PCNT","COL6A3","FRAS1","FCGBP","RYR2","HYDIN","XIRP2","LAMA1")
samplesum<-getSampleSummary(mymaf)
Expand All @@ -28,5 +29,5 @@ dev.off()
pdf(FILE3)
oncoplot(mymaf,writeMatrix=TRUE,showTumorSampleBarcodes=TRUE,genesToIgnore=flags)
dev.off()
mymaf<-subsetMaf(maf=mymaf,query = "tumor_freq>0.05",mafObj = FALSE,restrictTo = "mutations")
mymaf<-subsetMaf(maf=mymaf,query = "t_ref_count>9",mafObj = FALSE,restrictTo = "mutations",row.names=FALSE)
write.table(mymaf, file="final_filtered.maf", sep="\t", quote=FALSE)
65 changes: 56 additions & 9 deletions Results-template/Scripts/prep_mafs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

#INPUT

my $finalmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#my $mergedmaf = $ARGV[1] . '_out/oncotator_out/' . $ARGV[1] . '_merged.maf'; #to fix...
#open C, ">$mergedmaf";

my $finalmaf = $ARGV[1] . '_out/oncotator_out/final_filtered.maf'; #to fix...
open C, ">$finalmaf";

my $maffile = $ARGV[0]; #to fix...
Expand Down Expand Up @@ -36,15 +39,59 @@
}
}
elsif ($line[0] !~ m'#') {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
if ($line[44] ne '-') {
if ($line[44] < 2) {
if (($line[41] > 2) && ($line[39] > 9)) {
if ($line[123] ne '-') {
if ($line[123] < 0.001) {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
else {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
}
}
else {
print "0\n";
}
if (($line[41] > 2) && ($line[39] > 9)) {
if ($line[123] ne '-') {
if ($line[123] < 0.001) {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
else {
print C "$_\t";
if ($line[39] != 0){
$calc=($line[41]/$line[39]);
print C "$calc\n";
}
else {
print "0\n";
}
}
}
}
}

close C;
}
2 changes: 1 addition & 1 deletion Rules/ChIPseq.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def normalize_bam_file_chromosomes(bamfns, obamfns=[], suffix='.common_chrom.bam

configfile: "run.json"


workpath = config['project']['workpath']
filetype = config['project']['filetype']
readtype = config['project']['readtype']
Expand Down
33 changes: 18 additions & 15 deletions Rules/all-exomeseq-somatic.rl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ if config['project']['annotation'] == "hg19":
config['project']['workpath']+"/mutect_out/mutect_maf_summary.pdf",
config['project']['workpath']+"/strelka_out/strelka_maf_summary.pdf",
# config['project']['workpath']+"/mutect_variants_alview.input",
config['project']['workpath']+"/strelka_out",
config['project']['workpath']+"/mutect2_out",
config['project']['workpath']+"/cnvkit_out",
config['project']['workpath']+"/mutect_out",
# config['project']['workpath']+"/strelka_out",
# config['project']['workpath']+"/mutect2_out",
# config['project']['workpath']+"/cnvkit_out",
# config['project']['workpath']+"/mutect_out",
expand(config['project']['workpath']+"/cnvkit_out/{p}_calls.cns", p=pairs),
expand(config['project']['workpath']+"/cnvkit_out/{p}_gainloss.tsv", p=pairs),
dynamic(expand(config['project']['workpath']+"/theta_out/{p}/{p}_thetaIN", p=pairs)),
Expand All @@ -34,7 +34,8 @@ if config['project']['annotation'] == "hg19":
config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt",
config['project']['workpath']+"/exome_targets.bed",
expand("manta_out/{p}/results/variants/candidateSV.vcf.gz", p=pairs),
"admixture_out/admixture_table.tsv"
"admixture_out/admixture_table.tsv",
"QC/decoy"
output:
params: rname="final"
shell: """
Expand All @@ -56,10 +57,10 @@ elif config['project']['annotation'] == "hg38":
config['project']['workpath']+"/mutect_out/mutect_maf_summary.pdf",
config['project']['workpath']+"/strelka_out/strelka_maf_summary.pdf",
# config['project']['workpath']+"/mutect_variants_alview.input",
config['project']['workpath']+"/strelka_out",
config['project']['workpath']+"/mutect2_out",
config['project']['workpath']+"/cnvkit_out",
config['project']['workpath']+"/mutect_out",
# config['project']['workpath']+"/strelka_out",
# config['project']['workpath']+"/mutect2_out",
# config['project']['workpath']+"/cnvkit_out",
# config['project']['workpath']+"/mutect_out",
expand(config['project']['workpath']+"/cnvkit_out/{p}_calls.cns", p=pairs),
expand(config['project']['workpath']+"/cnvkit_out/{p}_gainloss.tsv", p=pairs),
dynamic(expand(config['project']['workpath']+"/theta_out/{p}/{p}_thetaIN", p=pairs)),
Expand All @@ -77,7 +78,8 @@ elif config['project']['annotation'] == "hg38":
config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt",
config['project']['workpath']+"/exome_targets.bed",
expand("manta_out/{p}/results/variants/candidateSV.vcf.gz", p=pairs),
"admixture_out/admixture_table.tsv"
"admixture_out/admixture_table.tsv",
"QC/decoy"
output:
params: rname="final"
shell: """
Expand All @@ -96,10 +98,10 @@ elif config['project']['annotation'] == "mm10":
expand(config['project']['workpath']+"/strelka_out/oncotator_out/{p}"+".maf",p=pairs),
expand(config['project']['workpath']+"/mutect_out/oncotator_out/{p}"+".maf",p=pairs),
# config['project']['workpath']+"/mutect_variants_alview.input",
config['project']['workpath']+"/strelka_out",
config['project']['workpath']+"/mutect2_out",
config['project']['workpath']+"/cnvkit_out",
config['project']['workpath']+"/mutect_out",
# config['project']['workpath']+"/strelka_out",
# config['project']['workpath']+"/mutect2_out",
# config['project']['workpath']+"/cnvkit_out",
# config['project']['workpath']+"/mutect_out",
expand(config['project']['workpath']+"/cnvkit_out/{p}_calls.cns", p=pairs),
expand(config['project']['workpath']+"/cnvkit_out/{p}_gainloss.tsv", p=pairs),
dynamic(expand(config['project']['workpath']+"/theta_out/{p}/{p}_thetaIN", p=pairs)),
Expand All @@ -117,7 +119,8 @@ elif config['project']['annotation'] == "mm10":
config['project']['workpath']+"/mutect_out/mutsigCV_out/somatic.sig_genes.txt",
config['project']['workpath']+"/exome_targets.bed",
expand("manta_out/{p}/results/variants/candidateSV.vcf.gz", p=pairs),
"admixture_out/admixture_table.tsv"
"admixture_out/admixture_table.tsv",
"QC/decoy"
output:
params: rname="final"
shell: """
Expand Down
8 changes: 1 addition & 7 deletions Rules/maftools.rl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ rule maftools:
output: mutectpre=temp(config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants.maf"),
mutect2pre=temp(config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf"),
strelkapre=temp(config['project']['workpath']+"/strelka_out/oncotator_out/strelka_variants.maf"),
mutectfix=temp(config['project']['workpath']+"/mutect_out/oncotator_out/mutect_variants_fixed.maf"),
mutect2fix=temp(config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants_fixed.maf"),
strelkafix=temp(config['project']['workpath']+"/strelka_out/oncotator_out/strelka_variants_fixed.maf"),
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",
mutect2fin=config['project']['workpath']+"/mutect2_out/oncotator_out/final_filtered.maf",
mutectfin=config['project']['workpath']+"/mutect_out/oncotator_out/final_filtered.maf",
strelkafin=config['project']['workpath']+"/strelka_out/oncotator_out/final_filtered.maf",
Expand All @@ -21,4 +15,4 @@ rule maftools:
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: "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.5; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_merged.maf {params.dir}/mutect2_out/mutect2_maf_summary.pdf {output.mutect2oncoprint}; Rscript Scripts/maftools.R {params.dir}/mutect_out/oncotator_out/ mutect_merged.maf {params.dir}/mutect_out/mutect_maf_summary.pdf {output.mutectoncoprint}; Rscript Scripts/maftools.R {params.dir}/strelka_out/oncotator_out/ strelka_merged.maf {params.dir}/strelka_out/strelka_maf_summary.pdf {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; module load R/3.5; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_variants.maf {params.dir}/mutect2_out/mutect2_maf_summary.pdf {output.mutect2oncoprint}; Rscript Scripts/maftools.R {params.dir}/mutect_out/oncotator_out/ mutect_variants.maf {params.dir}/mutect_out/mutect_maf_summary.pdf {output.mutectoncoprint}; Rscript Scripts/maftools.R {params.dir}/strelka_out/oncotator_out/ strelka_variants.maf {params.dir}/strelka_out/strelka_maf_summary.pdf {output.strelkaoncoprint}"
3 changes: 1 addition & 2 deletions Rules/maftools_tumoronly.rl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
rule maftools_tumoronly:
input: mutect2mafs=expand(config['project']['workpath']+"/mutect2_out/oncotator_out/{s}.maf",s=samples),
output: mutect2pre=temp(config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants.maf"),
mutect2fix=temp(config['project']['workpath']+"/mutect2_out/oncotator_out/mutect2_variants_fixed.maf"),
mutect2maf=config['project']['workpath']+"/mutect2_out/oncotator_out/final_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: "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.5; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_filtered.maf {params.dir}/mutect2_out/mutect2_maf_summary.pdf {output.mutect2oncoprint}"
shell: "cat mutect2_out/oncotator_out/*.maf > mutect2_out/oncotator_out/mutect2_variants.maf; module load R/3.5; Rscript Scripts/maftools.R {params.dir}/mutect2_out/oncotator_out/ mutect2_variants.maf {params.dir}/mutect2_out/mutect2_maf_summary.pdf {output.mutect2oncoprint}"
11 changes: 2 additions & 9 deletions Rules/mkdir_somatic.rl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
rule mkdir_somatic:
input: expand("{s}.recal.bam", s=samples),expand("{s}.recal.bam.bai", s=samples)
output: mutect_dir=config['project']['workpath']+"/mutect_out",
mutect2_dir=config['project']['workpath']+"/mutect2_out",
mut2chrom_dir=config['project']['workpath']+"/mutect2_out/chrom_files",
cnvkit_dir=config['project']['workpath']+"/cnvkit_out",
strelka_dir=config['project']['workpath']+"/strelka_out",
theta_dir=config['project']['workpath']+"/theta_out",
conpair_dir=config['project']['workpath']+"/conpair_out",
manta_dir=config['project']['workpath']+"/manta_out"
output: temp("QC/decoy")
params: rname="pl:mkdir"
shell: "mkdir -p strelka_out; mkdir -p strelka_out/oncotator_out; mkdir -p strelka_out/mutsigCV_out; mkdir -p cnvkit_out; mkdir -p mutect_out; mkdir -p mutect_out/oncotator_out; mkdir -p mutect_out/mutsigCV_out; mkdir -p theta_out; mkdir -p conpair_out; mkdir -p germline_vcfs; mkdir -p mutect2_out; mkdir -p mutect2_out/oncotator_out; mkdir -p mutect2_out/mutsigCV_out; mkdir -p mutect2_out/chrom_files; mkdir -p manta_out"
shell: "echo \'decoy\' > {output}; mkdir -p strelka_out; mkdir -p strelka_out/oncotator_out; mkdir -p strelka_out/mutsigCV_out; mkdir -p cnvkit_out; mkdir -p mutect_out; mkdir -p mutect_out/oncotator_out; mkdir -p mutect_out/mutsigCV_out; mkdir -p theta_out; mkdir -p conpair_out; mkdir -p germline_vcfs; mkdir -p mutect2_out; mkdir -p mutect2_out/oncotator_out; mkdir -p mutect2_out/mutsigCV_out; mkdir -p mutect2_out/chrom_files; mkdir -p manta_out"
4 changes: 2 additions & 2 deletions Rules/mutect.rl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ rule mutect:
input: normal=lambda wildcards: config['project']['pairs'][wildcards.x][0]+".recal.bam",
tumor=lambda wildcards: config['project']['pairs'][wildcards.x][1]+".recal.bam",
targets=ancient("exome_targets.bed"),
lambda wildcards: config['project']['pairs'][wildcards.x][0]+".recal.bam.bai",
lambda wildcards: config['project']['pairs'][wildcards.x][1]+".recal.bam.bai"
normalbai=lambda wildcards: config['project']['pairs'][wildcards.x][0]+".recal.bam.bai",
tumorbai=lambda wildcards: config['project']['pairs'][wildcards.x][1]+".recal.bam.bai"
output: vcf=temp(config['project']['workpath']+"/mutect_out/{x}.vcf"),
stats=config['project']['workpath']+"/mutect_out/{x}.stats.out",
vcfRename=config['project']['workpath']+"/mutect_out/{x}.FINAL.vcf",
Expand Down
4 changes: 2 additions & 2 deletions Rules/strelka.rl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ rule strelka:
input: normal=lambda wildcards: config['project']['pairs'][wildcards.x][0]+".recal.bam",
tumor=lambda wildcards: config['project']['pairs'][wildcards.x][1]+".recal.bam",
targets=ancient("exome_targets.bed"),
lambda wildcards: config['project']['pairs'][wildcards.x][0]+".recal.bam.bai",
lambda wildcards: config['project']['pairs'][wildcards.x][1]+".recal.bam.bai"
normalbai=lambda wildcards: config['project']['pairs'][wildcards.x][0]+".recal.bam.bai",
tumorbai=lambda wildcards: config['project']['pairs'][wildcards.x][1]+".recal.bam.bai"
output: vcf=temp(config['project']['workpath']+"/strelka_out/{x}.vcf"),
vcffiltered=temp(config['project']['workpath']+"/strelka_out/{x}_filtered.vcf"),
final=config['project']['workpath']+"/strelka_out/{x}_FINAL.vcf",
Expand Down
Loading

0 comments on commit 3ab0d0e

Please sign in to comment.