diff --git a/trtools/annotaTR/annotaTR.py b/trtools/annotaTR/annotaTR.py index f6de09ef..a1a75d5e 100644 --- a/trtools/annotaTR/annotaTR.py +++ b/trtools/annotaTR/annotaTR.py @@ -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: diff --git a/trtools/annotaTR/tests/test_annotaTR.py b/trtools/annotaTR/tests/test_annotaTR.py index 501be37e..e60f74e5 100644 --- a/trtools/annotaTR/tests/test_annotaTR.py +++ b/trtools/annotaTR/tests/test_annotaTR.py @@ -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"