Skip to content

Commit f2e6fcc

Browse files
committed
Lookup MAC based on Allele List
``` pyard --lookup-mac "A*01:01/A*01:02/A*01:03" A*01:MN ```
1 parent 2553832 commit f2e6fcc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/pyard

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import sys
2626

2727
from pyard.constants import VALID_REDUCTION_TYPES
2828
import pyard.misc
29-
from pyard.exceptions import InvalidAlleleError, InvalidTypingError
29+
from pyard.exceptions import InvalidAlleleError, InvalidTypingError, InvalidMACError
3030
from pyard.misc import get_data_dir, get_imgt_version
3131

3232
if __name__ == "__main__":
@@ -70,6 +70,7 @@ if __name__ == "__main__":
7070
help="Validate the provided GL String",
7171
)
7272
parser.add_argument("--cwd", dest="cwd", help="Perform CWD redux")
73+
parser.add_argument("--lookup-mac", dest="lookup_mac", help="Lookup Mac ")
7374

7475
args = parser.parse_args()
7576

@@ -89,6 +90,15 @@ if __name__ == "__main__":
8990
print(f"{mapping[0]} = {'/'.join(mapping[1])}")
9091
sys.exit(0)
9192

93+
# Handle --lookup-mac option
94+
if args.lookup_mac:
95+
try:
96+
mac = ard.lookup_mac(args.lookup_mac)
97+
print(mac)
98+
except InvalidMACError as e:
99+
print(e.message, file=sys.stderr)
100+
sys.exit(0)
101+
92102
try:
93103
if args.validate:
94104
ard.validate(args.cwd)

0 commit comments

Comments
 (0)