test(samtools): Refactor flagstat to use pytest-workflow

This commit is contained in:
Edmund Miller 2020-11-24 19:55:52 -06:00
parent ebf3a4529f
commit 34d86427a6
No known key found for this signature in database
GPG key ID: BD387FF7BC10AA9D
8 changed files with 37 additions and 62 deletions

View file

@ -17,7 +17,6 @@ jobs:
env: env:
NXF_ANSI_LOG: false NXF_ANSI_LOG: false
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install Nextflow - name: Install Nextflow
@ -26,5 +25,12 @@ jobs:
wget -qO- get.nextflow.io | bash wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/ 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 # Test the module
- run: nextflow run ./software/samtools/flagstat/test/ -profile docker - run: pytest --tag samtools_flagstat --symlink --wt 2

View file

@ -1 +0,0 @@
../../../../../tests/data/bam/test.paired_end.sorted.bam

View file

@ -1 +0,0 @@
../../../../../tests/data/bam/test.paired_end.sorted.bam.bai

View file

@ -1,19 +0,0 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SAMTOOLS_FLAGSTAT } from '../main.nf' addParams( options: [:] )
workflow test {
def input = []
input = [ [ id:'test', single_end:false ], // meta map
file("${baseDir}/input/test.paired_end.sorted.bam", checkIfExists: true),
file("${baseDir}/input/test.paired_end.sorted.bam.bai", checkIfExists: true) ]
SAMTOOLS_FLAGSTAT ( input )
}
workflow {
test()
}

View file

@ -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
}
}

View file

@ -1,13 +0,0 @@
20000 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
20000 + 0 mapped (100.00% : N/A)
20000 + 0 paired in sequencing
10000 + 0 read1
10000 + 0 read2
20000 + 0 properly paired (100.00% : N/A)
20000 + 0 with itself and mate mapped
0 + 0 singletons (0.00% : N/A)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SAMTOOLS_FLAGSTAT } from '../../../software/samtools/flagstat/main.nf' addParams( options: [:] )
workflow test_samtools_flagstat {
def input = []
input = [ [ id:'test', single_end:false ], // meta map
file("${launchDir}/tests/data/bam/test.paired_end.sorted.bam", checkIfExists: true),
file("${launchDir}/tests/data/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) ]
SAMTOOLS_FLAGSTAT ( input )
}

View file

@ -0,0 +1,8 @@
- name: Run samtools flagstat test workflow
command: nextflow run ./tests/software/samtools/ -profile docker -entry test_samtools_flagstat -c tests/config/nextflow.config
tags:
- samtools
- samtools_flagstat
files:
- path: output/samtools/test.paired_end.sorted.bam.flagstat
md5sum: 80590621c74f5ee43ada20d010a3837f