Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preseq testing #112

Merged
merged 14 commits into from
Jan 15, 2021
40 changes: 40 additions & 0 deletions .github/workflows/preseq_lcextrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: preseq_lcextrap
on:
push:
paths:
- software/preseq/lcextrap/**
- .github/workflows/preseq_lcextrap.yml
- tests/software/preseq/**
pull_request:
paths:
- software/preseq/lcextrap/**
- .github/workflows/preseq_lcextrap.yml
- tests/software/preseq/**

jobs:
ci_test:
runs-on: ubuntu-latest
strategy:
matrix:
nxf_version: [20.11.0-edge]
env:
NXF_ANSI_LOG: false
steps:
- uses: actions/checkout@v2

- name: Install Nextflow
env:
NXF_VER: ${{ matrix.nxf_version }}
run: |
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: pytest --tag preseq_lcextrap --symlink --wt 2
2 changes: 1 addition & 1 deletion software/preseq/lcextrap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ process PRESEQ_LCEXTRAP {
$options.args \\
$paired_end \\
-output ${prefix}.ccurve.txt \\
$bam
-bam $bam
edmundmiller marked this conversation as resolved.
Show resolved Hide resolved
cp .command.err ${prefix}.command.log

echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt
Expand Down
33 changes: 33 additions & 0 deletions tests/software/preseq/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { PRESEQ_LCEXTRAP as PRESEQ_LCEXTRAP_SE } from '../../../software/preseq/lcextrap/main.nf' addParams( options: [ publish_dir:'test_preseq_single_end' ] )
include { PRESEQ_LCEXTRAP as PRESEQ_LCEXTRAP_PE } from '../../../software/preseq/lcextrap/main.nf' addParams( options: [ publish_dir:'test_preseq_paired_end' ] )

/*
* Test with single-end data
*/

workflow test_preseq_single_end {

def input = []
input = [ [ id:'test', single_end:true ], // meta map
[ file('https://github.com/smithlabcode/preseq/raw/master/data/SRR1106616_5M_subset.bam', checkIfExists: true), ] ]

PRESEQ_LCEXTRAP_SE ( input )
}

/*
* Test with paired-end data
*/

workflow test_preseq_paired_end {

def input = []
input = [ [ id:'test', single_end:false ], // meta map
[ file('https://github.com/smithlabcode/preseq/raw/master/data/SRR1106616_5M_subset.bam', checkIfExists: true), ] ]

PRESEQ_LCEXTRAP_PE ( input )
}

21 changes: 21 additions & 0 deletions tests/software/preseq/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- name: Run preseq single-end lcextrap
command: nextflow run ./tests/software/preseq -profile docker -entry test_preseq_single_end -c tests/config/nextflow.config
tags:
- preseq
- preseq_lcextrap

files:
- path: output/test_preseq_single_end/test.ccurve.txt
md5sum: 5253ffcfd4b6162851631efdbfe16f92
- path: output/test_preseq_single_end/test.command.log

- name: Run preseq paired-end lcextrap
command: nextflow run ./tests/software/preseq -profile docker -entry test_preseq_paired_end -c tests/config/nextflow.config
tags:
- preseq
- preseq_lcextrap

files:
- path: output/test_preseq_paired_end/test.ccurve.txt
md5sum: 66b339780630fc1aa72dcfbd0a4490fd
- path: output/test_preseq_paired_end/test.command.log