-
Notifications
You must be signed in to change notification settings - Fork 53
Testing
PharmCAT's requires make >= 3.82. If you have a Mac, you may have an older version. If you have Homebrew installed, you can update make with:
brew install makeIf not, please Google for instructions on how to install it via Xcode.
To test the Preprocessor, make sure you've installed the required modules:
pip3 install -r preprocessor/requirements.txt
pip3 install -r preprocessor/tests/requirements.txtThen run:
make test-preprocessorTL;DR:
make exactVcfTests/src/scripts/vcf_generator/test_gen.py is responsible for generating VCF files used to test the Named Allele Matcher.
It relies on the allele definitions to generate all possible combinations of variations that will lead to specific diplotype calls for a single gene.
/src/scripts/vcf_generator/generate_vcf_test_data.sh iterates through all genes, calling either:
/src/scripts/vcf_generator/test_gen.py- or
/src/scripts/vcf_generator/test_gen_missing.py(will also generate VCFs with missing positions) if the-mflag is provided
and storing the VCFs in /build/testVcf.
These VCFs are then run through the Named Allele Matcher using org.pharmgkb.pharmcat.haplotype.AutogeneratedVcfTester:
- By default, test will pass if the expected result is one of the top matching results from the
Named Allele Matcher. - In fuzzy-match mode, test will pass if the expected result matches any result from the
Named Allele Matcher. - In exact-match mode, test will only pass if the
Named Allele Matcherproduces a single result that matches the expected result.
The "expected result" is determined based on the filename of the input VCF.
Results are saved to /build/autogeneratedTestResults. A summary is saved to /build/autogeneratedTestResults/autogenerated_test_report.txt. The directory will also contain a copy of the VCF and Named Allele Matcher's results for each failing test.
To simplify testing, use one of these make targets:
- vcfTests
- vcfMissingTests
- exactVcfTests
- exactVcfMissingTests
- fuzzyVcfTests
- fuzzyVcfMissingTests
For example:
make exactVcfTests
make exactVcfMissingTests