successful nucleic acid - based detection assays must be able to uniquely identify small amounts of potentially diverse pathogen dna or rna in samples that contain large amounts of nucleic acid sequence from background species .
for example , pcr assays to detect the presence of hiv in human blood samples must be able to amplify imperfectly conserved regions of the hiv genome without amplifying any part of the human genome . in silico assay screening
can identify unreliable detection assays and reduce assay development costs by querying sequence databases with assay oligonucleotides ( oligos ) to predict both potential false positive matches and the absence of expected matches ( i.e. false negatives ) . while there are a number of existing software programs for assay - dependent database searching , they are limited in the choice of biochemical assay format , target database size ( a critical consideration for sampling in the presence of a complex background ) and sensitivity of the search algorithm .
many existing tools can search a database with a pair of pcr primers , including e - pcr ( 1 ) , me - pcr ( 2 ) , primex ( 3 ) , simpcr ( 4 ) , bisearch ( 5 ) , spcr ( 6 ) and ipcress ( 7 ) .
however , none of these programs support additional assay formats ( e.g. taqman pcr , an assay commonly used for pathogen detection ) .
additionally , web - based and interactive tools , including puns ( 8) , the website insilico.ehu.es ( 9 ) and amplify ( 10 ) , are typically restricted to searching a single genome . while searching a single genome
is useful for validating or annotating expected true positive matches , generation of robust detection assays requires testing a target database that includes all available near neighbor and background sequences . given the ability to screen a large number of targets , tools must also be able to accurately predict possible assay matches in the target database . to identify matches , most of the existing tools for in silico pcr rely on a heuristic definition of sequence similarity based on the number of mismatches ( non - watson and crick base pairs ) and the number of gaps ( insertions and deletions in the primer - template duplexes ) . as we will demonstrate subsequently , using a thermodynamic similarity measure yields
finally , many programs fail to consider all possible configurations of assay oligos that can result in a positive detection . for example , in addition to the pcr amplicon produced by the forward and reverse primers , palindromic template sequences can generate unintended amplicons when a single oligo serves as both forward and reverse primer .
a common feature of many nucleic acid - based biochemical assays is that detection requires an initial temperature - dependent hybridization of assay oligos to complementary target sequences ( which may then be followed by enzymatic base extension or ligation reactions ) .
the first step in predicting potential matches between assay oligos and target sequences is to identify all potential binding sites in the target sequences that are consistent with user - defined thresholds in hybridization melting temperature ( tm ) and/or free energy change ( g = h  ts ) .
the melting temperature is calculated using 
 1 
 where h and s are computed using the nearest neighbor free energy parameters of santalucia ( 11 ) , r is the universal gas constant and ct is the total molar concentration of strands .
first , initial match candidates are identified by an exhaustive enumeration of exact short word matches between query and target sequences ( 38 bases , as specified by the user ) .
queries that contain degenerate bases ( e.g. r = a or g ) are expanded into multiple queries containing only real bases ( i.e. a , t , g and c ) .
second , a thermodynamic alignment that minimizes the computed free energy change ( g = h  ts ) between the unbound and bound states is used to predict the binding of the assay oligo to the target dna . the free - energy change is a function of a pair - wise sequence alignment and is parameterized in terms of the stacking contributions of pairs of nearest neighbor bases ( 12 ) : each term represents the free - energy contribution of four bases , two pairs of adjacent bases facing each other on the opposite strands of a dna duplex . due to this nearest neighbor dependence ,
the exact dynamic programming calculation of the thermodynamically most probable alignment ( that minimizes g ) for a sequence of length n requires o(n ) operations ( 13 ) .
while o(n ) thermodynamic alignment algorithms have been implemented for dna ( 14,15 ) , the need to screen large numbers of assay oligos against large sequence databases makes the o(n ) cost very expensive , even for short ( 2025 base ) sequences .
a computationally feasible o(n ) algorithm for computing the alignment that minimizes the free energy at either a specified annealing temperature or at the predicted tm has been proposed ( 16,17 ) .
this approach uses an o(n ) dynamic programming algorithm to align two sequences at a specified alignment temperature .
the calculation of the alignment that minimizes the free energy at the predicted tm uses the dinkelbach algorithm to iteratively adjust the alignment temperature until it equals the tm of the aligned duplex .
however , calculation of alignments using o(n ) dynamic programming requires simplification of the duplex free - energy function and the introduction of free - energy parameters not specified in the formal duplex free - energy function . in particular , the exact free - energy dependencies on base - dependent duplex initiation terms , gaps and consecutive mismatches are not included in the simplified free - energy function .
these omissions and modifications decrease the accuracy of the computed duplex free energy . to avoid both the high cost of the exact o(n ) alignment and to reduce the approximation error due to a simplified free - energy function
, we developed a novel , o(n ) thermodynamic alignment algorithm that incorporates and improves on the algorithm of leber et al .
our approach treats the simplified free - energy function of leber et al . as a surrogate ( 18 )
free - energy function whose only purpose is to generate an alignment that approximately minimizes the full duplex free - energy function .
our algorithm divides the calculation of a thermodynamic alignment into two stages . in the first stage
, dynamic programming is used to compute the duplex alignment that minimizes a surrogate free - energy function at the specified alignment temperature . in the second stage ,
the alignment generated in the first stage is used to evaluate the full duplex free energy function described in ref .
the full duplex free energy function provides all thermodynamic parameters of interest : h , s and tm . both stage one and two can be incorporated into the dinkelbach algorithm ( 17 ) and iterated to produce alignments that approximately minimize the full free energy of the duplex at its predicted melting temperature . to insure that the surrogate free - energy function produces alignments that approximately minimize the full duplex free - energy function
the parameters in the surrogate function that are not explicitly specified by the full duplex free - energy function were determined by simulated annealing - based minimizations of the average full duplex free - energy function ( evaluated at the alignments that exactly optimize the surrogate function ) for a test set of 10 randomly generated sequence pairs and a range of hybridization temperatures ( 3565c ) .
the random sequence pairs were approximately 25 bases long , had 50% g + c composition and contained insertions , deletions and mismatches .
we assumed that all parameters depend linearly on temperature and used linear regressions to compute the slope and intercept for each surrogate parameter , as shown in table 1 . 

table 1.optimized surrogate function parameters for computing thermodynamic alignmentsthe bases w , x , y and z represent any of the four bases ( a , t , g or c ) , with the constraint that neither x and y nor w and z form a watson and crick base pair .
each parameter is a linear function of temperature : h  ts . while the s and h values have units of entropy and enthalpy , they are for alignment purposes only .
optimized surrogate function parameters for computing thermodynamic alignments the bases w , x , y and z represent any of the four bases ( a , t , g or c ) , with the constraint that neither x and y nor w and z form a watson and crick base pair .
while the s and h values have units of entropy and enthalpy , they are for alignment purposes only . to assess the accuracy of our thermodynamic alignment algorithm , alignments that minimized the surrogate free - energy function were computed for randomly generated test sets of 10 sequence pairs ( containing insertions , deletions and mutations ) with 25% , 50% and 75% g + c composition and compared to the exact o(n ) alignments produced by the dinamelt server ( 14 ) .
the temperature - dependent error in g is shown in figure 1 . both the single stage method ( of leber et al . ) and the two stage method systematically overestimate g compared to the values produced by the dinamelt server . with the exception of the region above 76c for the 75% g + c test set , our two stage thermodynamic alignment algorithm ( i.e. the full duplex g evaluated at the alignment produced using optimized surrogate parameters ) produces more accurate estimates of duplex free energy than the fixed temperature alignment , dynamic programming algorithm of leber et al .
the observed improvement in g is significant , considering that the free - energy contribution of a a - t pair at 37c ranges from 0.58 to 1.45 kcal / mol [ depending on the identity of the neighboring pair ( 13 ) ] .
the accuracy of our two stage g approximation improves as duplex g + c content increases . however , this is most likely an artifact that arises from whether a - t pairs at the ends of a duplex are treated as watson and crick base pairs or dangling single - stranded dna .
our implementation considers them to be watson and crick base pairs , but the dinamelt server treats them as dangling single stranded dna [ which is the lower energy configuration ( 19 ) ] . 

figure 1.the temperature - dependent thermodynamic alignment approximation error evaluated using randomly generated test sets with ( a ) 25% g + c content , ( b ) 50% g + c content and ( c ) 75% g + c content .
the solid black lines show the average error in the free energy computed using only the non - optimized dynamic programming parameters of leber et al .
the dotted red lines show the average error in the two - stage free energy computed by first producing an alignment using the dynamic programming parameters of leber et al . and then evaluating the free energy using the full duplex free - energy function of santalucia .
finally , the solid red lines show the average error in the two - stage free energy computed by first producing an alignment using optimized dynamic programming parameters and then evaluating the free energy using the full duplex free - energy function of santalucia . for all curves , the approximation error , g ,
is defined as the approximate g minus the exact g computed by the dinamelt server ( 14 ) .
the standard deviations about each point in all graphs are less than or equal to 1.5  10 kcal / mol .
each randomly generated test set of 10 , 25-base sequence pairs ( containing insertions , deletions and mutations ) was pre - screened to insure that no sequence pairs in the test set were also in the training set used to optimize the dynamic programming parameters .
the temperature - dependent thermodynamic alignment approximation error evaluated using randomly generated test sets with ( a ) 25% g + c content , ( b ) 50% g + c content and ( c ) 75% g + c content .
the solid black lines show the average error in the free energy computed using only the non - optimized dynamic programming parameters of leber et al .
the dotted red lines show the average error in the two - stage free energy computed by first producing an alignment using the dynamic programming parameters of leber et al . and then evaluating the free energy using the full duplex free - energy function of santalucia .
finally , the solid red lines show the average error in the two - stage free energy computed by first producing an alignment using optimized dynamic programming parameters and then evaluating the free energy using the full duplex free - energy function of santalucia . for all curves , the approximation error , g ,
is defined as the approximate g minus the exact g computed by the dinamelt server ( 14 ) .
the standard deviations about each point in all graphs are less than or equal to 1.5  10 kcal / mol .
each randomly generated test set of 10 , 25-base sequence pairs ( containing insertions , deletions and mutations ) was pre - screened to insure that no sequence pairs in the test set were also in the training set used to optimize the dynamic programming parameters . to measure the relative speedup of our o(n ) two - stage thermodynamic algorithm compared to the exact o(n ) alignments produced by the dinamelt server
, we computed the average ratio of wall clock execution times for both algorithms using randomly generated test sets with a range of duplex sizes relevant for nucleic acid - based assays . as shown in figure 2 , the size of the observed speedup varies from a factor of 1 ( no speedup ) for a 15 base duplex ( the size of a small pcr primer ) to a factor of 8.5 for a 35 base duplex ( the size of a taqman probe ) .
as one might expect , the two - stage thermodynamic alignment algorithm has an increased computational cost compared to the single stage ( fixed temperature , dynamic programming ) algorithm of leber et al . for all duplex lengths shown ,
the increased computational cost of the second stage ( evaluating the full duplex free energy function using the alignment produced by the first stage ) makes the two - stage algorithm about 20% slower than the single - stage method .
the average wall clock time required to compute a single two - stage thermodynamic alignment using a 2.4 ghz xeon cpu ranges from 1  10 s to 1.8  10 s for a 15 base and 35 base duplex , respectively .
as we will demonstrate subsequently , searches using our o(n ) two - stage algorithm and thousands of pcr primers against the human genome are feasible on small to mid - sized computer clusters . 

figure 2.comparing the time to compute single stage ( fixed temperature , dynamic programming only ) and two - stage thermodynamic alignments to the time to compute o(n ) exact alignments .
speedup is computed as the average of the wall clock time required to compute an exact o(n ) alignment divided by the wall clock time required to compute either a one or two - stage thermodynamic alignment .
wall clock time was computed using the unix time command to measure the run time required to align 10 random duplexes ( containing insertions , deletions and mutations ) of the specified approximate length ( insertions and deletions can change the duplex length ) .
the exact alignments were performed using the hybrid - min program that is included with the dinamelt server ( unafold ) package ( 14 ) .
error bars were computed by averaging the evaluation times of 10 different randomly generated sets of duplexes for each duplex length . comparing the time to compute single stage ( fixed temperature , dynamic programming only ) and two - stage thermodynamic alignments to the time to compute o(n ) exact alignments .
speedup is computed as the average of the wall clock time required to compute an exact o(n ) alignment divided by the wall clock time required to compute either a one or two - stage thermodynamic alignment .
wall clock time was computed using the unix time command to measure the run time required to align 10 random duplexes ( containing insertions , deletions and mutations ) of the specified approximate length ( insertions and deletions can change the duplex length ) .
the exact alignments were performed using the hybrid - min program that is included with the dinamelt server ( unafold ) package ( 14 ) .
error bars were computed by averaging the evaluation times of 10 different randomly generated sets of duplexes for each duplex length .
thermonucleotideblast , a cross - platform command line tool written in c++ and freely distributed under the bsd open source license from http://public.lanl.gov/jgans/tntblast .
the code has been tested on linux , windows and os x , and has been parallelized using the mpi api for distributed memory machines and the openmp api for shared memory machines .
additional documentation for building and running the program is provided at the website listed above .
in silico pcr is a common example of assay - specific searching for which a number of tools already exist .
we compared the specificity and sensitivity of the e - pcr program and our approach ( implemented in the thermonucleotideblast program ) for the task of identifying sequence - tagged sites ( stss ) , which are unique sites in the human genome defined by a pair of pcr primers and an amplicon length . using a methodology based on rotmistrovsky et al .
( 1 ) , we constructed an sts test set that contained 2185 sts primer pairs .
primer pairs were included in the test set if they occurred once and only once in both the genebridge 4 ( 20 ) and stanford g3 ( 21 ) radiation hybrid panels , and were reported to match a single unique site on a single human chromosome .
when evaluating specificity and sensitivity , the first predicted match of an sts to the correct chromosome was counted as a true positive , while any subsequent matches to the correct chromosome were counted as false positives ( 1 ) .
each match of an sts to an incorrect chromosome was counted as a false positive .
an sts that was not correctly assigned to the proper chromosome was counted as a false negative . while significantly slower than e - pcr , thermonucleotideblast can search thousands of pcr primers against the human genome . using a 200 node cluster of 1.2 ghz pentium iii mobile cpus and reading the sequence data from an nfs file server
, thermonucleotideblast required 2 h to search the human genome using the 2185 sts primer pairs . over 99% of this search time
the e - pcr performed the same search in a significantly shorter time : 25 min when run on a single 1.2 ghz cluster node with 2 gb of ram ( with two gaps and two mismatches allowed and a word size of 12 bases ) .
figure 3 has five panels that show the same receiver operator curve for e - pcr plotted with the different receiver operator curves for thermonucleotideblast that were supplemented with an additional match criterion of 04 bases of exact match between the 3 end of the pcr primer and the target sequence .
the additional use of an exact match criterion ( i.e. at the 3 end of the pcr primer ) is a heuristic rule to account for the dna polymerase 's reduced efficiency extending primers that contain 3 terminal mismatches .
a similar strategy is employed by e - pcr , which searches for primer - target matches using a hash table - based search of the last w bases at the 3 end of the primer ( 1 ) .
the primary match criteria used by thermonucleotideblast were ( i ) a g match criteria ranging from 20 to 9 kcal / mol ( solid black line ) , ( ii ) a tm ( computed at 37c ) match criteria ranging from 35c to 60c and ( iii ) a tm ( computed using the dinkelbach algorithm ) match criteria ranging from 35c to 60c . 
 figure 3.comparing e - pcr and thermonucleotideblast in sts search specificity and sensitivity .
comparisons were made by searching a set of 2185 sts primer pairs against the complete human genome ( build 35 , version 1 ) .
specificity is defined as tp/(tp + fp ) and sensitivity is defined as tp/(tp + fn ) , where tp is the number of true positives , fp is the number of false positives and fn is the number of false negatives .
the e - pcr was run using w = 12 ( word size ) and m = 200 ( allowed deviation from the expected amplicon size ) and discontiguous words ( dw ) , as opposed to contiguous words ( cw ) , were activated with f = 3 , as described in ref .
the plotted e - pcr points were computed using the following parameters : ( cw , g = 0 , n = 0 ) , ( cw , g = 0 , n = 1 ) , ( cw , g = 1 , n = 1 ) , ( dw , g = 0 , n = 1 ) , ( dw , g = 1 , n = 1 ) , ( dw , g = 2 , n = 1 ) , ( dw , g = 1 , n = 2 ) and ( dw , g = 2 , n = 2 ) , where g is the number of allowed gaps and
thermonucleotideblast was run using single - primer - pcr = false ( to disable searching for pcr amplicons produced by a single amplicon ) , w = 7 ( requiring an exact match of seven bases to initiate a thermodynamic alignment ) , s = 0.05 ( salt concentration in m ) , t = 9  10 ( strand concentration in m ) , l = 1000 ( maximum allowed amplicon size ) and dangle5 = false and dangle3 = false ( to disable the use of dangling end bases at both ends of a thermodynamic alignment ) .
each of the five graphs shows the effects of requiring an increasing the number of exact matches at the 3 end of each pcr primer  however , the same e - pcr curve is reproduced in each graph . to compare the specificity and sensitivity of different match criteria ,
thermonucleotideblast searches were performed using g ( solid black curve ) , tm at 37c ( solid red curve ) and tm computed using the dinkelbach algorithm ( solid blue curve ) .
comparisons were made by searching a set of 2185 sts primer pairs against the complete human genome ( build 35 , version 1 ) .
specificity is defined as tp/(tp + fp ) and sensitivity is defined as tp/(tp + fn ) , where tp is the number of true positives , fp is the number of false positives and fn is the number of false negatives .
the e - pcr was run using w = 12 ( word size ) and m = 200 ( allowed deviation from the expected amplicon size ) and discontiguous words ( dw ) , as opposed to contiguous words ( cw ) , were activated with f = 3 , as described in ref .
the plotted e - pcr points were computed using the following parameters : ( cw , g = 0 , n = 0 ) , ( cw , g = 0 , n = 1 ) , ( cw , g = 1 , n = 1 ) , ( dw , g = 0 , n = 1 ) , ( dw , g = 1 , n = 1 ) , ( dw , g = 2 , n = 1 ) , ( dw , g = 1 , n = 2 ) and ( dw , g = 2 , n = 2 ) , where g is the number of allowed gaps and
thermonucleotideblast was run using single - primer - pcr = false ( to disable searching for pcr amplicons produced by a single amplicon ) , w = 7 ( requiring an exact match of seven bases to initiate a thermodynamic alignment ) , s = 0.05 ( salt concentration in m ) , t = 9  10 ( strand concentration in m ) , l = 1000 ( maximum allowed amplicon size ) and dangle5 = false and dangle3 = false ( to disable the use of dangling end bases at both ends of a thermodynamic alignment ) .
each of the five graphs shows the effects of requiring an increasing the number of exact matches at the 3 end of each pcr primer 
however , the same e - pcr curve is reproduced in each graph . to compare the specificity and sensitivity of different match criteria
, thermonucleotideblast searches were performed using g ( solid black curve ) , tm at 37c ( solid red curve ) and tm computed using the dinkelbach algorithm ( solid blue curve ) .
as shown in figure 3 , the g match criterion consistently outperforms e - pcr in search sensitivity .
furthermore , it matches e - pcr in specificity when supplemented with the additional , pcr - specific heuristic requiring an exact match of at least three bases at the 3 end of each primer .
finally , the g match criterion is both more sensitive and specific than either of the melting temperature - based criteria .
 nucleic acid - based biochemical assays are crucial to modern biology 
 . key applications , such as detection of bacterial , viral and fungal pathogens , require detailed knowledge of assay sensitivity and specificity to obtain reliable results 
 . improved methods to predict assay performance are needed for exploiting the exponentially growing amount of dna sequence data and for reducing the experimental effort required to develop robust detection assays . toward this goal , we present an algorithm for the calculation of sequence similarity based on dna thermodynamics . in our approach , 
 search queries consist of one to three oligonucleotide sequences representing either a hybridization probe , a pair of padlock probes or a pair of pcr primers with an optional taqman probe ( i.e. in silico or  virtual pcr ) . 
 matches are reported if the query and target satisfy both the thermodynamics of the assay ( binding at a specified hybridization temperature and/or change in free energy ) and the relevant biological constraints ( assay sequences binding to the correct target duplex strands in the required orientations ) . 
 the sensitivity and specificity of our method is evaluated by comparing predicted to known sequence tagged sites in the human genome . 
 free energy is shown to be a more sensitive and specific match criterion than hybridization temperature . 
INTRODUCTION
MATERIALS AND METHODS
RESULTS AND DISCUSSION