Skip to content

Commit

Permalink
implement delly/insurveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
ASLeonard committed Dec 4, 2023
1 parent ce7b856 commit a42ad64
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions snakepit/short_reads.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
rule all:
input:
'SR_SV/cohort.delly.forced.vcf.gz',
expand('SR_SV/{sample}_{caller}',caller=('insurveyor',),sample=config['HiFi'])

rule picard_add_MQ:
input:
'/cluster/work/pausch/inputs/bam/BTA_eQTL/{sample}.bam'
output:
multiext('SR_SV/{sample}.bam','','.bai')
envmodules:
'gcc/11.4.0',
'picard/3.1.1'
threads: 1
resources:
mem_mb = 7500
shell:
'''
picard FixMateInformation -I {input} -O {output[0]}
samtools index {output[0]}
'''

rule insurveyor:
input:
rules.picard_add_MQ.output
output:
_dir = directory('SR_SV/{sample}_insurveyor'),
#vcf = 'SR_SV/{sample}.insurveyor.vcf.gz'
threads: 4
resources:
mem_mb = 5000
shell:
'''
mkdir -p {output._dir}
python /cluster/work/pausch/alex/software/INSurVeyor/insurveyor.py --threads {threads} --samplename {wildcards.sample} {input[0]} {output._dir} {config[reference]}
'''

rule delly_call_denovo:
input:
'/cluster/work/pausch/inputs/bam/BTA_eQTL/{sample}.bam'
output:
'SR_SV/{sample}.delly.denovo.bcf'
threads: 4
resources:
mem_mb = 4000
shell:
'''
/cluster/work/pausch/alex/software/delly/src/delly call -g {config[reference]} -o {output} {input}
bcftools index {output}
'''

rule delly_merge:
input:
expand(rules.delly_call_denovo.output,sample=config['HiFi'])
output:
'SR_SV/cohort.delly.denovo.bcf'
threads: 4
resources:
mem_mb = 2500
shell:
'''
/cluster/work/pausch/alex/software/delly/src/delly merge --precise --pass --minsize 50 --vaf 0.01 -o {output} {input}
'''

rule delly_call_forced:
input:
bam = '/cluster/work/pausch/inputs/bam/BTA_eQTL/{sample}.bam',
panel = rules.delly_merge.output
output:
'SR_SV/{sample}.delly.forced.vcf.gz'
threads: 4
resources:
mem_mb = 4000
shell:
'''
/cluster/work/pausch/alex/software/delly/src/delly call -g {config[reference]} -v {input.panel} -o $TMPDIR/sample.bcf {input.bam}
bcftools view -o {output} $TMPDIR/sample.bcf
tabix -fp vcf {output}
'''

rule bcftools_merge:
input:
expand(rules.delly_call_forced.output,sample=config['HiFi'])
output:
'SR_SV/cohort.delly.forced.vcf.gz'
shell:
'''
bcftools merge -m id -o {output} {input}
tabix -fp vcf {output}
'''

0 comments on commit a42ad64

Please sign in to comment.