-
Notifications
You must be signed in to change notification settings - Fork 3
Testing
Andrea Telatin edited this page Oct 26, 2021
·
5 revisions
This repository is automatically tested at each release by TravisCI
GitHub Actions. The automatic tests will ensure that the code compiles correctly, and the production of different outputs from a test file.
To perform autonomously the tests, there is a script called ./test/test.sh
that assumes:
- To be invoked from the root of the repository (this is not required, but it's the way TravisCI will invoke it)
- That a binary called
covtobed
is placed at the root of the repository. This is important, should the binary not being at the root of the repository the test script will attempt copying a pre-compiled binary from the./binaries
directory.
Some example BAM files are present in the test directory:
- demo.bam is a simulated single-end whole-genome shotgun of Enterobacteria phage lambda
- mp.bam is a simulated mate pairs library of Enterobacteria phage lambda
- mock.bam is a synthetic version of demo.bam that will produce 3 peaks of coverage (20X, 5X, 5X respectively)
- filtered.bam is a synthetic BAM file containing a valid alignment and non valid flags (PCR duplicate, non primary, failed QC)
- test_cov.bam is a synthetic BAM file having a peak per chromosome, and each chromosome is named after the coverage of its peak (e.g. "5X" means expecting a peak of 5X coverage)
What is tested:
- The binary compiled and can be invoked printing its version
- A sample
test/demo.bam
is analyzed using "--min-cov 15", and should produce 12 lines of BED - A sample
test/mp.bam
is analyzed using "--physical-coverage", and should produce 136 lines - A sample
test/demo.bam
is analyzed using "--output-strands", and should produce a fifth column - A sample
test/demo.bam
is analyzed using "--format counts", and should print two header lines and 202 non-header lines - A sample
test/demo.bam
is analyzed and should re-produce the referencetest/demo.bed
of the repository - A sample
test/mock.bam
is analyzed and should re-produce the referencetest/demo.bed
of the repository - A sample
test/test_cov.bam
is analyzed and the output is checked for having a peak per chromosome, and each chromosome is named after the coverage of its peak
covtobed 1.1.0
Copyright (C) 2014-2019 Giovanni Birolo and Andrea Telatin
License MIT.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
- Compiled binary prints version: PASS 1
- Minimum coverage, expected BED lines check: PASS 2
- Physical coverage, expected BED lines check: PASS 3
- Stranded output, testing column #5: PASS 4
- Testing 'counts' format (printed headers): PASS 5
- Testing 'counts' format (printed lines): PASS 6
- Checking identity of BED output with pre-calculated: PASS 7
- Checking computed coverage for a synthetic BAM file: PASS 8
- Checking filtering of invalid alignments: PASS 9,10
- Checking artificial coverage values:
#OK expecting 1X, 1X found
#OK expecting 2X, 2X found
#OK expecting 10X, 10X found
ALL TESTS: PASSED
Covtobed - Wiki - a simple tool to extract BED coverage tracks from BAM files