diff --git a/.tests/integration/units.tsv b/.tests/integration/units.tsv index 8a3d478..1de2a43 100644 --- a/.tests/integration/units.tsv +++ b/.tests/integration/units.tsv @@ -1,4 +1,4 @@ sample type platform machine flowcell lane barcode fastq1 fastq2 adapter -HD827sonic N NextSeq NDX550220 HKTG2BGXG lane1 ACGGAACA+ACGAGAAC fastq/HD827sonic_testing1_R1.fastq.gz fastq/HD827sonic_testing1_R2.fastq.gz AGATCGGAAGAGCACACGTCTGAACTCCAGTCA,AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT -HD827sonic N NextSeq NDX550220 HKTG2BGXG lane2 ACGGAACA+ACGAGAAC fastq/HD827sonic_testing2_R1.fastq.gz fastq/HD827sonic_testing2_R2.fastq.gz AGATCGGAAGAGCACACGTCTGAACTCCAGTCA,AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT -HD827sonic T NextSeq NDX550220 HKTG2BGXG lane3 ACGGAACA+ACGAGAAC fastq/HD827sonic_testing3_R1.fastq.gz fastq/HD827sonic_testing3_R2.fastq.gz AGATCGGAAGAGCACACGTCTGAACTCCAGTCA,AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT +HD827sonic N NextSeq NDX550220 HKTG2BGXG L001 ACGGAACA+ACGAGAAC fastq/HD827sonic_testing1_R1.fastq.gz fastq/HD827sonic_testing1_R2.fastq.gz AGATCGGAAGAGCACACGTCTGAACTCCAGTCA,AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT +HD827sonic N NextSeq NDX550220 HKTG2BGXG L001 ACGGAACA+ACGAGAAG fastq/HD827sonic_testing2_R1.fastq.gz fastq/HD827sonic_testing2_R2.fastq.gz AGATCGGAAGAGCACACGTCTGAACTCCAGTCA,AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT +HD827sonic T NextSeq NDX550220 HKTG2BGXG L002 ACGGAACA+ACGAGAAT fastq/HD827sonic_testing3_R1.fastq.gz fastq/HD827sonic_testing3_R2.fastq.gz AGATCGGAAGAGCACACGTCTGAACTCCAGTCA,AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index 77adcf0..92ae978 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -45,6 +45,9 @@ validate(units, schema="../schemas/units.schema.yaml") wildcard_constraints: + barcode="[A-Z+]+", + flowcell="[A-Z0-9]+", + lane="L[0-9]+", sample="|".join(get_samples(samples)), unit="N|T|R", read="fastq[1|2]", @@ -55,8 +58,8 @@ wildcard_constraints: if config.get("trimmer_software", None) == "fastp_pe": merged_input = lambda wildcards: expand( - "prealignment/fastp_pe/{{sample}}_{flowcell_lane}_{{type}}_{{read}}.fastq.gz", - flowcell_lane=[ + "prealignment/fastp_pe/{{sample}}_{flowcell_lane_barcode}_{{type}}_{{read}}.fastq.gz", + flowcell_lane_barcode=[ "{}_{}_{}".format(unit.flowcell, unit.lane, unit.barcode) for unit in get_units(units, wildcards, wildcards.type) ], ) diff --git a/workflow/rules/merged.smk b/workflow/rules/merged.smk index 0110587..c233bb5 100644 --- a/workflow/rules/merged.smk +++ b/workflow/rules/merged.smk @@ -8,7 +8,7 @@ rule merged: input: fastq=merged_input, output: - fastq="prealignment/merged/{sample}_{type}_{read}.fastq.gz", + fastq=temp("prealignment/merged/{sample}_{type}_{read}.fastq.gz"), log: "prealignment/merged/{sample}_{type}_{read}.fastq.gz.log", benchmark: diff --git a/workflow/schemas/units.schema.yaml b/workflow/schemas/units.schema.yaml index fcad372..11f4761 100644 --- a/workflow/schemas/units.schema.yaml +++ b/workflow/schemas/units.schema.yaml @@ -23,6 +23,7 @@ properties: lane: type: string description: lane number + pattern: "^L[0-9]+$" fastq1: type: string description: absolute path to R1 fastq file