-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/rust
- Loading branch information
Showing
17 changed files
with
264 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
One off unittests | ||
""" | ||
import os | ||
import sys | ||
import pysam | ||
from collections import defaultdict | ||
|
||
# Use the current truvari, not any installed libraries | ||
sys.path.insert(0, os.getcwd()) | ||
|
||
import truvari | ||
|
||
# Assume we're running in truvari root directory | ||
|
||
""" | ||
Boundary issues | ||
""" | ||
vcf_fn = "repo_utils/test_files/variants/boundary.vcf.gz" | ||
bed_fn = "repo_utils/test_files/beds/boundary.bed" | ||
region_start = 10 | ||
region_end = 20 | ||
|
||
vcf = pysam.VariantFile(vcf_fn) | ||
for entry in vcf: | ||
state = entry.info['include'] == 'in' | ||
assert state == truvari.entry_within(entry, region_start, region_end), f"Bad Boundary {str(entry)}" | ||
|
||
v = pysam.VariantFile(vcf_fn) | ||
regions = truvari.RegionVCFIterator(v, includebed=bed_fn) | ||
|
||
truv_ans = defaultdict(lambda: False) | ||
for entry in regions.iterate(v): | ||
truv_ans[truvari.entry_to_key(entry)] = True | ||
|
||
v = pysam.VariantFile(vcf_fn) | ||
for entry in v: | ||
state = entry.info['include'] == 'in' | ||
assert state == truv_ans[truvari.entry_to_key(entry)], f"Bad Boundary {str(entry)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ------------------------------------------------------------ | ||
# unittest | ||
# ------------------------------------------------------------ | ||
run test_unittest coverage run --concurrency=multiprocessing -p repo_utils/run_unittest.py | ||
if [ $test_unittest ]; then | ||
assert_exit_code 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
reference 10 20 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.