Drug resistance algorithms can be specified in an XML document that adheres to an XML Document Type Definition (DTD) that we have developed (and refer to as the ASI2 DTD). The DTD is available online and the text of the DTD is shown in Appendix 1. It provides the basic framework that an algorithm must adhere to.
At the heart of an algorithm is a <DRUG> clause. An example clause taken from the ANRS algorithm is shown below:
65R OR 151M OR 69i
In this example, for the drug d4T the algorithm designer would like the drug to receive a level of 3 if either mutation 151M or 65R is present or if an insertion is present at position 69 (the designer would have previously specified what was meant by level 3 - in ANRS it means "Resistance"). That is, if the condition statement evaluates to true then the appropriate action is taken. Note that the <CONDITION> clause of each <RULE> is free-form text that adheres to a language grammar we have developed for the purpose. This grammar is described in the next section.
The grammar for the ASI2 language is described in the table that follows using BNF notation.
|condition||l_par booleancondition r_par ||
|residue||[originalaminoacid]:amino_acid? integer [mutatedaminoacid]:amino_acid+ ||
not [originalaminoacid]:amino_acid? Integer [mutatedaminoacid]:amino_acid+ |
[originalaminoacid]:amino_acid? integer l_par not [mutatedaminoacid]:amino_acid+ r_par
|selectstatement2||exactly integer from l_par selectlist r_par ||
atleast integer from l_par selectlist r_par |
notmorethan integer from l_par selectlist r_par |
atleast [atleastnumber]:integer logicsymbol notmorethan [notmorethannumber]:integer from l_par selectlist r_par
|scorecondition||score from l_par scorelist r_par|
|scoreitem||booleancondition mapper min? number ||
max l_par scorelist r_par
|legend||| separates possibilties|
? indicates zero or one
+ one or more
* zero or more
Here is a link to the previous version of the ASI
Some examples of valid clauses in the language follow. The language is very much fairly self-explanatory given that it reads similarly to an English sentence.
- 151M OR 69i
- SELECT ATLEAST 2 FROM (41L, 67N, 70R, 210W, 215FY, 219QE)
- SELECT ATLEAST 2 AND NOTMORETHAN 2 FROM (41L, 67N, 70R, 210W, 215FY,
What this really means is "choose exactly two from the following list".
The keyword "EXACTLY", which has not been added to the language yet,
would allow that rule to be expressed more compactly.
- 215FY AND NOT 184VI
For this to be true, a mutation F or Y must be present at position 215 and a V or I mutation must not be present at position 184.
- SCORE FROM (65R => 20, 74V => 20, 184VI => 20)
Scores are added for each score that is triggered by a matching mutation, so if 65R and 74V were present the total score would be 40. A <SCORERANGE> section of the <ACTIONS> would indicate how scores were to be mapped to resistance levels.
- 151M AND EXCLUDE 69i
The mutation 69i must not be present for this clause to evaluate to true. That is, 151M would have to be present along with an arbitrary number of other mutations as long as one was not 69i.
- 69(NOT TDN)
A mutation at position 69 other than T69D and T69N. The consensus must also be excluded to pick up atypical mutations at this position.
- 215F OR 215Y
A long way of saying 215FY.
- MAX ( 101P => 40, 101E => 30, 101HN => 15, 101Q => 5 )
Use the maximum score in position 101 among scores triggered by a matching mutation: 40(P), 30(E), 15(H), 15(N), 5(Q)
- (184V AND 115F) => 20
a mutation V at position 184 and mutation F at 115 must both be present for the score of 20 to be triggered