Skip to content

Commit

Permalink
Fixed Issues when no normal samples is provided (#9)
Browse files Browse the repository at this point in the history
When no 'normal' samples are provided, ScanNeo2 aborts since it checks the sample keys against a NoneType. This has been fixed.
  • Loading branch information
riasc authored Feb 11, 2024
1 parent 47ef41d commit 38b197f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions workflow/envs/gatk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- bioconda
dependencies:
- gatk4

16 changes: 14 additions & 2 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def all_identical(l):
else:
return False


# load up the config
config['data'] = data_structure(config['data'])

Expand Down Expand Up @@ -206,6 +207,11 @@ def get_predicted_mhcI_alleles(wildcards):
if "DNA" in config['hlatyping']['MHC-I_mode']:
if config['data']['dnaseq'] is not None:
for key in config['data']['dnaseq'].keys():

if config['data']['normal'] is not None:
if key in config['data']['normal']:
continue

if key not in config['data']['normal']:
values += expand("results/{sample}/hla/mhc-I/genotyping/{group}_{type}_{readtype}.tsv",
sample = wildcards.sample,
Expand All @@ -219,8 +225,14 @@ def get_predicted_mhcI_alleles(wildcards):
if "RNA" in config['hlatyping']['MHC-I_mode']:
if config['data']['rnaseq'] is not None:
for key in config['data']['rnaseq'].keys():
if key not in config['data']['normal']:
values += expand("results/{sample}/hla/mhc-I/genotyping/{group}_{type}_{readtype}.tsv",

# exclude normal samples (if specified)
if config['data']['normal'] is not None:
normal = config['data']['normal'].split(' ')
if key in normal:
continue

values += expand("results/{sample}/hla/mhc-I/genotyping/{group}_{type}_{readtype}.tsv",
sample = wildcards.sample,
group = key,
type = "RNA",
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/hlatyping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ rule merge_predicted_mhcI_allels:
input:
get_predicted_mhcI_alleles
output:
"results/{sample}/hla/genotyping/mhc-I.tsv",
"results/{sample}/hla/mhc-I/genotyping/mhc-I.tsv",
message:
"Merging HLA alleles from different sources"
log:
Expand Down

0 comments on commit 38b197f

Please sign in to comment.