diff --git a/.github/workflows/software/bwa_index.yml b/.github/workflows/software/bwa_index.yml index c15c35c9..7a045703 100644 --- a/.github/workflows/software/bwa_index.yml +++ b/.github/workflows/software/bwa_index.yml @@ -17,14 +17,20 @@ jobs: env: NXF_ANSI_LOG: false steps: + - uses: actions/checkout@v2 - - uses: actions/checkout@v2 + - name: Install Nextflow + run: | + export NXF_VER="20.07.1" + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ - - name: Install Nextflow - run: | - export NXF_VER="20.07.1" - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip pytest-workflow - # Test the module - - run: nextflow run ./software/bwa/index/test/ -profile docker + # Test the module + - run: pytest --tag bwa_index --symlink --wt 2 diff --git a/.github/workflows/software/bwa_mem.yml b/.github/workflows/software/bwa_mem.yml index 7f463471..20c438f6 100644 --- a/.github/workflows/software/bwa_mem.yml +++ b/.github/workflows/software/bwa_mem.yml @@ -17,14 +17,20 @@ jobs: env: NXF_ANSI_LOG: false steps: + - uses: actions/checkout@v2 - - uses: actions/checkout@v2 + - name: Install Nextflow + run: | + export NXF_VER="20.07.1" + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ - - name: Install Nextflow - run: | - export NXF_VER="20.07.1" - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip pytest-workflow - # Test the module - - run: nextflow run ./software/bwa/mem/test/ -profile docker + # Test the module + - run: pytest --tag bwa_index --symlink --wt 2 diff --git a/software/bwa/index/test/input/NC_010473.fa b/software/bwa/index/test/input/NC_010473.fa deleted file mode 120000 index d2298ff8..00000000 --- a/software/bwa/index/test/input/NC_010473.fa +++ /dev/null @@ -1 +0,0 @@ -../../../../../tests/data/fasta/E_coli/NC_010473.fa \ No newline at end of file diff --git a/software/bwa/index/test/main.nf b/software/bwa/index/test/main.nf deleted file mode 100644 index ef0db3ef..00000000 --- a/software/bwa/index/test/main.nf +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BWA_INDEX } from '../main.nf' addParams( options: [:] ) - -workflow test { - BWA_INDEX ( file("${baseDir}/input/NC_010473.fa", checkIfExists: true) ) -} - -workflow { - test() -} diff --git a/software/bwa/index/test/nextflow.config b/software/bwa/index/test/nextflow.config deleted file mode 100644 index 4149feea..00000000 --- a/software/bwa/index/test/nextflow.config +++ /dev/null @@ -1,20 +0,0 @@ - -params { - outdir = "output/" - publish_dir_mode = "copy" - enable_conda = false -} - -profiles { - conda { - params.enable_conda = true - } - docker { - docker.enabled = true - docker.runOptions = '-u \$(id -u):\$(id -g)' - } - singularity { - singularity.enabled = true - singularity.autoMounts = true - } -} diff --git a/software/bwa/index/test/output/bwa/NC_010473.fa.amb b/software/bwa/index/test/output/bwa/NC_010473.fa.amb deleted file mode 100644 index 7355c4ea..00000000 --- a/software/bwa/index/test/output/bwa/NC_010473.fa.amb +++ /dev/null @@ -1,3 +0,0 @@ -4686137 1 2 -20895 1 Y -142347 1 R diff --git a/software/bwa/index/test/output/bwa/NC_010473.fa.ann b/software/bwa/index/test/output/bwa/NC_010473.fa.ann deleted file mode 100644 index ddfe94ec..00000000 --- a/software/bwa/index/test/output/bwa/NC_010473.fa.ann +++ /dev/null @@ -1,3 +0,0 @@ -4686137 1 11 -0 gi|170079663|ref|NC_010473.1| Escherichia coli str. K-12 substr. DH10B, complete genome -0 4686137 2 diff --git a/software/bwa/index/test/output/bwa/NC_010473.fa.bwt b/software/bwa/index/test/output/bwa/NC_010473.fa.bwt deleted file mode 100644 index 855b64ae..00000000 Binary files a/software/bwa/index/test/output/bwa/NC_010473.fa.bwt and /dev/null differ diff --git a/software/bwa/index/test/output/bwa/NC_010473.fa.pac b/software/bwa/index/test/output/bwa/NC_010473.fa.pac deleted file mode 100644 index 3aebd5a6..00000000 Binary files a/software/bwa/index/test/output/bwa/NC_010473.fa.pac and /dev/null differ diff --git a/software/bwa/index/test/output/bwa/NC_010473.fa.sa b/software/bwa/index/test/output/bwa/NC_010473.fa.sa deleted file mode 100644 index 3ad7129d..00000000 Binary files a/software/bwa/index/test/output/bwa/NC_010473.fa.sa and /dev/null differ diff --git a/software/bwa/mem/test/input/Ecoli_DNA_R1.fastq.gz b/software/bwa/mem/test/input/Ecoli_DNA_R1.fastq.gz deleted file mode 120000 index 8b5dcc03..00000000 --- a/software/bwa/mem/test/input/Ecoli_DNA_R1.fastq.gz +++ /dev/null @@ -1 +0,0 @@ -../../../../../tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz \ No newline at end of file diff --git a/software/bwa/mem/test/input/Ecoli_DNA_R2.fastq.gz b/software/bwa/mem/test/input/Ecoli_DNA_R2.fastq.gz deleted file mode 120000 index 097c7dc9..00000000 --- a/software/bwa/mem/test/input/Ecoli_DNA_R2.fastq.gz +++ /dev/null @@ -1 +0,0 @@ -../../../../../tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz \ No newline at end of file diff --git a/software/bwa/mem/test/input/NC_010473.fa b/software/bwa/mem/test/input/NC_010473.fa deleted file mode 120000 index d2298ff8..00000000 --- a/software/bwa/mem/test/input/NC_010473.fa +++ /dev/null @@ -1 +0,0 @@ -../../../../../tests/data/fasta/E_coli/NC_010473.fa \ No newline at end of file diff --git a/software/bwa/mem/test/input/index b/software/bwa/mem/test/input/index deleted file mode 120000 index e269dc83..00000000 --- a/software/bwa/mem/test/input/index +++ /dev/null @@ -1 +0,0 @@ -../../../../../tests/data/index/E_coli/bwa/ \ No newline at end of file diff --git a/software/bwa/mem/test/main.nf b/software/bwa/mem/test/main.nf deleted file mode 100755 index 4d93e720..00000000 --- a/software/bwa/mem/test/main.nf +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BWA_MEM as BWA_MEM_SE } from '../main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) -include { BWA_MEM as BWA_MEM_PE } from '../main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) - -/* - * Test with single-end data - */ -workflow test_single_end { - - def input = [] - input = [ [ id:'test', single_end:true ], // meta map - [ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] - - BWA_MEM_SE ( - input, - file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${baseDir}/input/NC_010473.fa", checkIfExists: true) - ) -} - -/* - * Test with paired-end data - */ -workflow test_paired_end { - - def input = [] - input = [ [ id:'test', single_end:false ], // meta map - [ file("${baseDir}/input/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), - file("${baseDir}/input/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] - - BWA_MEM_PE ( - input, - file("${baseDir}/input/index/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), - file("${baseDir}/input/NC_010473.fa", checkIfExists: true) - ) -} - -workflow { - test_single_end() - test_paired_end() -} diff --git a/software/bwa/mem/test/nextflow.config b/software/bwa/mem/test/nextflow.config deleted file mode 100644 index 4149feea..00000000 --- a/software/bwa/mem/test/nextflow.config +++ /dev/null @@ -1,20 +0,0 @@ - -params { - outdir = "output/" - publish_dir_mode = "copy" - enable_conda = false -} - -profiles { - conda { - params.enable_conda = true - } - docker { - docker.enabled = true - docker.runOptions = '-u \$(id -u):\$(id -g)' - } - singularity { - singularity.enabled = true - singularity.autoMounts = true - } -} diff --git a/software/bwa/mem/test/output/test_paired_end/test.bam b/software/bwa/mem/test/output/test_paired_end/test.bam deleted file mode 100644 index 75b56194..00000000 Binary files a/software/bwa/mem/test/output/test_paired_end/test.bam and /dev/null differ diff --git a/software/bwa/mem/test/output/test_single_end/test.bam b/software/bwa/mem/test/output/test_single_end/test.bam deleted file mode 100644 index 7bd8d461..00000000 Binary files a/software/bwa/mem/test/output/test_single_end/test.bam and /dev/null differ diff --git a/tests/software/bwa/main.nf b/tests/software/bwa/main.nf new file mode 100644 index 00000000..a4dcdbbf --- /dev/null +++ b/tests/software/bwa/main.nf @@ -0,0 +1,44 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWA_INDEX } from '../../../software/bwa/index/main.nf' addParams( options: [:] ) +include { BWA_MEM as BWA_MEM_SE } from '../../../software/bwa/mem/main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) +include { BWA_MEM as BWA_MEM_PE } from '../../../software/bwa/mem/main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) + +workflow test_bwa_index { + BWA_INDEX ( file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) ) +} + +/* + * Test with single-end data + */ +workflow test_bwa_mem_single_end { + + def input = [] + input = [ [ id:'test', single_end:true ], // meta map + [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ] + + BWA_MEM_SE ( + input, + file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), + file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + ) +} + +/* + * Test with paired-end data + */ +workflow test_bwa_mem_paired_end { + + def input = [] + input = [ [ id:'test', single_end:false ], // meta map + [ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true), + file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ] + + BWA_MEM_PE ( + input, + file("${launchDir}/tests/data/index/E_coli/bwa/NC_010473.fa.{amb,ann,bwt,pac,sa}", checkIfExists: true), + file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true) + ) +} diff --git a/tests/software/bwa/test.yml b/tests/software/bwa/test.yml new file mode 100644 index 00000000..9efefa1d --- /dev/null +++ b/tests/software/bwa/test.yml @@ -0,0 +1,32 @@ +- name: Run bwa index + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_index -c tests/config/nextflow.config + tags: + - bwa + - bwa_index + files: + - path: output/bwa/NC_010473.fa.amb + md5sum: 942a990ae872f1c0b8d72dda2db405d5 + - path: output/bwa/NC_010473.fa.bwt + md5sum: 7301b52e2ecb893d429a49fa692447ae + - path: output/bwa/NC_010473.fa.pac + md5sum: 4d5e6fc45bbc968f7f859e9ca2cc89ad + - path: output/bwa/NC_010473.fa.sa + md5sum: a47dcc92e750e2f16fbd979b8ff9538e + +- name: Run bwa mem single-end + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_single_end -c tests/config/nextflow.config + tags: + - bwa + - bwa_mem + files: + - path: output/test_single_end/test.bam + md5sum: 3ee21210bac387e0335008146e4728bc + +- name: Run bwa mem paired-end + command: nextflow run ./tests/software/bwa -profile docker -entry test_bwa_mem_paired_end -c tests/config/nextflow.config + tags: + - bwa + - bwa_mem + files: + - path: output/test_paired_end/test.bam + md5sum: 510d8acc6448c07cdacce8e64ec0904c diff --git a/tests/software/fastqc/main.nf b/tests/software/fastqc/main.nf index 597d56f6..629b4632 100644 --- a/tests/software/fastqc/main.nf +++ b/tests/software/fastqc/main.nf @@ -29,3 +29,5 @@ workflow test_paired_end { FASTQC_PE ( input ) } + +// TODO Test e2e