Skip to content

Commit

Permalink
argument checking for update-ref-alt
Browse files Browse the repository at this point in the history
  • Loading branch information
Melissa Gymrek authored and Melissa Gymrek committed Sep 9, 2024
1 parent 1703b33 commit 6cb53fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trtools/annotaTR/annotaTR.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ def main(args):
common.WARNING("Error: you cannot use --update-ref-alt unless "
" --match-refpanel-on is set to locid")
return 1
if args.update_ref_alt and args.ref_panel is None:
common.WARNING("Error: --update-ref-alt only works with "
" --ref-panel.")
return 1

outtypes = set()
for outtype in args.outtype:
Expand Down
5 changes: 5 additions & 0 deletions trtools/annotaTR/tests/test_annotaTR.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ def test_UpdateRefAlt(args, vcfdir):
args.match_refpanel_on = "rawalleles"
retcode = main(args)
assert retcode==1
# Won't work with no ref panel
args.match_refpanel_on = "locid"
args.ref_panel = None
retcode = main(args)
assert retcode==1

# Try on good file with alleles that do match refpanel
args.match_refpanel_on = "locid"
Expand Down

0 comments on commit 6cb53fc

Please sign in to comment.