mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
test(bwa): Refactor to use pytest-workflow
This commit is contained in:
parent
dfc8528df9
commit
016d8684f3
21 changed files with 106 additions and 124 deletions
10
.github/workflows/software/bwa_index.yml
vendored
10
.github/workflows/software/bwa_index.yml
vendored
|
@ -17,7 +17,6 @@ jobs:
|
|||
env:
|
||||
NXF_ANSI_LOG: false
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Nextflow
|
||||
|
@ -26,5 +25,12 @@ jobs:
|
|||
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
|
||||
- run: pytest --tag bwa_index --symlink --wt 2
|
||||
|
|
10
.github/workflows/software/bwa_mem.yml
vendored
10
.github/workflows/software/bwa_mem.yml
vendored
|
@ -17,7 +17,6 @@ jobs:
|
|||
env:
|
||||
NXF_ANSI_LOG: false
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Nextflow
|
||||
|
@ -26,5 +25,12 @@ jobs:
|
|||
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
|
||||
- run: pytest --tag bwa_index --symlink --wt 2
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/fasta/E_coli/NC_010473.fa
|
|
@ -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()
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
4686137 1 2
|
||||
20895 1 Y
|
||||
142347 1 R
|
|
@ -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
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz
|
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz
|
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/fasta/E_coli/NC_010473.fa
|
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/index/E_coli/bwa/
|
|
@ -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()
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
44
tests/software/bwa/main.nf
Normal file
44
tests/software/bwa/main.nf
Normal file
|
@ -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)
|
||||
)
|
||||
}
|
32
tests/software/bwa/test.yml
Normal file
32
tests/software/bwa/test.yml
Normal file
|
@ -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
|
|
@ -29,3 +29,5 @@ workflow test_paired_end {
|
|||
|
||||
FASTQC_PE ( input )
|
||||
}
|
||||
|
||||
// TODO Test e2e
|
||||
|
|
Loading…
Reference in a new issue