From e2edf36db14d656e5087656275df36977dd77e7c Mon Sep 17 00:00:00 2001 From: Alex Thomas Date: Thu, 2 Mar 2023 17:24:42 +0000 Subject: [PATCH 1/6] add additional primer file for ont --- config/config.yaml | 4 +++- workflow/rules/long_read.smk | 4 ++-- workflow/rules/read_clipping.smk | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index afea4a946..a91b6f173 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -63,7 +63,9 @@ preprocessing: # for more information artic-primer-version: 3 # path to amplicon primers in bed format for hard-clipping on paired end files (illumina) or url to file that should be downloaded - amplicon-primers: "resources/nCoV-2019.primer.bed" + amplicon-primers: + ont: "resources/nCoV-2019.primer.bed" + illumina: "resources/nCoV-2019.primer.bed" # GenBank accession of reference sequence of the amplicon primers amplicon-reference: "MN908947" diff --git a/workflow/rules/long_read.smk b/workflow/rules/long_read.smk index 33e4cec03..178a5029c 100644 --- a/workflow/rules/long_read.smk +++ b/workflow/rules/long_read.smk @@ -56,7 +56,7 @@ rule nanofilt: rule downsample_and_trim_raw: input: - primer=config["preprocessing"]["amplicon-primers"], + primer=get_primer_file(sample), reads="results/{date}/filtered/nanofilt/{sample}.fastq", ref_genome="resources/genomes/main.fasta", output: @@ -121,7 +121,7 @@ rule canu_correct: rule clip_adbc_corrected: input: - primer=config["preprocessing"]["amplicon-primers"], + primer=config["preprocessing"]["amplicon-primers"]["ont"], reads="results/{date}/corrected/{sample}/{sample}.correctedReads.fasta", ref_genome="resources/genomes/main.fasta", output: diff --git a/workflow/rules/read_clipping.smk b/workflow/rules/read_clipping.smk index 8d93acc74..c759c5e05 100644 --- a/workflow/rules/read_clipping.smk +++ b/workflow/rules/read_clipping.smk @@ -22,7 +22,7 @@ rule samtools_sort: rule bed_to_bedpe: input: - check_bed_for_URL(config["preprocessing"]["amplicon-primers"]), + check_bed_for_URL(config["preprocessing"]["amplicon-primers"]["illumina"]), output: "resources/primer.bedpe", log: From 206815e60d66a4a9637388411ed14b9b1cb1138f Mon Sep 17 00:00:00 2001 From: Alex Thomas Date: Thu, 2 Mar 2023 17:47:31 +0000 Subject: [PATCH 2/6] change config scheme --- workflow/schemas/config.schema.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/workflow/schemas/config.schema.yaml b/workflow/schemas/config.schema.yaml index d4d498813..706ab47f8 100644 --- a/workflow/schemas/config.schema.yaml +++ b/workflow/schemas/config.schema.yaml @@ -67,8 +67,13 @@ properties: type: integer description: only for Oxford Nanopore data. ARTIC primer version to clip from reads amplicon-primers: - type: string - description: path to amplicon primers in bedpe format for hard-clipping on paired end files (illumina) + properties: + ont: + type: string + description: path to amplicon primers in bed format for hard-clipping on single end files (Oxford Nanopore) + illumina: + type: string + description: path to amplicon primers in bed format for hard-clipping on paired end files (Illumina) amplicon-reference: type: string description: GenBank accession of reference sequence of the amplicon primers From 90eff7356e4f4352a6ecb033f9af931cf63abcdb Mon Sep 17 00:00:00 2001 From: Alex Thomas Date: Thu, 2 Mar 2023 17:53:07 +0000 Subject: [PATCH 3/6] fix path --- workflow/rules/long_read.smk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/rules/long_read.smk b/workflow/rules/long_read.smk index 178a5029c..83f6c994a 100644 --- a/workflow/rules/long_read.smk +++ b/workflow/rules/long_read.smk @@ -56,7 +56,7 @@ rule nanofilt: rule downsample_and_trim_raw: input: - primer=get_primer_file(sample), + primer=config["preprocessing"]["amplicon-primers"]["ont"], reads="results/{date}/filtered/nanofilt/{sample}.fastq", ref_genome="resources/genomes/main.fasta", output: From c253aa88b60b1d6ebeac5c452c3f95cc09750f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Thu, 2 Mar 2023 19:32:37 +0100 Subject: [PATCH 4/6] fix schema structure --- workflow/schemas/config.schema.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/schemas/config.schema.yaml b/workflow/schemas/config.schema.yaml index 706ab47f8..b0d0278ac 100644 --- a/workflow/schemas/config.schema.yaml +++ b/workflow/schemas/config.schema.yaml @@ -67,11 +67,12 @@ properties: type: integer description: only for Oxford Nanopore data. ARTIC primer version to clip from reads amplicon-primers: + type: object properties: ont: type: string description: path to amplicon primers in bed format for hard-clipping on single end files (Oxford Nanopore) - illumina: + illumina: type: string description: path to amplicon primers in bed format for hard-clipping on paired end files (Illumina) amplicon-reference: From fecd188a64fce00955f6a5e8fec27796f4ff5cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Thu, 2 Mar 2023 19:39:11 +0100 Subject: [PATCH 5/6] fix config structure for testcase --- .tests/config/config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tests/config/config.yaml b/.tests/config/config.yaml index 25a8ea6f4..bc839d9bc 100644 --- a/.tests/config/config.yaml +++ b/.tests/config/config.yaml @@ -77,7 +77,8 @@ preprocessing: # for more information artic-primer-version: 3 # path to amplicon primers in bedpe format for hard-clipping on paired end files (illumina) - amplicon-primers: "resources/nCoV-2019.primer.bed" + amplicon-primers: + illumina: "resources/nCoV-2019.primer.bed" # GenBank accession of reference sequence of the amplicon primers amplicon-reference: "MN908947" From 1ed083dbab00fdf489e1d63f0085b92d9a0a2820 Mon Sep 17 00:00:00 2001 From: Alex Thomas Date: Fri, 3 Mar 2023 12:59:02 +0000 Subject: [PATCH 6/6] change also .tests/config --- .tests/config/config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tests/config/config.yaml b/.tests/config/config.yaml index bc839d9bc..affb3f1a5 100644 --- a/.tests/config/config.yaml +++ b/.tests/config/config.yaml @@ -77,7 +77,8 @@ preprocessing: # for more information artic-primer-version: 3 # path to amplicon primers in bedpe format for hard-clipping on paired end files (illumina) - amplicon-primers: + amplicon-primers: + ont: "resources/nCoV-2019.primer.bed" illumina: "resources/nCoV-2019.primer.bed" # GenBank accession of reference sequence of the amplicon primers amplicon-reference: "MN908947"