From 8ae62904652a8e354dd3dceb55f3be4da9eea03b Mon Sep 17 00:00:00 2001 From: jenmuell Date: Mon, 28 Oct 2024 16:18:40 +0100 Subject: [PATCH 1/2] added ampliseq samplesheet creation with minor issue --- modules/local/sra_to_samplesheet/main.nf | 5 ++ nextflow_schema.json | 2 +- .../sra_nf_core_pipeline_ampliseq.nf.test | 55 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test diff --git a/modules/local/sra_to_samplesheet/main.nf b/modules/local/sra_to_samplesheet/main.nf index 92edf5df..d6a24857 100644 --- a/modules/local/sra_to_samplesheet/main.nf +++ b/modules/local/sra_to_samplesheet/main.nf @@ -44,6 +44,11 @@ process SRA_TO_SAMPLESHEET { pipeline_map << [ replicate: 1 ] } else if (pipeline == 'taxprofiler') { pipeline_map << [ fasta: '' ] + } else if (pipeline == 'ampliseq'){ + pipeline_map << [sampleID: pipeline_map.sample] + pipeline_map << [forwardReads: pipeline_map.fastq_1] + pipeline_map << [reverseReads: pipeline_map.fastq_2] + pipeline_map << [ run: ''] } } pipeline_map << meta_clone diff --git a/nextflow_schema.json b/nextflow_schema.json index 29f7b710..e7f22b0e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -38,7 +38,7 @@ "type": "string", "fa_icon": "fab fa-apple", "description": "Name of supported nf-core pipeline e.g. 'rnaseq'. A samplesheet for direct use with the pipeline will be created with the appropriate columns.", - "enum": ["rnaseq", "atacseq", "viralrecon", "taxprofiler"] + "enum": ["rnaseq", "atacseq", "viralrecon", "taxprofiler", "ampliseq"] }, "nf_core_rnaseq_strandedness": { "type": "string", diff --git a/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test b/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test new file mode 100644 index 00000000..236154c1 --- /dev/null +++ b/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test @@ -0,0 +1,55 @@ +nextflow_workflow { + + name "Test workflow: sra/main.nf" + script "../main.nf" + workflow "SRA" + tag "SRA_NF_CORE_PIPELINE_AMPLISEQ" + + // Dependencies + tag "SRA_IDS_TO_RUNINFO" + tag "SRA_RUNINFO_TO_FTP" + tag "SRA_FASTQ_FTP" + tag "SRA_TO_SAMPLESHEET" + tag "MULTIQC_MAPPINGS_CONFIG" + + test("Parameters: --nf_core_pipeline ampliseq") { + + when { + workflow { + """ + input[0] = Channel.from("DRX026011", "ERX1234253", "SRX6725035") + """ + } + params { + nf_core_pipeline = "ampliseq" + } + } + + then { + assert workflow.success + + assertAll( + { + with(workflow.out.samplesheet) { + assert path(get(0)).readLines().size() == 4 + assert path(get(0)).readLines()*.split(',')[0].take(4) == ['"sampleID"', '"forwardReads"', '"reverseReads"', '"run"'] + assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"'] + assert path(get(0)).text.contains('Illumina HiSeq 2500') + } + }, + { + with(workflow.out.mappings) { + assert path(get(0)).readLines().size() == 4 + assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"'] + assert path(get(0)).text.contains('Illumina HiSeq 2500') + } + }, + { + with(workflow.out.sample_mappings) { + assert path(get(0)[0]).md5 == "1ac06bb95b503703430e74660bbdd768" + } + } + ) + } + } +} From 9c5ec4389aee856c566c026be1d42553afb2cf0d Mon Sep 17 00:00:00 2001 From: jenmuell Date: Tue, 29 Oct 2024 10:24:04 +0100 Subject: [PATCH 2/2] changes to work after standarization of ampliseq --- modules/local/sra_to_samplesheet/main.nf | 3 --- workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/local/sra_to_samplesheet/main.nf b/modules/local/sra_to_samplesheet/main.nf index d6a24857..b663692b 100644 --- a/modules/local/sra_to_samplesheet/main.nf +++ b/modules/local/sra_to_samplesheet/main.nf @@ -45,9 +45,6 @@ process SRA_TO_SAMPLESHEET { } else if (pipeline == 'taxprofiler') { pipeline_map << [ fasta: '' ] } else if (pipeline == 'ampliseq'){ - pipeline_map << [sampleID: pipeline_map.sample] - pipeline_map << [forwardReads: pipeline_map.fastq_1] - pipeline_map << [reverseReads: pipeline_map.fastq_2] pipeline_map << [ run: ''] } } diff --git a/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test b/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test index 236154c1..dbb553b7 100644 --- a/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test +++ b/workflows/sra/tests/sra_nf_core_pipeline_ampliseq.nf.test @@ -32,7 +32,7 @@ nextflow_workflow { { with(workflow.out.samplesheet) { assert path(get(0)).readLines().size() == 4 - assert path(get(0)).readLines()*.split(',')[0].take(4) == ['"sampleID"', '"forwardReads"', '"reverseReads"', '"run"'] + assert path(get(0)).readLines()*.split(',')[0].take(4) == ['"sample', '"fastq_1"', '"fastq_2"', '"run"'] assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"'] assert path(get(0)).text.contains('Illumina HiSeq 2500') }