Skip to content

Commit 605ca23

Browse files
committed
Fix lint CI: snakefmt smk files + .tests-relative samples path
- snakefmt 2.0.0 reflow of align.smk and common.smk (formatting job) - config_basic samples path made .tests-relative so it resolves under the lint action's directory: .tests (was double-prefixed to .tests/.tests/... -> FileNotFoundError at Snakefile:19)
1 parent f0a199f commit 605ca23

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

.tests/integration/config_basic/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ threads: 30
66
mapq: 30 # overall required mapping quality
77
basequal: 20 # overall required base quality
88

9-
samples: .tests/integration/config_basic/samples.tsv
9+
samples: integration/config_basic/samples.tsv
1010

1111
### pre-processing (only applied on fastq reads)
1212
preproc:

workflow/rules/align.smk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ rule realign:
228228
bam="results/{sample}/{seqtype}/align/{group}_final_BWA.bam",
229229
log:
230230
"logs/{sample}/align/realign_{seqtype}_{group}.log",
231+
wildcard_constraints:
232+
seqtype="rnaseq",
231233
conda:
232234
"../envs/basic.yml"
233235
threads: config["threads"]
234-
wildcard_constraints:
235-
seqtype="rnaseq",
236236
shell:
237237
"""
238238
(
@@ -294,9 +294,7 @@ rule dnaseq_final_BWA_stage:
294294
rule bwa_align_dnaseq:
295295
input:
296296
reads=get_dna_align_input,
297-
idx=multiext(
298-
"resources/refs/bwa/genome", ".amb", ".ann", ".bwt", ".pac", ".sa"
299-
),
297+
idx=multiext("resources/refs/bwa/genome", ".amb", ".ann", ".bwt", ".pac", ".sa"),
300298
output:
301299
"results/{sample}/dnaseq/align/{group}_aligned_BWA.bam",
302300
log:

workflow/rules/common.smk

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ print_run_summary(config, SAMPLES)
613613
########### PREPROCESSING ##########
614614
def get_raw_reads(wildcards):
615615
if SAMPLES[wildcards.sample]["rnaseq_readtype"] == "SE":
616-
return dict(zip(["sample"], SAMPLES[wildcards.sample]["rnaseq"][wildcards.group]))
616+
return dict(
617+
zip(["sample"], SAMPLES[wildcards.sample]["rnaseq"][wildcards.group])
618+
)
617619

618620

619621
# returns raw reads for a given sample
@@ -953,7 +955,9 @@ def get_rnaseq_star_bam(wildcards):
953955

954956
def get_star_input(wildcards):
955957
if SAMPLES[wildcards.sample]["rnaseq_filetype"] == ".bam":
956-
return dict(zip(["bam"], [SAMPLES[wildcards.sample]["rnaseq"][wildcards.group]]))
958+
return dict(
959+
zip(["bam"], [SAMPLES[wildcards.sample]["rnaseq"][wildcards.group]])
960+
)
957961

958962
elif (
959963
SAMPLES[wildcards.sample]["rnaseq_filetype"] == ".fq"
@@ -1440,26 +1444,25 @@ def get_prioritization_proteins(wildcards):
14401444
def get_prioritization_mhcI(wildcards):
14411445
alleles = []
14421446
if config["prioritization"]["class"] in ["I", "BOTH"]:
1443-
alleles += expand(
1444-
"results/{sample}/hla/mhc-I.tsv", sample=wildcards.sample
1445-
)
1447+
alleles += expand("results/{sample}/hla/mhc-I.tsv", sample=wildcards.sample)
14461448

14471449
return alleles
14481450

14491451

14501452
def get_prioritization_mhcII(wildcards):
14511453
alleles = []
14521454
if config["prioritization"]["class"] in ["II", "BOTH"]:
1453-
alleles += expand(
1454-
"results/{sample}/hla/mhc-II.tsv", sample=wildcards.sample
1455-
)
1455+
alleles += expand("results/{sample}/hla/mhc-II.tsv", sample=wildcards.sample)
14561456
return alleles
14571457

14581458

14591459
def get_prioritization_counts(wildcards):
14601460
counts = []
14611461
# counts can only be generated if either RNAseq or DNAseq data is provided
1462-
if len(SAMPLES[wildcards.sample]["rnaseq"]) != 0 or len(SAMPLES[wildcards.sample]["dnaseq"]) != 0:
1462+
if (
1463+
len(SAMPLES[wildcards.sample]["rnaseq"]) != 0
1464+
or len(SAMPLES[wildcards.sample]["dnaseq"]) != 0
1465+
):
14631466

14641467
# make sure indels are called from rnaseq/dnaseq data
14651468

0 commit comments

Comments
 (0)