mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
test(samtools): Refactor flagstat to use pytest-workflow
This commit is contained in:
parent
ebf3a4529f
commit
34d86427a6
8 changed files with 37 additions and 62 deletions
22
.github/workflows/software/samtools_flagstat.yml
vendored
22
.github/workflows/software/samtools_flagstat.yml
vendored
|
@ -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/samtools/flagstat/test/ -profile docker
|
||||
# Test the module
|
||||
- run: pytest --tag samtools_flagstat --symlink --wt 2
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/bam/test.paired_end.sorted.bam
|
|
@ -1 +0,0 @@
|
|||
../../../../../tests/data/bam/test.paired_end.sorted.bam.bai
|
|
@ -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()
|
||||
}
|
|
@ -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,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)
|
15
tests/software/samtools/main.nf
Normal file
15
tests/software/samtools/main.nf
Normal 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 )
|
||||
}
|
8
tests/software/samtools/test.yml
Normal file
8
tests/software/samtools/test.yml
Normal 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
|
Loading…
Reference in a new issue