The Influenza Virus Resource and other Virus Variation Resources at NCBI provide enhanced visualization web tools for exploratory analysis for influenza sequence data. Despite the improvements in data analysis, the initial data retrieval remains unsophisticated, frequently producing huge and imbalanced datasets due to the large number of identical and nearly-identical sequences in the database.
We propose a data mining algorithm to organize reported sequences into groups based on their relatedness to the query sequence and to each other. The algorithm uses BLAST to find database sequences related to the query. Neighbor lists precalculated from pairwise BLAST alignments between database sequences are used to organize results in groups of nearly-identical and strongly related sequences. We propose to use a non-symmetric dissimilarity measure well crafted for dealing with sequences of different length (fragments).
A balanced and representative data set produced by this tool can be used for further analysis, i.e. multiple sequence alignment and phylogenetic trees. The algorithm is implemented for protein coding sequences and is being integrated with the NCBI Influenza Virus Resource.
The amount of influenza sequence data is increasing rapidly due to the collaborative genome sequencing efforts  ,  . In support of this work, The Influenza Virus Resource has been created at NCBI and is available for public access. This and other Virus Variation Resources at NCBI provide enhanced visualization web tools for exploratory analysis  ,  ,  allowing the representation of phylogenetic trees in an aggregated form with a mechanism for refinement.
Despite the improvements in data analysis, the initial data retrieval remains straightforward in many cases. For example, a database query to NCBI Influenza database is formed as a simple combination of metadata (type of the virus, serotype, segment/proteins, time interval for the date of isolation, etc.)  and returns all the sequences that satisfy the query. With the increased number of sequences, it becomes more difficult to operate in this manner: a priori knowledge and experience are required to confirm that all the relevant sequences are included. The dataset extracted in response to the query may be huge and imbalanced due to the large number of identical and nearly-identical sequences in the database (that may differ in metadata though and could not be simply eliminated at the database level). Manual selection of a representative subset is time consuming and difficult. This may create a bottleneck during ongoing pandemic (see  for related analysis and references).
In this paper, we describe an algorithm allowing to select the sequences with various degrees of similarity to the query and group the results based on their relatedness to each other. The algorithm uses BLAST scores to find and rate the database sequences related to the query. Pre-calculated neighborhood lists based on pair-wise BLAST hits between the database sequences allow to report the results in groups of identical and nearly identical sequences.
The algorithm is implemented for protein coding sequences and is being integrated with the NCBI Influenza Virus Resource.
Neighbor-relationships between sequences
The standard nucleotide and protein sequence scoring models satisfy conditions (1) – (11) in  , and the Smith-Waterman local alignment scores satisfy the inequality
for any three sequences , , and , and(1)
is a metric. Distance (1) provides an adequate measure of sequence closeness if any difference between sequences or absence of data needs to be penalized (two self-scores are calculated over the whole length of the corresponding protein, not over the area of pairwise local alignment). It is used to remove nearly-redundant sequences from a database  . Removing near-neighbor redundancy in protein sequence collections is also discussed in  , and clustered sequence representation is proposed as an alternative in  . Though a good measure of similarity between sequences, the alignment metric (1) does not provide an adequate measure of closeness when, for example, a partial sequence is compared to a very similar full-length sequence, and it is not desirable to interpret the absence of the data as a difference. Below we introduce a near-neighbor relationship which seems to be a better measure for cases like that.
Define dissimilarity measure between sequences and :. (2)
Sequence is an -neighbor to sequence if, (3)
where . The maximum value of is 1 and it is realized on two unrelated sequences. For identical sequences the value is 0. The dissimilarity measure in (2) is non-symmetric:
That allows a short sequence to be an -neighbor to a long sequence, but not vice versa.
In practice, the highest BLAST bit score between two sequences (“BLAST score”), , will be used. BLAST dissimilarity measure(4)
will be used instead of (2). If BLAST does not find any similarity between and , .
Since we are interested in close relationships only and do not consider distant relatives, using fast BLAST algorithm rather than the Smith-Waterman alignment seems reasonable in this context.
Creating display groups
A complete list of all reported BLAST hits to a given query sequence may be difficult and sometimes impractical to use due to the swarms of identical and nearly-identical sequences in the search set. The resulting list may be either too long or incomplete depending on the selected threshold. It will be useful to identify redundant and nearly redundant sequences and produce a near-redundant group report rather than a raw list of all BLAST hits. In our calculations, both relatedness to the query sequence and pairwise similarity of the database sequences are taken into account.
An important requirement to the algorithm is to allow either query or subject sequence to be incomplete. For example, comparing a coding sequence of HA1 domain of hemaglutinin with complete dataset [11 .
Suppose that the subject sequences are ordered by score to the query sequence :
Iterations.During the steps of the algorithm we select the sequences from the ordered list . Initially, set . At each step we select an anchor sequence . The anchor sequence and all its -neighbors for group are removed from the list . The procedure is applied until the list becomes empty.
Selecting an anchor sequence.An anchor sequence is selected as follows. A top-score sequence is considered first (e.g., is the first in the list ) , and the anchor sequence is selected among the sequences in if it is an -neighbor to . Specifically, all sequences in the list are selected if is an -neighbor and satisfy the criterion, (5)
where , are considered. The sequence of a maximum length is selected as an anchor (see Figure 1).
Forming a group.The anchor sequence is selected, then group is built: all -neighbors to sequence including sequence itself are placed in group and removed from the list . The iterations are performed until the list is empty.
Regularization.Taking the longest possible sequence as an anchor instead of sequence allows to create big and stable groups around anchors and avoid fracturing.
Filtering low-score and low-overlap sequences.After the groups are created, the members of the group that have low-overlap with the query sequence or have much lower score to the query sequence than the anchor, could be filtered out.
Indexing.Steps (i) and (iii) of the Algorithm operate with the sets of -neighbors for a sequence. These lists are pre-calculated for the database for preselected values of . As a result, only BLAST scores to the query sequence are calculated on-the-fly.
Showing display groups
Each group can be displayed at various levels of detail: an anchor sequence and a number of sequences in the group (default) with or without aggregated metadata; groups of identical sequences; and individual sequences. In an aggregated form a group of sequences is shown as a row in the table containing aggregated metadata. For Influenza sequences, it may be score range, identity range, serotype(s), length range, country/countries.).
To demonstrate the work of the algorithm, we performed a search for the protein coding sequence of hemagglutinin [Influenza A virus (A/New York/3223/2009(H1N1))], coding for the protein with accession number ACR40288 (all data as of September 20, 2009). The request interface is shown in Figure 2 (Protein accession number  or protein coding sequence in either text or FASTA formats  ,  can be entered).
The results are shown in Figure 3. First group contains 943 near-redundant H1N1 2009 hemagglutinin protein coding sequences with identity to the query sequence varying from 100% to 99%. The score to the query sequence is varying from 3063 to 1269 due to the sequence length variation from 1701 – 708. While complete sequences in the group contain enire HA coding sequences, partial sequences cover coding sequences of either HA1 or HA2 regions (low-coverage filtering was not turn on in this test).
Two levels of resolution are shown in Figure 2: table
The algorithm presented allows the adaptive creation of display groups, taking into account both relatedness of the reported sequences to the query and their similarity to each other. The groups are built in an efficient manner using pre-calculated -neighbors for each sequences. Moreover, additional filtering can be performed, allowing exclusion of members of each group that are less relevant to the query than top members. A balanced and representative set of sequences selected using this tool can be passed to the analysis tools within the NCBI Influenza Virus Resource for calculating multiple sequence alignment and trees. We plan to extend the technology to processing other viruses in the NCBI Virus Variation Resources.
The developed technology is based on the non-symmetric definition of dissimilarity in (2) and (3). Measuring dissimilarity in this way is adequate when the absence of the data is considered a probable match (a short sequence is very close to a longer one over the whole length of the former). In some situations, such assumption would not be valid, and a more strict similarity measure, such as the alignment metric (1) should be used  .
We plan to release a production version of the tool on the web site http://www.ncbi.nlm.nih.gov/genomes/FLU/SmartBLAST .
The authors are thankful to David J. Lipman, Stephen Altschul, Yiming Bao, James R. Brister, Stacy Ciufo, William Klimke, Tom Madden, Kathleen O’Neill and Sergey Resenchuk for productive discussions. We appreciate work of Sergey Resenchuk on supporting a BLAST database for influenza virus protein coding sequences.
This research was supported by the Intramural Research Program of the NIH, National Library of Medicine.
The authors have declared that no competing interests exist.
- Fauci AS. Race against time. Nature. 2005 May 26;435(7041):423-4. PubMed PMID: 15917781.
- Ghedin E, Sengamalay NA, Shumway M, Zaborsky J, Feldblyum T, Subbu V, Spiro DJ, Sitz J, Koo H, Bolotov P, Dernovoy D, Tatusova T, Bao Y, St George K, Taylor J, Lipman DJ, Fraser CM, Taubenberger JK, Salzberg SL. Large-scale sequencing of human influenza reveals the dynamic nature of viral genome evolution. Nature. 2005 Oct 20;437(7062):1162-6. Epub 2005 Oct 5. PubMed PMID: 16208317.
- Bao Y, Bolotov P, Dernovoy D, Kiryutin B, Zaslavsky L, Tatusova T, Ostell J, Lipman D. The influenza virus resource at the National Center for Biotechnology Information. J Virol. 2008 Jan;82(2):596-601. Epub 2007 Oct 17. PubMed PMID: 17942553; PubMed Central PMCID: PMC2224563.
- Resch W, Zaslavsky L, Kiryutin B, Rozanov M, Bao Y, Tatusova TA. Virus variation resources at the National Center for Biotechnology Information: dengue virus. BMC Microbiol. 2009 Apr 2;9:65. PubMed PMID: 19341451; PubMed Central PMCID: PMC2675532.
- Zaslavsky L, Bao Y, Tatusova TA. Visualization of large influenza virus sequence datasets using adaptively aggregated trees with sampling-based subscale representation. BMC Bioinformatics. 2008 May 16;9:237. PubMed PMID: 18485197; PubMed Central PMCID: PMC2416652.
- Zaslavsky L, Bao Y, Tatusova TA. An Adaptive Resolution Tree Visualization of Large Influenza Virus Sequence Datasets. Lect Notes Comput Sci. 2007 May;LNBI 4463:192-202. PubMed PMID: 17928904; PubMed Central PMCID: PMC2014737.
- Smith GJ, Vijaykrishna D, Bahl J, Lycett SJ, Worobey M, Pybus OG, Ma SK, Cheung CL, Raghwani J, Bhatt S, Peiris JS, Guan Y, Rambaut A. Origins and evolutionary genomics of the 2009 swine-origin H1N1 influenza A epidemic. Nature. 2009 Jun 25;459(7250):1122-5. PubMed PMID: 19516283.
- Spiro PA, Macura N. A local alignment metric for accelerating biosequence database search. J Comput Biol. 2004;11(1):61-82. PubMed PMID: 15072689.
- Cameron M, Bernstein Y, Williams HE. Clustered sequence representation for fast homology search. J Comput Biol. 2007 Jun;14(5):594-614. Review. PubMed PMID: 17683263.
- Holm L, Sander C. Removing near-neighbour redundancy from large protein sequence collections. Bioinformatics. 1998 Jun;14(5):423-9. PubMed PMID: 9682055.
- Taubenberger JK. Influenza virus hemagglutinin cleavage into HA1, HA2: no laughing matter. Proc Natl Acad Sci U S A. 1998 Aug 18;95(17):9713-5. Review. PubMed PMID: 9707539; PubMed Central PMCID: PMC33880.
- Benson DA, Karsch-Mizrachi I, Lipman DJ, Ostell J, Sayers EW. GenBank. Nucleic Acids Res. 2009 Jan;37(Database issue):D26-31. Epub 2008 Oct 21. PubMed PMID: 18940867; PubMed Central PMCID: PMC2686462.
- Lipman DJ, Pearson WR. Rapid and sensitive protein similarity searches. Science. 1985 Mar 22;227(4693):1435-41. PubMed PMID: 2983426.
- Pearson WR, Lipman DJ. Improved tools for biological sequence comparison. Proc Natl Acad Sci U S A. 1988 Apr;85(8):2444-8. PubMed PMID: 3162770; PubMed Central PMCID: PMC280013.