Skip to content

Commit

Permalink
changes to altsplicing calculation that ease its integreation into th…
Browse files Browse the repository at this point in the history
…e workflow
  • Loading branch information
riasc committed Jan 8, 2024
1 parent 357f98f commit 0790fb6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 34 deletions.
1 change: 1 addition & 0 deletions workflow/envs/manipulate_vcf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- python=3.11
- pip=23.1.2
- pyfaidx=0.7.0
- configargparse=1.7
- pip:
- vcfpy==0.13.6
- intervaltree==3.1.0
70 changes: 48 additions & 22 deletions workflow/rules/altsplicing.smk
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,52 @@ rule spladder:
--qmode all > {log} 2>&1
"""

#rule splicing_to_vcf:
#input:
#"results/{sample}/rnaseq/altsplicing/spladder/{group}/merge_graphs_{type}_{confidence}.confirmed.txt.gz"
#output:
#"results/as/{sample}.vcf"
#message:
#"Converting splicing events to VCF format"
#log:
#"logs/{sample}/spladder/{group}_vcf.log"
#conda:
#"../envs/spladder.yml"
#shell:
#"""
#"""
rule splicing_to_vcf:
input:
"results/{sample}/rnaseq/altsplicing/spladder/{group}"
output:
"results/{sample}/rnaseq/altsplicing/spladder/{group}_altsplicing.vcf"
message:
"Converting splicing events to VCF format"
log:
"logs/{sample}/spladder/{group}_to_vcf.log"
conda:
"../envs/manipulate_vcf.yml"
shell:
"""
python workflow/scripts/altsplc2vcf.py \
-i {input} -r resources/refs/genome.fasta \
-g {wildcards.group} -o {output} > {log} 2>&1
"""

#rule combine_splicing:
#input:
#expand("results/as/{sample}.vcf", sample=config["rnaseq"])
#output:
#"results/as/all.vcf"
#shell:
#"""
#"""
rule sort_altsplicing:
input:
"results/{sample}/rnaseq/altsplicing/spladder/{group}_altsplicing.vcf"
output:
"results/{sample}/rnaseq/altsplicing/spladder/{group}_altsplicing.vcf.gz"
message:
"Sorting and compressing splicing events on sample:{wildcards.sample} of group:{wildcards.group}"
log:
"logs/{sample}/spladder/{group}_sort.log"
conda:
"../envs/samtools.yml"
shell:
"""
bcftools sort {input} -o - | bcftools view -O z -o {output} > {log} 2>&1
"""

rule combine_altsplicing:
input:
get_altsplicing
output:
"results/{sample}/variants/altsplicing.vcf.gz"
message:
"Combining exitrons on sample:{wildcards.sample}"
log:
"logs/{sample}/exitrons/combine_exitrons.log"
conda:
"../envs/samtools.yml"
shell:
"""
bcftools concat --naive -O z {input} -o - | bcftools sort -O z -o {output} > {log} 2>&1
"""
10 changes: 10 additions & 0 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,16 @@ def get_fusions(wildcards):

return fusions

########### ALT SPLICING ##########
def get_altsplicing(wildcards):
altsplicing = []
if config['data']['rnaseq'] is not None:
if config['altsplicing']['activate']:
altsplicing += expand("results/{sample}/rnaseq/altsplicing/spladder/{group}_altsplicing.vcf.gz",
sample=config['data']['name'],
group=list(config['data']['rnaseq'].keys()))
return altsplicing


########### NEOANTIGEN PRIORIZATION ##########
def get_variants(wildcards):
Expand Down
12 changes: 0 additions & 12 deletions workflow/scripts/altsplc_to_variants.py

This file was deleted.

0 comments on commit 0790fb6

Please sign in to comment.