Skip to content

Commit

Permalink
correctly filtering star alleles
Browse files Browse the repository at this point in the history
  • Loading branch information
ACEnglish committed Aug 1, 2024
1 parent 3f05bf5 commit 3150ee6
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chr1 6004926 6005445
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
50 changes: 50 additions & 0 deletions repo_utils/answer_key/bench/bench_starallele/log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
2024-08-01 19:48:18,699 [INFO] Truvari v4.3.0
2024-08-01 19:48:18,699 [INFO] Command /Users/english/code/truvari/truvari/__main__.py bench -b repo_utils/test_files/variants/star.base.vcf.gz -c repo_utils/test_files/variants/star.comp.vcf.gz -s 0 -o test_results/bench_starallele/
2024-08-01 19:48:18,700 [INFO] Params:
{
"base": "/Users/english/code/truvari/repo_utils/test_files/variants/star.base.vcf.gz",
"comp": "/Users/english/code/truvari/repo_utils/test_files/variants/star.comp.vcf.gz",
"output": "test_results/bench_starallele/",
"includebed": null,
"extend": 0,
"debug": false,
"reference": null,
"refdist": 500,
"pctseq": 0.7,
"minhaplen": 50,
"pctsize": 0.7,
"pctovl": 0.0,
"typeignore": false,
"chunksize": 1000,
"bSample": "HG002",
"cSample": "HG002",
"dup_to_ins": false,
"sizemin": 0,
"sizefilt": 0,
"sizemax": 50000,
"passonly": false,
"no_ref": false,
"pick": "single",
"check_monref": true,
"check_multi": true
}
2024-08-01 19:48:18,705 [INFO] Zipped 7 variants Counter({'base': 6, 'comp': 1})
2024-08-01 19:48:18,705 [INFO] 1 chunks of 7 variants Counter({'base': 5, '__filtered': 1, 'comp': 1})
2024-08-01 19:48:18,721 [INFO] Stats: {
"TP-base": 0,
"TP-comp": 0,
"FP": 1,
"FN": 5,
"precision": 0.0,
"recall": 0.0,
"f1": null,
"base cnt": 5,
"comp cnt": 1,
"TP-comp_TP-gt": 0,
"TP-comp_FP-gt": 0,
"TP-base_TP-gt": 0,
"TP-base_FP-gt": 0,
"gt_concordance": 0,
"gt_matrix": {}
}
2024-08-01 19:48:18,721 [INFO] Finished bench
1 change: 1 addition & 0 deletions repo_utils/answer_key/bench/bench_starallele/params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"base": "/Users/english/code/truvari/repo_utils/test_files/variants/star.base.vcf.gz", "comp": "/Users/english/code/truvari/repo_utils/test_files/variants/star.comp.vcf.gz", "output": "test_results/bench_starallele/", "includebed": null, "extend": 0, "debug": false, "reference": null, "refdist": 500, "pctseq": 0.7, "minhaplen": 50, "pctsize": 0.7, "pctovl": 0.0, "typeignore": false, "chunksize": 1000, "bSample": "HG002", "cSample": "HG002", "dup_to_ins": false, "sizemin": 0, "sizefilt": 0, "sizemax": 50000, "passonly": false, "no_ref": false, "pick": "single", "check_monref": true, "check_multi": true}
17 changes: 17 additions & 0 deletions repo_utils/answer_key/bench/bench_starallele/summary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"TP-base": 0,
"TP-comp": 0,
"FP": 1,
"FN": 5,
"precision": 0.0,
"recall": 0.0,
"f1": null,
"base cnt": 5,
"comp cnt": 1,
"TP-comp_TP-gt": 0,
"TP-comp_FP-gt": 0,
"TP-base_TP-gt": 0,
"TP-base_FP-gt": 0,
"gt_concordance": 0,
"gt_matrix": {}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions repo_utils/sub_tests/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ run test_bench_badparams $truv bench -b nofile.vcf -c nofile.aga -f notref.fa -o
if [ $test_bench_badparams ]; then
assert_exit_code 100
fi

run test_bench_starallele $truv bench -b $INDIR/variants/star.base.vcf.gz \
-c $INDIR/variants/star.comp.vcf.gz \
-s 0 -o $OD/bench_starallele/
if [ $test_bench_starallele ]; then
bench_assert _starallele
fi
Binary file added repo_utils/test_files/variants/star.base.vcf.gz
Binary file not shown.
Binary file added repo_utils/test_files/variants/star.base.vcf.gz.tbi
Binary file not shown.
Binary file added repo_utils/test_files/variants/star.comp.vcf.gz
Binary file not shown.
Binary file added repo_utils/test_files/variants/star.comp.vcf.gz.tbi
Binary file not shown.
2 changes: 1 addition & 1 deletion truvari/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def filter_call(self, entry, base=False):
Returns True if the call should be filtered
Base has different filtering requirements, so let the method know
"""
if self.params.check_monref and entry.alts in (None, '*'): # ignore monomorphic reference
if self.params.check_monref and entry.alts and entry.alts[0] in (None, '*'): # ignore monomorphic reference
return True

if self.params.check_multi and len(entry.alts) > 1:
Expand Down

0 comments on commit 3150ee6

Please sign in to comment.