Stanford University HIV Drug Resistance Database - 
A curated public database designed to represent, store, and analyze the divergent forms 
of data underlying HIV drug resistance.

A curated public database designed to represent, store, and analyze the divergent forms of data underlying HIV drug resistance.

Home Genotype-RX Genotype-Pheno Genotype-Clinical HIVdb Program

Algorithm Specification Interface (ASI)

Table of Contents

  1. Introduction
  2. Algorithms in XML Format
  3. Language Developed for ASI
  4. Compiler
  5. References
  6. Appendices
 

HIV drug resistance interpretation algorithms will continue to evolve with the publication of new data and the introduction of new antiretroviral inhibitors. The software needed to implement these algorithms should remain stable to allow direct comparison between emerging algorithms and their component rules.

ASI is a common platform that we have developed for coding genotypic interpretation algorithms. It consists of an XML format for specifying an algorithm and a compiler that transforms the XML into executable code. ASI makes it possible for drug resistance experts to develop and test genotypic interpretation algorithms without the assistance of a computer programmer, thereby allowing HIV drug resistance experts to focus on developing, testing, and modifying rules rather than on developing software to encode algorithms.

 
2. Algorithms in XML Format

The following links provide information about the ASI and to existing programs that use ASI technology:

1. ANRS XML HTML
2. HIVDB XML HTML
3. Rega Institute XML HTML

Each algorithm is completely contained in an XML document. The ASI Document Type Definition (DTD) that they adhere to can also be viewed.

 
3. Language Developed for ASI

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 ASI 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. An entire algorithm encoded according to this DTD is shown in Appendix 2. The algorithm shown is the RCG algorithm, chosen for its relatively short description using the ASI.

At the heart of an algorithm is a <DRUG> clause. An example clause taken from the RCG algorithm is shown below:


<DRUG>
        <NAME>d4T</NAME>
        <RULE>
            <CONDITION>
                SELECT ATLEAST 1 FROM (151M,69i)
            </CONDITION>
            <ACTIONS>
    	        <LEVEL>3</LEVEL>
            </ACTIONS>
        </RULE>
</DRUG>

In this example, for the drug d4T the algorithm designer would like the drug to receive a level of 3 if either the mutation 151M is present or an insertion is present at position 69 (the designer would have previously specified what was meant by level 3 - in RCG it means "Drug is inactive"). 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 ASI language is described in the table that follows using BNF notation. An epsilon (ε) is show to indicate the possibility of an empty clause.

ClauseDefinition
statementcondition statement_2
statement_2logic_symbol statment | ε
conditionlbracket statement rbracket | residue condition_2 | select_statement condition_2 | score_statement condition_2
condition_2logic_symbol condition | ε
score_statementscore from lbracket score_list rbracket
score_listresidue_clause score_value score_list_2
score_list_2comma score_list
residue_clauselbracket residue_clause rbracket | residue residue_clause_2
residue_clause_2logic_symbol residue_clause | ε
select_statementselect select_statement_2
select_statement_2atleast select_statement_3 | notmorethan from lbracket select_list rbracket
select_statement_3from lbracket select_list rbracket | logic_symbol notmorethan from lbracket select_list rbracket
select_listresidue select_list_2
select_list_2comma select_list | ε

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.

  1. 151M OR 69i
  2. SELECT ATLEAST 2 FROM (41L, 67N, 70R, 210W, 215FY, 219QE)
  3. SELECT ATLEAST 2 AND NOTMORETHAN 2 FROM (41L, 67N, 70R, 210W, 215FY, 219QE)
    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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 215F OR 215Y
    A long way of saying 215FY.

 
4. Compiler

Once specified in ASI format, an algorithm can be compiled into an executable set of routines. The compiler was written in Perl, and the target language from the compilation is also in Perl. These routines accept as input a set of mutations and produce as output a list of drug resistance levels along with other output (such as comment strings) as directed by the algorithm.

 
5. References
  1. Hirsch MS, Brun-Vezinet F, D'Aquila RT, et al. Antiretroviral drug resistance testing in adult HIV-1 infection: recommendations of an International AIDS Society-USA Panel. JAMA 2000;283:2417-2426.
  2. British HIV Association. British HIV Association (BHIVA) guidelines for the treatment of HIV-infected adults with antiretroviral therapy. HIV Med 2001;2(4):276-313.
  3. EuroGuidelines Group for HIV Resistance. Clinical and laboratory guidelines for the use of HIV-1 drug resistance testing as part of treatment management: recommendations for the European setting. AIDS 2001;15:309-320.
  4. US Department of Health and Human Services Panel on Clinical Practices for Treatment of HIV Infection A. Guidelines for the use of antiretroviral agents in HIV-1-infected adults and adolescents (The living document, February 4, 2002), http://www.aidsinfo.nih.gov/guidelines/, 2002.
 
6. Appendices

Appendix 1. ASI DTD


<!-- 
This DTD indicates the format the various drug resistance algorithms must use.
-->

<!ELEMENT ALGORITHM (ALGNAME, ALGVERSION?, PROCESSING_DIRECTIVES?, 
                     DEFINITIONS, DRUG*, MUTATION_COMMENTS?)>

<!-- *************************************************************** -->
<!ELEMENT ALGNAME (#PCDATA)>
<!-- *************************************************************** -->

<!-- *************************************************************** -->
<!ELEMENT ALGVERSION (#PCDATA)>
<!-- *************************************************************** -->

<!-- *************************************************************** -->
<!ELEMENT PROCESSING_DIRECTIVES (SHOW_ATYPICAL_MUTATIONS?,
                                 RESTRICTED_POSITION_SCORING?)>
<!ELEMENT SHOW_ATYPICAL_MUTATIONS EMPTY>
<!ELEMENT RESTRICTED_POSITION_SCORING EMPTY>
<!-- *************************************************************** -->

<!-- *************************************************************** -->
<!ELEMENT DEFINITIONS (LEVEL_DEFINITION*, DRUGCLASS*, GLOBALRANGE?,
                       COMMENT_DEFINITIONS?)>
<!ELEMENT LEVEL_DEFINITION (ORDER, ORIGINAL, SIR)>
<!ELEMENT ORDER (#PCDATA)>
<!ELEMENT ORIGINAL (#PCDATA)>
<!ELEMENT SIR (#PCDATA)>
<!ELEMENT DRUGCLASS (NAME, DRUGLIST)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT DRUGLIST (#PCDATA)>
<!ELEMENT GLOBALRANGE (#PCDATA)>
<!ELEMENT COMMENT_DEFINITIONS (COMMENT_STRING+)>
<!ELEMENT COMMENT_STRING (TEXT)>
<!ATTLIST COMMENT_STRING   id ID #REQUIRED>
<!ELEMENT TEXT (#PCDATA)>
<!-- *************************************************************** -->

<!-- *************************************************************** -->
<!ELEMENT DRUG (NAME, RULE*)>
<!ELEMENT RULE (CONDITION, ACTIONS)>
<!ELEMENT CONDITION (#PCDATA)>
<!ELEMENT ACTIONS (LEVEL?, SCORERANGE?, COMMENT?)>
<!ELEMENT LEVEL (#PCDATA)>
<!ELEMENT SCORERANGE (#PCDATA | USE_GLOBALRANGE)*>
<!ELEMENT USE_GLOBALRANGE EMPTY>
<!ELEMENT COMMENT EMPTY>
<!ATTLIST COMMENT   ref IDREF #REQUIRED>
<!-- *************************************************************** -->

<!-- *************************************************************** -->
<!ELEMENT MUTATION_COMMENTS (GENE*)>
<!ELEMENT GENE (NAME, RULE+)>
<!-- *************************************************************** -->

The Team

The Data