From 2abca780b130d96487a35e18984b5795eee578fe Mon Sep 17 00:00:00 2001 From: Don Kirkby Date: Fri, 20 Mar 2020 16:14:42 -0700 Subject: [PATCH] Update HIVdb rules file, for #536. --- .../{HIVDB_8.8.xml => HIVDB_8.9-1.xml} | 833 +++++++++++------- micall/resistance/resistance.py | 2 +- micall/tests/test_asi_algorithm.py | 3 +- 3 files changed, 522 insertions(+), 316 deletions(-) rename micall/resistance/{HIVDB_8.8.xml => HIVDB_8.9-1.xml} (92%) diff --git a/micall/resistance/HIVDB_8.8.xml b/micall/resistance/HIVDB_8.9-1.xml similarity index 92% rename from micall/resistance/HIVDB_8.8.xml rename to micall/resistance/HIVDB_8.9-1.xml index 3ea0e681d..5a0f3956a 100644 --- a/micall/resistance/HIVDB_8.8.xml +++ b/micall/resistance/HIVDB_8.9-1.xml @@ -1,9 +1,9 @@ - + HIVDB - 8.8 - 2019-02-13 + 8.9-1 + 2019-10-25 PR @@ -60,6 +60,46 @@ 1, 10 TO 14 => 2, 15 TO 29 => 3, 30 TO 59 => 4, 60 TO INF => 5)]]> + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + 1 @@ -96,8 +136,12 @@ 1 - - + + + 1 + + + 1 @@ -109,7 +153,7 @@ 1 - + 1 @@ -117,7 +161,7 @@ 1 - + 1 @@ -145,7 +189,7 @@ 1 - + 1 @@ -228,6 +272,10 @@ 1 + + + 1 + 1 @@ -301,7 +349,7 @@ 1 - 1 @@ -406,7 +454,7 @@ 1 - 1 @@ -599,7 +647,7 @@ 1 - + 1 @@ -619,7 +667,7 @@ 1 - + 1 @@ -655,7 +703,7 @@ 1 - + 1 @@ -663,7 +711,7 @@ 1 - + 1 @@ -711,15 +759,15 @@ 1 - + 1 - + 1 - + 1 @@ -787,7 +835,7 @@ 1 - + 1 @@ -795,7 +843,7 @@ 1 - + 1 @@ -815,7 +863,7 @@ 1 - + 1 @@ -863,7 +911,7 @@ 1 - + 1 @@ -879,7 +927,7 @@ 1 - + 1 @@ -898,12 +946,12 @@ 1 - - + + 1 - + 1 @@ -911,7 +959,7 @@ 1 - + 1 @@ -931,7 +979,7 @@ 1 - + 1 @@ -1354,26 +1402,32 @@ 15, MAX ( 100I => 15, 100V => 10 ), MAX ( 101E => 15, 101P => 10 ), - MAX ( 106A => 60, 106I => 15, 106M => 30 ), - 108I => 10, + MAX ( 106A => 60, 106I => 10, 106M => 50 ), + 108I => 15, + 138K => 10, + 179F => 10, MAX ( 181C => 10, 181I => 20, 181V => 20 ), MAX ( 188C => 10, 188F => 30, 188H => 10, 188L => 60 ), - MAX ( 190C => 10, 190E => 60, 190Q => 60, 190S => 30, 190T => 10, 190V => 10 ), - 221Y => 10, + MAX ( 190C => 10, 190E => 60, 190Q => 30, 190S => 30, 190T => 10, 190V => 10 ), + 221Y => 15, 225H => 30, - MAX ( 227C => 60, 227I => 30, 227L => 30, 227V => 30 ), + MAX ( 227C => 60, 227I => 50, 227L => 50, 227V => 50 ), MAX ( 230I => 15, 230L => 60 ), 234I => 30, + 236L => 15, 318F => 30, (100I AND 103N) => 15, (103N AND 181C) => 10, (106A AND 227L) => 15, + (106I AND 181C) => 10, + (106I AND 190S) => 10, (108I AND 181C) => 10, (108I AND 234I) => 15, + (181C AND 190ACSTV) => 20, + (181CIV AND 221Y) => 10, (98G AND 181C) => 5, (98G AND 227C) => 15, - MAX ((101E AND 190A) => 5, (101E AND 190S) => 5), - MAX ((181C AND 190A) => 20, (181C AND 190CSTV) => 10))]]> + MAX ((101E AND 190A) => 5, (101E AND 190S) => 5))]]> @@ -1495,8 +1549,10 @@ MAX ( 230I => 30, 230L => 60 ), (101E AND 184I) => 15, (103R AND 179D) => 15, + (106I AND 181C) => 10, (138K AND 184I) => 15, (181C AND 190ACSTV) => 10, + (181CIV AND 221Y) => 10, (98G AND 181C) => 5, (98G AND 227C) => 15, MAX ((179F AND 181C) => 15, (179T AND 181C) => 10))]]> @@ -1853,22 +1909,25 @@ MAX ( 153F => 15, 153Y => 15 ), 155H => 10, 230R => 10, - 263K => 25, - (138AKT AND 118R) => 10, + 263K => 30, + (118R AND 138AKT) => 10, (138AKT AND 140ACS) => 10, (138AKT AND 148HKR) => 10, (140ACS AND 148HKR) => 10, (140ACS AND 148HKR AND 149A) => 10, (143ACGHRS AND 163R) => 5, (143ACGHRS AND 230R) => 5, - (148HKR AND 155H) => 10, + (147G AND 148HKR) => 15, + (148HKR AND 155H) => 20, (148HKR AND 163KR) => 5, + (155H AND 147G) => 10, + (155H AND 263K) => 20, (157Q AND 263K) => 10, (51Y AND 263K) => 10, (74FIM AND 118R) => 10, (74FIM AND 143ACGHRS) => 5, - (74FIM AND 148HKR) => 10, - (92Q AND 155H) => 5, + (74FIM AND 148HKR) => 15, + (92Q AND 155H) => 10, (97A AND 118R) => 10, (97A AND 148HKR) => 15)]]> @@ -1896,21 +1955,24 @@ 155H => 10, 230R => 20, 263K => 30, - (138AKT AND 118R) => 10, + (118R AND 138AKT) => 10, (138AKT AND 140ACS) => 10, (138AKT AND 148HKR) => 10, (140ACS AND 148HKR) => 10, (140ACS AND 148HKR AND 149A) => 10, (143ACGHRS AND 163R) => 5, (143ACGHRS AND 230R) => 5, - (148HKR AND 155H) => 10, + (147G AND 148HKR) => 15, + (148HKR AND 155H) => 20, (148HKR AND 163KR) => 5, + (155H AND 147G) => 10, + (155H AND 263K) => 20, (157Q AND 263K) => 10, (51Y AND 263K) => 10, (74FIM AND 118R) => 10, (74FIM AND 143ACGHRS) => 5, (74FIM AND 148HKR) => 15, - (92Q AND 155H) => 5, + (92Q AND 155H) => 10, (97A AND 118R) => 10, (97A AND 148HKR) => 15)]]> @@ -1946,15 +2008,17 @@ 230R => 20, 232N => 10, 263K => 30, - (138AKT AND 118R) => 10, + (118R AND 138AKT) => 10, (138AKT AND 140ACS) => 15, (140ACS AND 148HKR AND 149A) => 10, (143ACGHRS AND 163R) => 5, (143ACGHRS AND 230R) => 5, + (155H AND 147G) => 10, (51Y AND 263K) => 15, (74FIM AND 118R) => 10, (74FIM AND 143ACGHRS) => 5, (74FIM AND 148HKR) => 15, + (92Q AND 155H) => 10, (97A AND 118R) => 10, (97A AND 143ACGHRS) => 5)]]> @@ -1986,11 +2050,12 @@ 230R => 20, 232N => 10, 263K => 25, - (138AKT AND 118R) => 10, + (118R AND 138AKT) => 10, (138AKT AND 140ACS) => 15, (140ACS AND 148HKR AND 149A) => 10, (74FIM AND 118R) => 10, (74FIM AND 148HKR) => 15, + (92Q AND 155H) => 10, (97A AND 118R) => 10)]]> @@ -2001,800 +2066,812 @@ - PR + IN - 10ACDEGHKMNPQSTWid + 118ACDEFHIKLMNPQSTVWYid - + - 10F + 118R - + - 10IV + 119R - + - 10RY + 121ACDEGHIKLMNPQRSTVWid - + - 11IL + 121Y - + - 20I + 128T - + - 20MV + 138CFGHILMNPQRSVWYid - + - 20R + 138D - + - 20T + 138KAT - + - 23I + 140DEFHIKLMNPQTVWYid - + - 24ACDEGHKNPQRSTVWYid + 140R - + - 24FM + 140SAC - + - 24I + 142T - + - 30ACEFGHIKLMPQRSTVWYid + 143CR - + - 30N + 143DEFILMNPQTVWid - + - 32ACDEFGHKLMNPQRSTWYid + 143H - + - 32I + 143KGSA - + - 33F + 145ACDEFGHIKLMNQRTVWYid - + - 33i + 145S - + - 34i + 146ACDEFGHIKLMNRSTVWYid - + - 35i + 146P - + - 36i + 147ACDEFHIKLMNPQRTVWYid - + - 37i + 147G - + - 38i + 148ACDEFGILMPSTVWYid - + - 39i + 148HKR - + - 40i + 148N - + - 41i + 149A - + - 43T + 151A - + - 46ACDEFGHKNPQRSTWYid + 151CDEFGHKMNPQRSTWYid - + - 46IL + 151I - + - 46V + 151L - + - 47A + 153ACDEGHIKLMNPQRTVWid - + - 47CDEFGHKLMNPQRSTWYid + 153YF - + - 47V + 155ACDEFGIKLMPQRVWYid - + - 48ASTQL + 155H - + - 48CDEFHIKNPRWYid + 155ST - + - 48M + 157Q - + - 48V + 163RK - + - 50ACDEFGHKMNPQRSTWYid + 230N - + - 50L + 230R - + - 50V + 232N - + - 53L + 263ACDEFGHILMNPQSTVWYid - + - 53Y + 263K - + - 54ATS + 49G - + - 54CDEFGHKNPQRWYid + 50I - + - 54LM + 51ACDEFGIKLMNPQRSTVWid - + - 54V + 51Y - + - 58E + 66A - + - 71IL + 66CDEFGHLMNPQRSVWYid - + - 71TV + 66I - + - 73EFHIKLMNPQRWYid + 66K - + - 73STCADV + 74MIF - + - 74P + 92ACDFHIKLMNPRSTWYid - + - 74S + 92G - + - 76ACDEFGHIKMNPQRSTWYid + 92Q - + - 76V + 92V - + - 82A + 95K - + - 82C + 97A - + + + + PR - 82DEGHKNPQRWYid + 10ACDEGHKMNPQSTWid - + - 82F + 10F - + - 82I + 10IV - + - 82L + 10RY - + - 82M + 11IL - + - 82TS + 20I - + - 83D + 20MV - + - 84AC + 20R - + - 84DEFGHKLMNPQRSTWYid + 20T - + - 84V + 23I - + - 85V + 24ACDEGHKNPQRSTVWYid - + - 88ACEFHIKLMPQRVWYid + 24FM - + - 88D + 24I - + - 88S + 30ACEFGHIKLMPQRSTVWYid - + - 88TG + 30N - + - 89VT + 32ACDEFGHKLMNPQRSTWYid - + - 90ACDEFGHIKNPQRSTVWYid + 32I - + - 90M + 33F - + - - - IN - 118ACDEFHIKLMNPQSTVWYid + 33i - + - 118R + 34i - + - 119R + 35i - + - 121ACDEGHIKLMNPQRSTVWid + 36i - + - 121Y + 37i - + - 128T + 38i - + - 138CFGHILMNPQRSVWYid + 39i - + - 138D + 40i - + - 138KAT + 41i - + - 140DEFHIKLMNPQRTVWYid + 43T - + - 140SAC + 46ACDEFGHKNPQRSTWYid - + - 142T + 46IL - + - 143CR + 46V - + - 143DEFILMNPQTVWid + 47A - + - 143H + 47CDEFGHKLMNPQRSTWYid - + - 143KGSA + 47V - + - 145ACDEFGHIKLMNQRTVWYid + 48ASTQL - + - 145S + 48CDEFHIKNPRWYid - + - 146ACDEFGHIKLMNRSTVWYid + 48M - + - 146P + 48V - + - 147ACDEFHIKLMNPQRTVWYid + 50ACDEFGHKMNPQRSTWYid - + - 147G + 50L - + - 148ACDEFGILMPSTVWYid + 50V - + - 148HKR + 53L - + - 148N + 53Y - + - 149A + 54ATS - + - 151A + 54CDEFGHKNPQRWYid - + - 151CDEFGHKMNPQRSTWYid + 54LM - + - 151I + 54V - + - 151L + 58E - + - 153ACDEGHIKLMNPQRTVWid + 71IL - + - 153YF + 71TV - + - 155ACDEFGIKLMPQRVWYid + 73EFHIKLMNPQRWYid - + - 155H + 73STCADV - + - 155ST + 74P - + - 157Q + 74S - + - 163RK + 76ACDEFGHIKMNPQRSTWYid - + - 230N + 76V - + - 230R + 82A - + - 232N + 82C - + - 263ACDEFGHILMNPQSTVWYid + 82DEGHKNPQRWYid - + - 263K + 82F - + - 50I + 82I - + - 51ACDEFGIKLMNPQRSTVWid + 82L - + - 51Y + 82M - + - 66A + 82TS - + - 66CDEFGHLMNPQRSVWYid + 83D - + - 66I + 84AC - + - 66K + 84DEFGHKLMNPQRSTWYid - + - 74MIF + 84V - + - 92ACDFHIKLMNPRSTWYid + 85V - + - 92G + 88ACEFHIKLMPQRVWYid - + - 92Q + 88D - + - 92V + 88S - + - 95K + 88TG - + - 97A + 89VT - + + + + + 90ACDEFGHIKNPQRSTVWYid + + + + + + 90M + + @@ -3263,9 +3340,9 @@ - 234ACDEFGHKLMNPQRSTWYid + 234ACDEFGHKMNPQRSTWYid - + @@ -3558,4 +3635,132 @@ + + + + + DRV/r + 5 + + + + + + + + + + DRV/r + 5 + + + TPV/r + 4 + + + + + + + + + + DRV/r + 5 + + + TPV/r + 3 + + + + + + + + + + DRV/r + 5 + + + TPV/r + 2 + + + + + + + + + + DRV/r + 5 + + + TPV/r + 1 + + + + + + + + + + DRV/r + 4 + + + + + + + + + + DRV/r + 3 + + + + + + + + + + DTG + 5 + + + + + + + + + + DTG + 4 + + + + + + + + + + DTG + 3 + + + + + + + diff --git a/micall/resistance/resistance.py b/micall/resistance/resistance.py index b2c9982b0..b1c8b8074 100644 --- a/micall/resistance/resistance.py +++ b/micall/resistance/resistance.py @@ -14,7 +14,7 @@ MIN_FRACTION = 0.05 # prevalence of mutations to report MIN_COVERAGE = 100 REPORTED_REGIONS = {'PR', 'RT', 'IN', 'NS3', 'NS5a', 'NS5b'} -HIV_RULES_PATH = os.path.join(os.path.dirname(__file__), 'HIVDB_8.8.xml') +HIV_RULES_PATH = os.path.join(os.path.dirname(__file__), 'HIVDB_8.9-1.xml') HCV_RULES_PATH = os.path.join(os.path.dirname(__file__), 'hcv_rules.yaml') NOTHING_MAPPED_MESSAGE = 'nothing mapped' diff --git a/micall/tests/test_asi_algorithm.py b/micall/tests/test_asi_algorithm.py index e63adf44a..303fe00dd 100644 --- a/micall/tests/test_asi_algorithm.py +++ b/micall/tests/test_asi_algorithm.py @@ -4,6 +4,7 @@ from unittest import TestCase from micall.resistance.asi_algorithm import AsiAlgorithm +from micall.resistance.resistance import HIV_RULES_PATH class AsiAlgorithmTest(TestCase): @@ -11,7 +12,7 @@ def setUp(self): self.asi = AsiAlgorithm(os.path.join(os.path.dirname(__file__), "..", "resistance", - "HIVDB_8.8.xml")) + HIV_RULES_PATH)) def test_interpret(self): aa_seq = [[amino] for amino in self.asi.stds['RT']]