Adding tests for bcftools

This commit is contained in:
JoseEspinosa 2021-02-02 09:14:00 +01:00
parent 579de3e038
commit a3ce63c79c
8 changed files with 382 additions and 0 deletions

40
.github/workflows/bcftools_bgzip.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: bcftools_bgzip
on:
push:
paths:
- software/bcftools/bgzip/**
- .github/workflows/bcftools_bgzip.yml
- tests/software/bcftools/**
pull_request:
paths:
- software/bcftools/bgzip/**
- .github/workflows/bcftools_bgzip.yml
- tests/software/bcftools/**
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 bcftools_bgzip --symlink --wt 2

View file

@ -0,0 +1,44 @@
name: bcftools_consensus
on:
push:
paths:
- software/bcftools/bgzip/**
- software/bcftools/tabix/**
- software/bcftools/consensus/**
- .github/workflows/bcftools_consensus.yml
- tests/software/bcftools/**
pull_request:
paths:
- software/bcftools/bgzip/**
- software/bcftools/tabix/**
- software/bcftools/consensus/**
- .github/workflows/bcftools_consensus.yml
- tests/software/bcftools/**
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 bcftools_consensus --symlink --wt 2

40
.github/workflows/bcftools_filter.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: bcftools_filter
on:
push:
paths:
- software/bcftools/filter/**
- .github/workflows/bcftools_filter.yml
- tests/software/bcftools/**
pull_request:
paths:
- software/bcftools/filter/**
- .github/workflows/bcftools_filter.yml
- tests/software/bcftools/**
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 bcftools_filter --symlink --wt 2

40
.github/workflows/bcftools_stats.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: bcftools_stats
on:
push:
paths:
- software/bcftools/stats/**
- .github/workflows/bcftools_stats.yml
- tests/software/bcftools/**
pull_request:
paths:
- software/bcftools/stats/**
- .github/workflows/bcftools_stats.yml
- tests/software/bcftools/**
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 bcftools_stats --symlink --wt 2

42
.github/workflows/bcftools_tabix.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: bcftools_tabix
on:
push:
paths:
- software/bcftools/bgzip/**
- software/bcftools/tabix/**
- .github/workflows/bcftools_tabix.yml
- tests/software/bcftools/**
pull_request:
paths:
- software/bcftools/bgzip/**
- software/bcftools/tabix/**
- .github/workflows/bcftools_tabix.yml
- tests/software/bcftools/**
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 bcftools_tabix --symlink --wt 2

View file

@ -0,0 +1,64 @@
# This file was produced by bcftools stats (1.11+htslib-1.11) and can be plotted using plot-vcfstats.
# The command line was: bcftools stats test.vcf
#
# Definition of sets:
# ID [2]id [3]tab-separated file names
ID 0 test.vcf
# SN, Summary numbers:
# number of records .. number of data rows in the VCF
# number of no-ALTs .. reference-only sites, ALT is either "." or identical to REF
# number of SNPs .. number of rows with a SNP
# number of MNPs .. number of rows with a MNP, such as CC>TT
# number of indels .. number of rows with an indel
# number of others .. number of rows with other type, for example a symbolic allele or
# a complex substitution, such as ACT>TCGA
# number of multiallelic sites .. number of rows with multiple alternate alleles
# number of multiallelic SNP sites .. number of rows with multiple alternate alleles, all SNPs
#
# Note that rows containing multiple types will be counted multiple times, in each
# counter. For example, a row with a SNP and an indel increments both the SNP and
# the indel counter.
#
# SN [2]id [3]key [4]value
SN 0 number of samples: 1
SN 0 number of records: 15
SN 0 number of no-ALTs: 2
SN 0 number of SNPs: 7
SN 0 number of MNPs: 0
SN 0 number of indels: 3
SN 0 number of others: 3
SN 0 number of multiallelic sites: 1
SN 0 number of multiallelic SNP sites: 1
# TSTV, transitions/transversions:
# TSTV [2]id [3]ts [4]tv [5]ts/tv [6]ts (1st ALT) [7]tv (1st ALT) [8]ts/tv (1st ALT)
TSTV 0 3 5 0.60 3 4 0.75
# SiS, Singleton stats:
# SiS [2]id [3]allele count [4]number of SNPs [5]number of transitions [6]number of transversions [7]number of indels [8]repeat-consistent [9]repeat-inconsistent [10]not applicable
SiS 0 1 8 3 5 3 0 0 3
# AF, Stats by non-reference allele frequency:
# AF [2]id [3]allele frequency [4]number of SNPs [5]number of transitions [6]number of transversions [7]number of indels [8]repeat-consistent [9]repeat-inconsistent [10]not applicable
AF 0 0.000000 8 3 5 3 0 0 3
# QUAL, Stats by quality:
# QUAL [2]id [3]Quality [4]number of SNPs [5]number of transitions (1st ALT) [6]number of transversions (1st ALT) [7]number of indels
QUAL 0 998 7 3 4 3
# IDD, InDel distribution:
# IDD [2]id [3]length (deletions negative) [4]number of sites [5]number of genotypes [6]mean VAF
IDD 0 -2 1 0 .
IDD 0 3 1 0 .
IDD 0 8 1 0 .
# ST, Substitution types:
# ST [2]id [3]type [4]count
ST 0 A>C 1
ST 0 A>G 0
ST 0 A>T 0
ST 0 C>A 2
ST 0 C>G 0
ST 0 C>T 1
ST 0 G>A 1
ST 0 G>C 0
ST 0 G>T 0
ST 0 T>A 2
ST 0 T>C 1
ST 0 T>G 0
# DP, Depth distribution
# DP [2]id [3]bin [4]number of genotypes [5]fraction of genotypes (%) [6]number of sites [7]fraction of sites (%)

View file

@ -0,0 +1,64 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { BCFTOOLS_FILTER } from '../../../software/bcftools/filter/main.nf' addParams( options: [:] )
include { BCFTOOLS_STATS } from '../../../software/bcftools/stats/main.nf' addParams( options: [:] )
include { BCFTOOLS_BGZIP } from '../../../software/bcftools/bgzip/main.nf' addParams( options: [:] )
include { BCFTOOLS_TABIX } from '../../../software/bcftools/tabix/main.nf' addParams( options: [:] )
include { BCFTOOLS_CONSENSUS } from '../../../software/bcftools/consensus/main.nf' addParams( options: [:] )
workflow test_bcftools_filter {
def input = []
input = [ [ id:'test' ], // meta map
file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]
BCFTOOLS_FILTER ( input )
}
workflow test_bcftools_stats {
def input = []
input = [ [ id:'test' ], // meta map
file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]
BCFTOOLS_STATS ( input )
}
workflow test_bcftools_bgzip {
def input = []
input = [ [ id:'test' ], // meta map
file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]
BCFTOOLS_BGZIP ( input )
}
workflow test_bcftools_tabix {
def input = []
input = [ [ id:'test' ], // meta map
file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]
BCFTOOLS_BGZIP ( input )
BCFTOOLS_TABIX ( BCFTOOLS_BGZIP.out.vcf )
}
workflow test_bcftools_consensus {
def input = []
input = [ [ id:'test' ], // meta map
file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]
def fasta = []
fasta = Channel.of ([ [ id:'test' ], // meta map
file("${launchDir}/tests/data/vcf/test.consensus.fa", checkIfExists: true) ])
BCFTOOLS_BGZIP ( input )
BCFTOOLS_TABIX ( BCFTOOLS_BGZIP.out.vcf )
BCFTOOLS_CONSENSUS ( BCFTOOLS_BGZIP.out.vcf
.join( BCFTOOLS_TABIX.out.tbi, by: [0] )
.join( fasta, by: [0] ) )
}

View file

@ -0,0 +1,48 @@
- name: Run bcftools filter test workflow
command: nextflow run ./tests/software/bcftools/ -profile docker -entry test_bcftools_filter -c tests/config/nextflow.config
tags:
- bcftools
- bcftools_filter
files:
- path: output/bcftools/test.vcf.gz
md5sum: b994e60162fd97c118ddd45b08018d98
- name: Run bcftools stats test workflow
command: nextflow run ./tests/software/bcftools/ -profile docker -entry test_bcftools_stats -c tests/config/nextflow.config
tags:
- bcftools
- bcftools_stats
files:
- path: output/bcftools/test.bcftools_stats.txt
md5sum: abfc6a90f84e24b2cc7e92cbce06200a
- name: Run bcftools bgzip test workflow
command: nextflow run ./tests/software/bcftools/ -profile docker -entry test_bcftools_bgzip -c tests/config/nextflow.config
tags:
- bcftools
- bcftools_bgzip
files:
- path: output/bcftools/test.vcf.gz
md5sum: eb75ae1f08a1884f8edc59ed423471a2
- name: Run bcftools tabix test workflow
command: nextflow run ./tests/software/bcftools/ -profile docker -entry test_bcftools_tabix -c tests/config/nextflow.config
tags:
- bcftools
- bcftools_tabix
files:
- path: output/bcftools/test.vcf.gz.tbi
md5sum: 06d52177f819730dd409157914534e8d
- name: Run bcftools consensus test workflow
command: nextflow run ./tests/software/bcftools/ -profile docker -entry test_bcftools_consensus -c tests/config/nextflow.config
tags:
- bcftools
- bcftools_consensus
files:
- path: output/bcftools/test.vcf.gz
md5sum: eb75ae1f08a1884f8edc59ed423471a2
- path: output/bcftools/test.vcf.gz.tbi
md5sum: 06d52177f819730dd409157914534e8d
- path: output/bcftools/test.fa
md5sum: c9e7ac4537756a0b33bcf17117f9a065