Skip to content

Commit

Permalink
Rule error hlatyping (#27)
Browse files Browse the repository at this point in the history
* Wrong indentation in HLAtyping caused error when providing no normal sample (NoneType was being iterated

* Fixed missing input in get_reads_hlatyping_PE rule (tmp folder) that caused error when using paired-end reads

* added else case in get_input_hlatyping_PE rule for input reads when preprocessing is deactivated
  • Loading branch information
riasc committed Jun 20, 2024
1 parent 52a3818 commit 0ee4444
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Prioritization of neoantigens is now done separately for each variant type (speeds up the process)
- NMD information (e.g., escape rule,...) is now also calculated for all variants

## [0.2.5] - 2024-06-19

### Fix

- Wrong indentation in HLAtyping caused error when providing no normal sample (NoneType was being iterated)
- Fixed missing input in get_reads_hlatyping_PE rule (tmp folder) that caused error when using paired-end reads
- Added else case in get_input_hlatyping function (rule get_reads_hlatyping_PE) for input reads when preproc is deactivated

## [0.2.4] - 2024-05-19

### Fix
Expand Down
24 changes: 16 additions & 8 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ def get_input_hlatyping_PE(wildcards):
pair=["R1","R2"])
)
)
else:
return dict(
zip(
["fwd", "rev"],
config["data"][f"{wildcards.seqtype}"][wildcards.group]
)
)


def aggregate_mhcI_SE(wildcards):
Expand Down Expand Up @@ -214,17 +221,18 @@ 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():


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

if key not in config['data']['normal']:
values += expand("results/{sample}/hla/mhc-I/genotyping/{group}_{nartype}_{readtype}.tsv",
sample = wildcards.sample,
group = key,
nartype = "DNA",
readtype = config['data']['dnaseq_readtype']) # add either SE or PE
values += expand("results/{sample}/hla/mhc-I/genotyping/{group}_{nartype}_{readtype}.tsv",
sample = wildcards.sample,
group = key,
nartype = "DNA",
readtype = config['data']['dnaseq_readtype']) # add either SE or PE
else: # if no dnaseq data is specified, but mode is DNA or BOTH, then ignore
print('dnaseq data has not been specified in the config file, but specified mode for hla genotyping in config file is DNA or BOTH -- will be ignored')

Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/hlatyping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ rule get_reads_hlatyping_SE:

rule get_reads_hlatyping_PE:
input:
unpack(get_input_hlatyping_PE)
unpack(get_input_hlatyping_PE),
tmp="tmp/"
output:
fwd="results/{sample}/hla/reads/{group}_{nartype}_PE_R1.fq",
rev="results/{sample}/hla/reads/{group}_{nartype}_PE_R2.fq"
Expand Down

0 comments on commit 0ee4444

Please sign in to comment.