Skip to content

Commit

Permalink
refactor fusion input
Browse files Browse the repository at this point in the history
  • Loading branch information
riasc committed Mar 9, 2024
1 parent cfab574 commit 3f83514
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
27 changes: 11 additions & 16 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def get_altsplicing(wildcards):


########### NEOANTIGEN PRIORIZATION ##########
def get_snvs(wildcards):
def get_prioritization_snvs(wildcards):
snv = []
if config["indel"]["activate"]:
if config["indel"]["type"] in ["short", "all"]:
Expand All @@ -697,11 +697,11 @@ def get_snvs(wildcards):

return snv

def get_indels(wildcards):
def get_prioritization_indels(wildcards):
indels = []
if config["indel"]["activate"]:
if config["indel"]["type"] in ["short", "all"]:
variants += expand("results/{sample}/annotation/somatic.short.indels.vcf",
indels += expand("results/{sample}/annotation/somatic.short.indels.vcf",
sample=config["data"]["name"])

if len(indels) == 0:
Expand All @@ -710,7 +710,7 @@ def get_indels(wildcards):

return indels

def get_long_indels(wildcards):
def get_prioritization_long_indels(wildcards):
long_indels = []
if config["indel"]["activate"]:
if config["indel"]["type"] in ["long", "all"]:
Expand All @@ -723,20 +723,20 @@ def get_long_indels(wildcards):

return long_indels

def get_exitrons(wildcards):
def get_prioritization_exitrons(wildcards):
exitrons = []
if config["exitronsplicing"]["activate"]:
exitrons += expand("results/{sample}/annotation/exitrons.vcf",
sample=config["data"]["name"])

if len(snv) == 0:
if len(exitrons) == 0:
print(f"Could not detect any exitrons. Please check the config file")
sys.exit(1)

return exitrons


def get_altsplicing(wildcards):
def get_prioritization_altsplicing(wildcards):
altsplicing = []
if config["altsplicing"]["activate"]:
altsplicing += expand("results/{sample}/annotation/altsplicing.vcf",
Expand All @@ -748,31 +748,26 @@ def get_altsplicing(wildcards):

return altsplicing

def get_custom(wildcards):
def get_prioritization_custom(wildcards):
custom = []
if config["data"]["custom"]["variants"] is not None:
variants += expand("results/{sample}/annotation/custom.vcf",
custom += expand("results/{sample}/annotation/custom.vcf",
sample=config["data"]["name"])

if len(snv) == 0:
print(f"Could not detect any custom events. Please check the config file")
sys.exit(1)

return custom


def get_mhcI(wildcards):
def get_prioritization_mhcI(wildcards):
alleles = []
if config['prioritization']['class'] in ['I', 'BOTH']:
alleles += expand("results/{sample}/hla/mhc-I.tsv",
sample=config['data']['name'])

return alleles

def get_mhcII(wildcards):
def get_prioritization_mhcII(wildcards):
alleles = []
if config['prioritization']['class'] in ['II', 'BOTH']:
alleles += expand("results/{sample}/hla/mhc-II.tsv",
sample=config['data']['name'])
return alleles

15 changes: 7 additions & 8 deletions workflow/rules/prioritization.smk
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ rule download_prediction_binding_affinity_tools:

rule prioritization:
input:
snv=get_snvs,
indels=get_indels,
long_indels=get_long_indels,
exitrons=get_exitrons,
altsplicing=get_altsplicing,
snv=get_prioritization_snvs,
indels=get_prioritization_indels,
long_indels=get_prioritization_long_indels,
altsplicing=get_prioritization_altsplicing,
fusions=get_fusions,
custom=get_custom,
mhcI=get_mhcI,
mhcII=get_mhcII,
custom=get_prioritization_custom,
mhcI=get_prioritization_mhcI,
mhcII=get_prioritization_mhcII,
refgenome="resources/refs/genome.fasta",
peptide="resources/refs/peptide.fasta",
annotation="resources/refs/genome_tmp.gtf",
Expand Down

0 comments on commit 3f83514

Please sign in to comment.