BACKGROUND
microarrays and other genomic technologies allow the testing of thousands of genomic regions from each sample.
most of these methods require pcr amplification to achieve sufficiently strong signals.
therefore, there is a growing need for automatic oligo design and pcr primer design methods.
there is always a certain chance that the selected pcr primers have alternative binding sites on the template dna.
it is expected that numerous alternative binding sites of the pcr primers may cause failures in pcr.
however, the exact relationship between the number of binding sites in the genome and the success rate is not known.
the computational prediction of these unwanted interactions would help to increase the quality of microarrays and genomic pcr and to reduce the cost of related experiments.
a large variety of pcr primer design programs exist.
nevertheless, only few of them allow some kind of testing for primer uniqueness and/or testing for alternative products from the same template.
some programs use repeat libraries to avoid primer design from repeated regions.
for example, a program called pc-rare uses 8-mer frequency disparity at the 3' end of primers to avoid the risk of non-specific binding of primers  <cit> .
fast-pcr program allows homology search against the custom list of repeated sequences  <cit> .
oligo <dig>  <cit>  uses libraries that contain all the frequent 6-mer to exclude the primers that contain highly repeated motifs.
a well-known primer <dig>  <cit>  can be used with the collection of repeats  to avoid non-specific binding of primers.
however, the primers are compared to a repeat library using the smith-waterman algorithm  <cit> , which makes use of large libraries for the design of a large number of primers slow and therefore unpractical.
some programs use suffix trees or suffix arrays to ensure the uniqueness of selected oligos.
picky is an oligo design software that allows one to create unique hybridisation oligos  <cit> .
this program uses a suffix-tree based algorithm to test the uniqueness of oligo candidates in a user-given sequence set.
rahmann presents a method that uses the longest common substring as a specificity measure for candidate oligos  <cit> .
this algorithm is based on a suffix array with additional information that is efficient both in terms of memory usage and running time to rank all candidate oligos according to their specificity.
the masking of repeats on the template dna is another common approach that is used to avoid non-specific binding.
dust  <cit>  and tandemrepeatsfinder  <cit>  are commonly used for masking simple  repeat motifs.
repeatmasker is a universal program that is used for masking out several kinds of repeats and therefore mostly used for this kind of sequence analysis  <cit> .
similarly, blast  <cit>  can be used to mask the non-unique regions of the genome  <cit> .
onodera and melcher have found that unfavored and preferred 3' end triplets existed in different viral genome sequences  <cit> .
they recommend a scoring system incorporating empirical frequencies of different 3' end triplets and that information may be used in masking primer candidates with poor success rate in other genomic sequences.
another widely used method related to the success of the pcr is prediction of all pcr products from the genome sequence.
this process is known as electronic pcr  or virtual pcr .
electronic pcr was first developed to detect the presence of sequence tagged sites  in template dna  <cit> .
virtual pcr is a web based service that predicts pcr products from different genomes  <cit> .
spcr is a recently published program that can help the user to choose a pcr primer pair giving the least possible non-targeted products  <cit> .
its algorithm is based on the hypothesis that the annealing of a primer to a template is an information transfer process.
we will use the term 'e-pcr' for all similar computational predictions of pcr products throughout this paper.
the process of e-pcr is typically performed with the help of sequence alignment software, which counts the number of identical or nearly identical matches between the primer and the template dna.
the blast program is most frequently used for this purpose in multiple applications  <cit> .
nevertheless, the speed of blast is not sufficient for e-pcr in large eukaryotic genomes with large number of primers.
high-speed methods applicable to large-scale problems are becoming more important with the increasing number of genome sequences.
the speed can be increased by using megablast  <cit> , blat  <cit>  or ssaha  <cit>  which are specifically designed for large scale sequence search and alignment.
a primer design program called muplex includes blat software to align primer candidates against genomic dna  <cit> .
these methods are relatively fast, but unfortunately all of them require specific parsers to count all primer binding sites and to find all pcr products on the template dna.
primex  <cit> , on the other hand is specifically designed for testing oligos and counting primer binding sites from genomic dna.
another recently reported program, me-pcr  <cit> , is designed for the detection of locations of sts markers in the human genome and is helpful for the detection of pcr products of any type.
there is a similar program called in-situ pcr   <cit>  created by jim kent that is also designed for predicting possible pcr products that two primers could produce.
in this paper, we describe a novel and efficient method, which masks large sequence files for repeats, performs a rapid prediction of all binding sites of pcr primers and predicts possible pcr products.
the efficiency of our program is compared to several existing methods.
implementation
components of the software package
the genomemasker package can be divided into two separate parts:  <dig>  a repeat masking application ,  <dig>  an e-pcr application for predicting primer binding sites and pcr products .
they contain the following executables:
<dig>  genomemasker application
glistmaker – creates a so called blacklist of over-represented  primer binding sites in a given genome.
gmasker – performs a binary search in the blacklist for each studied fasta sequence and masks the words present in the blacklist.
gm_primer <dig> – a modified primer <dig> program that is able to use gmasker output for primer design.
<dig>  genometester application
gindexer – creates binary index files containing locations of all the predicted binding sites in a given genome.
gtester – performs a binary search in index files for each primer to locate all their binding sites in a given genome.
gt2multiplex – extracts nucleotide sequences of all pcr products from template sequence using the output information of gtester.
the genomemasker algorithm
the first part of the package – genomemasker application – contains programs required for the masking of repeated primer binding sites on the template dna.
the program glistmaker reads through the template sequence and counts the number of occurrences of each word of user-defined length.
after that it creates a blacklist containing only over-represented words, encoded into  <dig> bit integers.
the encoding is done by allocating two consecutive bits for each nucleotide in a word.
thus the maximum word length in current implementation is  <dig> nucleotides.
we define the over-represented word as the sequence that occurs in the given genome more times than a user-given cutoff .
the entire list of encoded words is sorted for faster access.
the input for glistmaker is one or more fasta files .
the program gmasker uses blacklist file as a reference to mask the sequence file in fasta format.
it iterates over the whole input sequence with step  <dig> nucleotide and checks forward word, its reverse complement or both against the blacklist.
if a given word is in the blacklist, the corresponding word in the template sequence is masked.
only one nucleotide at the 3' end of the matching word is masked by default, because this should be sufficient to avoid most of the low-success pcr primers.
nevertheless, the user can define how many nucleotides will be masked by gmasker with a special option.
the output of the program is a fasta file identical to input file, except that it contains masked nucleotides  in regions where primers should not be selected.
instead of uppercase-lowercase masking, any user-defined character can also be used for masking by gmasker.
however, the lowercase masking is recommended because it maintains the sequence information at masked sites and allows subsequent primer design from the masked sequence.
the program gm_primer <dig> is a modification of primer <dig> that is able to use the lowercase-masked sequence for primer design.
the overall functionality and algorithm of the program is the same as in the original primer <dig>  but we have added a new filtering feature that rejects the primer candidates with lowercase letters in 3' end.
however, gm_primer <dig> can be used to design primers from templates masked by other methods as well.
the genometester algorithm
the second part of the package, the genometester application, contains programs for predicting primer binding sites and pcr products in long template dna sequences, e.g.
eukaryotic genomes.
the program gindexer is needed to create index files for gtester to work.
it creates  <dig> different index files for each sequence file – all words starting with a, c, t and g nucleotide.
for example, four index files will be created for  <dig> human chromosomes creating a total number of  <dig> files.
the creation of a separate index file for each nucleotide is necessary to reduce the file size and memory usage of gtester.
in an index file we keep  <dig> bytes of data for each occurrence of each word in the whole genomic sequence.
the first  <dig> bytes represent the word, encoded as  <dig> bit integer,  <dig> bits per nucleotide.
the last  <dig> bytes contain the position of the current occurrence of the word in the genomic sequence.
the word length can be specified by the user within the range between  <dig> and  <dig> nucleotides.
the entire file is sorted by the encoded word  in order to allow high speed binary search with the gtester.
the sequence files of chromosomes in fasta format are used as input of gindexer.
the program gtester works in four steps.
during the first step, it creates an array structure of primer pairs.
for each primer pair, it takes a word of given length  from the 3' end of the primer and creates  <dig> words – one original and one reverse complement.
in step  <dig>  a binary search is performed with all words in the array against index files.
another list with the locations of the binding sites is created in step  <dig>  finally, the program finds all pcr products that are possibly synthesized by the given primer pair hybridizing on both sense and antisense chains of the dna.
pcr products generated by a single primer are also considered.
for both parts of the package, primer binding sites can be modelled with a custom, user-defined word length.
advantages of our implementation
the speed of the programs in this package is achieved by extensive pre-processing of the genomic data.
both applications, genomemasker and genometester, require preprocessed files to work efficiently.
during the creation of these files all the locations in the genome are counted, sorted and recorded in a binary format.
the blacklist of genomemasker contains the list of all over-represented binding sites.
the index files of genometester contain a list of all binding sites together with their location in the genome.
there are two reasons why genometester and genomemasker are faster than most other similar applications.
first, both of them use the fast binary search algorithm which runs in o time.
the binary search algorithm  <cit>  can be briefly explained as follows.
the search itself begins by examining the value in the center of the list .
these values in the list are sorted, so the program knows whether the value occurs before or after the center value.
then the program searches through the correct half in the same way as before.
those cycles will be repeated until the searched value is found or until there are no more values to check.
the second advantage of our programs is an on-demand memory-mapping technique that allows us to achieve optimal speed for analyzing both small and large input datasets.
the programs gmasker and gtester also use an on-demand memory-mapping technique.
instead of pre-reading the entire index into memory they only read the requested parts .
those parts will stay in a memory cache and thus the search speed per string will increase gradually when using more search strings, as more of the index will need to be read into the memory.
parameters for comparing different programs
all software programs were tested on assembled chromosome sequences derived from ensembl database human  <dig>  .
the computational performance tests described here were obtained by running all the programs on a  <dig>  ghz intel xeon™ processor machine with  <dig> gb of ram.
repeatmasker  was used with different sensitivity parameters -s, -q and -qq.
-s means "slow search", which is 0–5% more sensitive and 2– <dig> times slower than default.
-q is a "quick search", 5–10% less sensitive and 2– <dig> times faster than default.
-qq is a "rush job", about 10% less sensitive and 4–> <dig> times faster than default.
we used repbase update  <cit>   <dig>  library  of repeated motifs in human genome.
dust was used with default parameters.
tandemrepeatfinder was used with alignment parameters   <dig>   <dig> and  <dig>  minimum alignment score to report repeat  <dig> and maximum period size  <dig>  genomemasker blacklist was created with word length  <dig> and word length  <dig> and with over-represented cutoffs  <dig> and  <dig> respectively.
the masking program gmasker was used with masking letter parameter 'l'  and masking type parameter 'target  <dig> 501'.
the ssaha indexes were created with the word length parameter   <dig> and step length   <dig>  ssaha searches were performed with match lengths   <dig>  primex indexes were created with default parameters and word length   <dig>  the number of mismatches allowed in each lookup table word  and the number of mismatches allowed in the entire query  were set to  <dig> and  <dig> respectively.
me-pcr was executed with parameters: word size   <dig>  number of mismatches allowed   <dig>  margin   <dig> and default pcr size   <dig>  the parameters as word size   <dig> and maximal total length of queries for a single search   <dig> were used for megablast.
all results were parsed with word length  <dig> .
the maximum size of the pcr product  was set to  <dig> bp with stand-alone ispcr.
genometester indexes were created with word length  <dig> and the program gtester was used with default parameters.
RESULTS
the genomemasker package
predicting the number and location of pcr primer binding sites in large genomes can pose computational challenges.
therefore we have designed a software package genomemasker that helps to achieve a fully automatic sequence masking and pcr primer testing for large genomic applications.
the first part of the package – genomemasker – is designed to mask all repeated primer binding sites in the template sequence to avoid selection of such primers.
the essence of sequence masking is in finding and marking sequence regions with specific properties, e.g.
repeated regions of sequence.
masked nucleotides are typically replaced by character 'x' or converted to a lowercase character.
unlike the widely used masking program repeatmasker, genomemasker masks only the 3'-terminal nucleotide of each repeated word, which is sufficient to avoid primer design from the repeated region.
to be able to use that masked sequence for designing unique pcr primers, the primer <dig> program was modified to distinguish between upper- and lowercase letters in a masked template file.
if a primer candidate ends with a lower-case letter it will be rejected by primer <dig> and unique primer will be designed from the remaining candidates.
however, other primer design methods that can use masked sequence could also work with the genomemasker output file.
another important test for genomic pcr applications is the prediction of the number of all possible pcr products, which a given primer pair can generate from a given genome.
this can effectively be done by the second part of our package called genometester.
genometester counts and locates all potential binding sites of the pcr primer pair in the genome and predicts the location of all pcr products that could be generated with these primers.
these two main methods – genomemasker and genometester – can be used independently.
our software models the pcr primer binding site as 100% identical match to a continuous string  from primer's 3' end with a fixed length.
user defined length in the range of  <dig> and  <dig> nucleotides can be used.
the bindings with mismatches are not modeled for several reasons.
firstly, for each 16-mer oligonucleotide there are  <dig> variants with a single mismatch.
counting the number of occurences and keeping track of genomic location of all these variants would increase the computing time significantly.
secondly, it is not known whether counting mismatch containing primer binding sites helps to predict the pcr success rate better than counting full-match primer binding sites.
until the relationship between the number of mismatched binding sites and pcr success is known we prefer not to use mismatched binding sites.
workflow of the program package
the creation of either a blacklist for genomemasker or the indexes for genometester from the entire human genome takes approximately three hours on a linux server with  <dig>  ghz xeon processor, at least  <dig> gb of ram and scsi disks.
once the preprocessing is done, the masking, primer design and primer testing steps are extremely fast.
the algorithmic details are more thoroughly described in the chapter "implementation and methods".
genomemasker: comparison of repeat masking methods
to compare the properties of our package with the properties of other repeat detection and masking methods we chose  <dig> random regions from the human genome, each  <dig> bp long.
the sequences were masked with repeatmasker and genomemasker.
pcr primer design was attempted from each sequence.
both masking programs were used at similar sensitivities – the overall fraction of masked nucleotides was similar .
the results of masking are shown in figure  <dig>  the general tendency is that masking by genomemasker is more detailed than masking by repeatmasker.
in sequences masked by repeatmasker short repeats are often not detected.
incomplete repbase libraries may be one of the causes of that.
on the other hand some other dna regions are extensively masked by repeatmasker and cannot be used for primer design.
genomemasker, however, masks only a single nucleotide in the 3'-end of each over-represented word it finds.
this creates a more detailed masking pattern and allows the design of primers inside complicated regions between repetitive sequences.
detailed masking is legitimate because genomemasker assures that any non-masked word is not repeated in the genomic dna sequence.
we compared the properties of primers designed from template dna masked with different programs .
in addition to genomemasker and repeatmasker we studied the primers designed from the non-masked templates using the repeat detection library built-in into the primer <dig> program.
we also used short repeats masking programs dust and tandemrepeatsfinder.
the amount of outcoming primers and their properties are rather different.
it turns out that using only the default repeat library of primer <dig>  masking with dust or tandemrepeatsfinder is not sufficient to design non-repeated primers.
as much as 39% of primers designed using primer <dig> repeat library still occur in more than  <dig> locations in the genome, which, according to our estimates can reduce the success rate of pcr.
repeatmasker is good in avoiding such repeated regions, but unfortunately it tends to mask large regions thus making the primer design impossible in complicated regions.
primer design was not possible in around 31% of randomly chosen regions masked by the repeatmasker.
the computational performance of genomemasker compared to repeatmasker is shown in figure  <dig>  repeatmasker was used with several different sensitivity parameters and genomemasker with two different word lengths.
genomemasker is at least  <dig> times faster compared to repeatmasker.
to simplify the primer design process, the user can pre-mask the entire human genome within 6– <dig> hours and subsequently use the masked genomic sequence for various primer design tasks.
genometester: comparison between e-pcr methods
although the masking of template sequences with genomemasker avoids low-quality primer design, some primer pairs may still produce two or more alternative pcr products which should be avoided.
also, users may have existing primer pairs that they would like to evaluate against the given genome for the number of binding sites.
therefore, it may be necessary to perform a search against the entire genome for primer binding sites and detect the location of possible products.
such searches are typically done with sequence homology programs  or with dedicated e-pcr programs .
the computation time and the memory requirements of e-pcr programs are important factors, particularly when dealing with large datasets like eukaryotic genomes.
to compare the speed of different methods we created five datasets, consisting of  <dig>   <dig>   <dig>   <dig> and  <dig> randomly selected primer pairs.
all datasets were subjected to the e-pcr against the human genome with seven different programs and the computing time of the results was recorded.
the results of the comparison are shown in figure  <dig>  the speed difference between the fastest methods and more traditional sequence homology search programs like blast and megablast is more than 100-fold.
me-pcr program seems to be more effective for larger datasets than other e-pcr methods.
however, one should keep in mind that although the recent e-pcr methods like me-pcr and ispcr are very fast, they are designed to locate pcr products only.
other studied programs are able to record the location and number of all primer binding sites.
physical memory requirement for the e-pcr procedure on human chromosomes is approximately 1gb for ssaha,  <dig> mb for genometester and ispcr and ca  <dig> mb for other methods.
please note that all the programs shown in figure  <dig> were compared in standalone mode.
the performance of most of the programs can be increased by using server-client architecture .
discussion
large-scale genomic studies often require amplification of genomic dna by pcr.
therefore, automatic pcr primer design is one of the critical steps in such studies.
we have created a novel method for masking repeated regions in sequences.
it allows masking of the entire template dna before primer design to avoid the consideration of poor primer candidates.
genomemasker is able to identify and mask repeating words that have not been included in the current repeat libraries.
this, combined with a specific 3'-end masking technique, allowed us to achieve a more sensitive masking than the existing approaches.
programs like dust and tandemrepeatsfinder are designed for masking short repeat motifs and are faster than our method, but their ability to find different types of longer repeats is lower, as demonstrated in table  <dig>  masking repeats may help to increase pcr success rate, but this might not be sufficient for some applications.
for example, genotyping  <cit>  requires that a unique pcr product must be generated from the human genome.
therefore, additional e-pcr step is still required after candidate primer pair is selected, which in our case is done with the genometester application.
the method presented in this paper offers the possibility to increase specificity and speed of finding non-unique words by using word indexing and binary search algorithm compared to other repeat-masking and e-pcr methods.
the package also contains an optional primer design program that can be replaced with desired software.
therefore, the main advantage of our method is speed, unique masking style and the possibility to quickly locate alternative pcr primer binding sites and products.
all programs in our test must read the genome sequence information from a hard drive.
this information is typically pre-processed and saved into a database or an index in a specific binary format.
databases or indexes that need to be read from hard drive are rather large.
total size of indexes for the human chromosomes is approximately  <dig> gb for blast and megablast,  <dig> gb for ssaha and  <dig> gb for genometester.
when executed, most programs initially read all database/index data into ram, which speeds up the search, particularly for large datasets.
however, for searching only a few primer pairs the entire database/index may not be necessary.
the pre-processed and sorted index of genometester allows identifying locations of the given primer pair by reading only a fraction of the index file.
our package is based on finding the exact matches between sequences.
newer methods  <cit>  and algorithms  <cit>  allow considering mismatches when comparing oligos against large genomic sequence.
whereas it would be possible to enhance our programs so that the bindings with single mismatches would be taken into account, the current implementation would require about 45– <dig> times more computing time for both gtester and gmasker.
the number comes from the fact that there are  <dig> mismatched variants per each nucleotide within a given word.
for example, 16-mer oligonucleotide would have  <dig> different single-mismatch oligos.
we could forbid the mismatch at 3'-end of oligo, but nevertheless the number of different variants to search is huge.
the problem is particularly serious with the genometester which keeps track of the location of each potential binding site.
thus, the memory requirement for storing all the locations would be enormous.
also, there is no good model to estimate how different mismatches should be weighted.
for example, it is usually expected that mismatches near the 3' end disturb primer binding and subsequent replication matter much more than the ones near 5' end.
the exact dependence between mismatch location and binding strength is not known.
additionally, the strength of the mismatched dna duplex is somewhat weaker than the duplex with exact matches  <cit> .
thus, the relative influence of mismatched binding sites to the success rate of pcr compared to fully complementary binding sites is poorly understood and their importance in predicting pcr success cannot be estimated without extensive experimental studies.
however, we have examined the correlation between the number of perfect match binding sites and the number of binding sites with single mismatch.
we have taken all strings with length  <dig> nucleotides from the human genome.
for each oligonucleotide, two things were counted 1) the number of binding sites in the genome as 100% identical match and 2) the number of binding sites in the genome containing single mismatch.
these two numbers were plotted against each other and a strong linear correlation was observed .
as these two values are strongly correlated we would expect them to be almost equally efficient predictors of pcr success.
thus, counting of mismatched binding sites is not likely to give a significant improvement for the prediction of pcr success.
CONCLUSIONS
we have created a novel method for masking repeated regions in sequences, detecting all pcr primer binding sites and possible pcr products from the human genome.
the genomemasker package is suitable for researchers who need to evaluate or design unique pcr primers in genomic scale.
it is able to mask the entire human genome for non-unique primers within  <dig> hours and find locations of all binding sites for  <dig>  <dig> designed primer pairs within  <dig> minutes.
availability and requirements
project name: genomemasker package
project homepage:
operating system: unix/linux
programming language: c/c++
other requirements: none
license: the package is freely available to academic users
any restrictions to use by non-academics: licence needed
the web client for the genometester program is available at  and the web client for the genomemasker is available at .
authors' contributions
ra conducted this study, carried out different tests on various methods, validated the package and was responsible for drafting the manuscript.
er created the initial code of the package and lk optimized the code.
mr contributed to the conception of this study, participated in its design and coordination and helped to draft the manuscript.
all authors have read and approved the final manuscript.

 microarrays and other genomic technologies allow the testing of thousands of genomic regions from each sample. most of these methods require pcr amplification to achieve sufficiently strong signals. therefore, there is a growing need for automatic oligo design and pcr primer design methods. there is always a certain chance that the selected pcr primers have alternative binding sites on the template dna. it is expected that numerous alternative binding sites of the pcr primers may cause failures in pcr. however, the exact relationship between the number of binding sites in the genome and the success rate is not known. the computational prediction of these unwanted interactions would help to increase the quality of microarrays and genomic pcr and to reduce the cost of related experiments. a large variety of pcr primer design programs exist. nevertheless, only few of them allow some kind of testing for primer uniqueness and/or testing for alternative products from the same template. some programs use repeat libraries to avoid primer design from repeated regions. for example, a program called pc-rare uses 8-mer frequency disparity at the 3' end of primers to avoid the risk of non-specific binding of primers. fast-pcr program allows homology search against the custom list of repeated sequences. oligo uses libraries that contain all the frequent 6-mer to exclude the primers that contain highly repeated motifs. a well-known primer can be used with the collection of repeats to avoid non-specific binding of primers. however, the primers are compared to a repeat library using the smith-waterman algorithm, which makes use of large libraries for the design of a large number of primers slow and therefore unpractical. some programs use suffix trees or suffix arrays to ensure the uniqueness of selected oligos. picky is an oligo design software that allows one to create unique hybridisation oligos. this program uses a suffix-tree based algorithm to test the uniqueness of oligo candidates in a user-given sequence set. rahmann presents a method that uses the longest common substring as a specificity measure for candidate oligos. this algorithm is based on a suffix array with additional information that is efficient both in terms of memory usage and running time to rank all candidate oligos according to their specificity. the masking of repeats on the template dna is another common approach that is used to avoid non-specific binding. dust and tandemrepeatsfinder are commonly used for masking simple repeat motifs. repeatmasker is a universal program that is used for masking out several kinds of repeats and therefore mostly used for this kind of sequence analysis. similarly, blast can be used to mask the non-unique regions of the genome. onodera and melcher have found that unfavored and preferred 3' end triplets existed in different viral genome sequences. they recommend a scoring system incorporating empirical frequencies of different 3' end triplets and that information may be used in masking primer candidates with poor success rate in other genomic sequences. another widely used method related to the success of the pcr is prediction of all pcr products from the genome sequence. this process is known as electronic pcr or virtual pcr. electronic pcr was first developed to detect the presence of sequence tagged sites in template dna. virtual pcr is a web based service that predicts pcr products from different genomes. spcr is a recently published program that can help the user to choose a pcr primer pair giving the least possible non-targeted products. its algorithm is based on the hypothesis that the annealing of a primer to a template is an information transfer process. we will use the term'e-pcr' for all similar computational predictions of pcr products throughout this paper. the process of e-pcr is typically performed with the help of sequence alignment software, which counts the number of identical or nearly identical matches between the primer and the template dna. the blast program is most frequently used for this purpose in multiple applications. nevertheless, the speed of blast is not sufficient for e-pcr in large eukaryotic genomes with large number of primers. high-speed methods applicable to large-scale problems are becoming more important with the increasing number of genome sequences. the speed can be increased by using megablast, blat or ssaha which are specifically designed for large scale sequence search and alignment. a primer design program called muplex includes blat software to align primer candidates against genomic dna. these methods are relatively fast, but unfortunately all of them require specific parsers to count all primer binding sites and to find all pcr products on the template dna. primex, on the other hand is specifically designed for testing oligos and counting primer binding sites from genomic dna. another recently reported program, me-pcr, is designed for the detection of locations of sts markers in the human genome and is helpful for the detection of pcr products of any type. there is a similar program called in-situ pcr created by jim kent that is also designed for predicting possible pcr products that two primers could produce. in this paper, we describe a novel and efficient method, which masks large sequence files for repeats, performs a rapid prediction of all binding sites of pcr primers and predicts possible pcr products. the efficiency of our program is compared to several existing methods. implementation components of the software package the genomemasker package can be divided into two separate parts: a repeat masking application, an e-pcr application for predicting primer binding sites and pcr products. they contain the following executables: genomemasker application glistmaker – creates a so called blacklist of over-represented primer binding sites in a given genome. gmasker – performs a binary search in the blacklist for each studied fasta sequence and masks the words present in the blacklist. gm_primer – a modified primer program that is able to use gmasker output for primer design. genometester application gindexer – creates binary index files containing locations of all the predicted binding sites in a given genome. gtester – performs a binary search in index files for each primer to locate all their binding sites in a given genome. gt2multiplex – extracts nucleotide sequences of all pcr products from template sequence using the output information of gtester. the genomemasker algorithm the first part of the package – genomemasker application – contains programs required for the masking of repeated primer binding sites on the template dna. the program glistmaker reads through the template sequence and counts the number of occurrences of each word of user-defined length. after that it creates a blacklist containing only over-represented words, encoded into bit integers. the encoding is done by allocating two consecutive bits for each nucleotide in a word. thus the maximum word length in current implementation is nucleotides. we define the over-represented word as the sequence that occurs in the given genome more times than a user-given cutoff. the entire list of encoded words is sorted for faster access. the input for glistmaker is one or more fasta files. the program gmasker uses blacklist file as a reference to mask the sequence file in fasta format. it iterates over the whole input sequence with step nucleotide and checks forward word, its reverse complement or both against the blacklist. if a given word is in the blacklist, the corresponding word in the template sequence is masked. only one nucleotide at the 3' end of the matching word is masked by default, because this should be sufficient to avoid most of the low-success pcr primers. nevertheless, the user can define how many nucleotides will be masked by gmasker with a special option. the output of the program is a fasta file identical to input file, except that it contains masked nucleotides in regions where primers should not be selected. instead of uppercase-lowercase masking, any user-defined character can also be used for masking by gmasker. however, the lowercase masking is recommended because it maintains the sequence information at masked sites and allows subsequent primer design from the masked sequence. the program gm_primer is a modification of primer that is able to use the lowercase-masked sequence for primer design. the overall functionality and algorithm of the program is the same as in the original primer but we have added a new filtering feature that rejects the primer candidates with lowercase letters in 3' end. however, gm_primer can be used to design primers from templates masked by other methods as well. the genometester algorithm the second part of the package, the genometester application, contains programs for predicting primer binding sites and pcr products in long template dna sequences, e.g. eukaryotic genomes. the program gindexer is needed to create index files for gtester to work. it creates different index files for each sequence file – all words starting with a, c, t and g nucleotide. for example, four index files will be created for human chromosomes creating a total number of files. the creation of a separate index file for each nucleotide is necessary to reduce the file size and memory usage of gtester. in an index file we keep bytes of data for each occurrence of each word in the whole genomic sequence. the first bytes represent the word, encoded as bit integer, bits per nucleotide. the last bytes contain the position of the current occurrence of the word in the genomic sequence. the word length can be specified by the user within the range between and nucleotides. the entire file is sorted by the encoded word in order to allow high speed binary search with the gtester. the sequence files of chromosomes in fasta format are used as input of gindexer. the program gtester works in four steps. during the first step, it creates an array structure of primer pairs. for each primer pair, it takes a word of given length from the 3' end of the primer and creates words – one original and one reverse complement. in step a binary search is performed with all words in the array against index files. another list with the locations of the binding sites is created in step finally, the program finds all pcr products that are possibly synthesized by the given primer pair hybridizing on both sense and antisense chains of the dna. pcr products generated by a single primer are also considered. for both parts of the package, primer binding sites can be modelled with a custom, user-defined word length. advantages of our implementation the speed of the programs in this package is achieved by extensive pre-processing of the genomic data. both applications, genomemasker and genometester, require preprocessed files to work efficiently. during the creation of these files all the locations in the genome are counted, sorted and recorded in a binary format. the blacklist of genomemasker contains the list of all over-represented binding sites. the index files of genometester contain a list of all binding sites together with their location in the genome. there are two reasons why genometester and genomemasker are faster than most other similar applications. first, both of them use the fast binary search algorithm which runs in o time. the binary search algorithm can be briefly explained as follows. the search itself begins by examining the value in the center of the list. these values in the list are sorted, so the program knows whether the value occurs before or after the center value. then the program searches through the correct half in the same way as before. those cycles will be repeated until the searched value is found or until there are no more values to check. the second advantage of our programs is an on-demand memory-mapping technique that allows us to achieve optimal speed for analyzing both small and large input datasets. the programs gmasker and gtester also use an on-demand memory-mapping technique. instead of pre-reading the entire index into memory they only read the requested parts. those parts will stay in a memory cache and thus the search speed per string will increase gradually when using more search strings, as more of the index will need to be read into the memory. parameters for comparing different programs all software programs were tested on assembled chromosome sequences derived from ensembl database human. the computational performance tests described here were obtained by running all the programs on a ghz intel xeon™ processor machine with gb of ram. repeatmasker was used with different sensitivity parameters -s, -q and -qq. -s means "slow search", which is 0–5% more sensitive and 2– times slower than default. -q is a "quick search", 5–10% less sensitive and 2– times faster than default. -qq is a "rush job", about 10% less sensitive and 4–> times faster than default. we used repbase update library of repeated motifs in human genome. dust was used with default parameters. tandemrepeatfinder was used with alignment parameters and minimum alignment score to report repeat and maximum period size genomemasker blacklist was created with word length and word length and with over-represented cutoffs and respectively. the masking program gmasker was used with masking letter parameter'l' and masking type parameter'target 501'. the ssaha indexes were created with the word length parameter and step length ssaha searches were performed with match lengths primex indexes were created with default parameters and word length the number of mismatches allowed in each lookup table word and the number of mismatches allowed in the entire query were set to and respectively. me-pcr was executed with parameters: word size number of mismatches allowed margin and default pcr size the parameters as word size and maximal total length of queries for a single search were used for megablast. all results were parsed with word length. the maximum size of the pcr product was set to bp with stand-alone ispcr. genometester indexes were created with word length and the program gtester was used with default parameters.  the genomemasker package predicting the number and location of pcr primer binding sites in large genomes can pose computational challenges. therefore we have designed a software package genomemasker that helps to achieve a fully automatic sequence masking and pcr primer testing for large genomic applications. the first part of the package – genomemasker – is designed to mask all repeated primer binding sites in the template sequence to avoid selection of such primers. the essence of sequence masking is in finding and marking sequence regions with specific properties, e.g. repeated regions of sequence. masked nucleotides are typically replaced by character'x' or converted to a lowercase character. unlike the widely used masking program repeatmasker, genomemasker masks only the 3'-terminal nucleotide of each repeated word, which is sufficient to avoid primer design from the repeated region. to be able to use that masked sequence for designing unique pcr primers, the primer program was modified to distinguish between upper- and lowercase letters in a masked template file. if a primer candidate ends with a lower-case letter it will be rejected by primer and unique primer will be designed from the remaining candidates. however, other primer design methods that can use masked sequence could also work with the genomemasker output file. another important test for genomic pcr applications is the prediction of the number of all possible pcr products, which a given primer pair can generate from a given genome. this can effectively be done by the second part of our package called genometester. genometester counts and locates all potential binding sites of the pcr primer pair in the genome and predicts the location of all pcr products that could be generated with these primers. these two main methods – genomemasker and genometester – can be used independently. our software models the pcr primer binding site as 100% identical match to a continuous string from primer's 3' end with a fixed length. user defined length in the range of and nucleotides can be used. the bindings with mismatches are not modeled for several reasons. firstly, for each 16-mer oligonucleotide there are variants with a single mismatch. counting the number of occurences and keeping track of genomic location of all these variants would increase the computing time significantly. secondly, it is not known whether counting mismatch containing primer binding sites helps to predict the pcr success rate better than counting full-match primer binding sites. until the relationship between the number of mismatched binding sites and pcr success is known we prefer not to use mismatched binding sites. workflow of the program package the creation of either a blacklist for genomemasker or the indexes for genometester from the entire human genome takes approximately three hours on a linux server with ghz xeon processor, at least gb of ram and scsi disks. once the preprocessing is done, the masking, primer design and primer testing steps are extremely fast. the algorithmic details are more thoroughly described in the chapter "implementation and methods". genomemasker: comparison of repeat masking methods to compare the properties of our package with the properties of other repeat detection and masking methods we chose random regions from the human genome, each bp long. the sequences were masked with repeatmasker and genomemasker. pcr primer design was attempted from each sequence. both masking programs were used at similar sensitivities – the overall fraction of masked nucleotides was similar. the results of masking are shown in figure the general tendency is that masking by genomemasker is more detailed than masking by repeatmasker. in sequences masked by repeatmasker short repeats are often not detected. incomplete repbase libraries may be one of the causes of that. on the other hand some other dna regions are extensively masked by repeatmasker and cannot be used for primer design. genomemasker, however, masks only a single nucleotide in the 3'-end of each over-represented word it finds. this creates a more detailed masking pattern and allows the design of primers inside complicated regions between repetitive sequences. detailed masking is legitimate because genomemasker assures that any non-masked word is not repeated in the genomic dna sequence. we compared the properties of primers designed from template dna masked with different programs. in addition to genomemasker and repeatmasker we studied the primers designed from the non-masked templates using the repeat detection library built-in into the primer program. we also used short repeats masking programs dust and tandemrepeatsfinder. the amount of outcoming primers and their properties are rather different. it turns out that using only the default repeat library of primer masking with dust or tandemrepeatsfinder is not sufficient to design non-repeated primers. as much as 39% of primers designed using primer repeat library still occur in more than locations in the genome, which, according to our estimates can reduce the success rate of pcr. repeatmasker is good in avoiding such repeated regions, but unfortunately it tends to mask large regions thus making the primer design impossible in complicated regions. primer design was not possible in around 31% of randomly chosen regions masked by the repeatmasker. the computational performance of genomemasker compared to repeatmasker is shown in figure repeatmasker was used with several different sensitivity parameters and genomemasker with two different word lengths. genomemasker is at least times faster compared to repeatmasker. to simplify the primer design process, the user can pre-mask the entire human genome within 6– hours and subsequently use the masked genomic sequence for various primer design tasks. genometester: comparison between e-pcr methods although the masking of template sequences with genomemasker avoids low-quality primer design, some primer pairs may still produce two or more alternative pcr products which should be avoided. also, users may have existing primer pairs that they would like to evaluate against the given genome for the number of binding sites. therefore, it may be necessary to perform a search against the entire genome for primer binding sites and detect the location of possible products. such searches are typically done with sequence homology programs or with dedicated e-pcr programs. the computation time and the memory requirements of e-pcr programs are important factors, particularly when dealing with large datasets like eukaryotic genomes. to compare the speed of different methods we created five datasets, consisting of and randomly selected primer pairs. all datasets were subjected to the e-pcr against the human genome with seven different programs and the computing time of the results was recorded. the results of the comparison are shown in figure the speed difference between the fastest methods and more traditional sequence homology search programs like blast and megablast is more than 100-fold. me-pcr program seems to be more effective for larger datasets than other e-pcr methods. however, one should keep in mind that although the recent e-pcr methods like me-pcr and ispcr are very fast, they are designed to locate pcr products only. other studied programs are able to record the location and number of all primer binding sites. physical memory requirement for the e-pcr procedure on human chromosomes is approximately 1gb for ssaha, mb for genometester and ispcr and ca mb for other methods. please note that all the programs shown in figure were compared in standalone mode. the performance of most of the programs can be increased by using server-client architecture. discussion large-scale genomic studies often require amplification of genomic dna by pcr. therefore, automatic pcr primer design is one of the critical steps in such studies. we have created a novel method for masking repeated regions in sequences. it allows masking of the entire template dna before primer design to avoid the consideration of poor primer candidates. genomemasker is able to identify and mask repeating words that have not been included in the current repeat libraries. this, combined with a specific 3'-end masking technique, allowed us to achieve a more sensitive masking than the existing approaches. programs like dust and tandemrepeatsfinder are designed for masking short repeat motifs and are faster than our method, but their ability to find different types of longer repeats is lower, as demonstrated in table masking repeats may help to increase pcr success rate, but this might not be sufficient for some applications. for example, genotyping requires that a unique pcr product must be generated from the human genome. therefore, additional e-pcr step is still required after candidate primer pair is selected, which in our case is done with the genometester application. the method presented in this paper offers the possibility to increase specificity and speed of finding non-unique words by using word indexing and binary search algorithm compared to other repeat-masking and e-pcr methods. the package also contains an optional primer design program that can be replaced with desired software. therefore, the main advantage of our method is speed, unique masking style and the possibility to quickly locate alternative pcr primer binding sites and products. all programs in our test must read the genome sequence information from a hard drive. this information is typically pre-processed and saved into a database or an index in a specific binary format. databases or indexes that need to be read from hard drive are rather large. total size of indexes for the human chromosomes is approximately gb for blast and megablast, gb for ssaha and gb for genometester. when executed, most programs initially read all database/index data into ram, which speeds up the search, particularly for large datasets. however, for searching only a few primer pairs the entire database/index may not be necessary. the pre-processed and sorted index of genometester allows identifying locations of the given primer pair by reading only a fraction of the index file. our package is based on finding the exact matches between sequences. newer methods and algorithms allow considering mismatches when comparing oligos against large genomic sequence. whereas it would be possible to enhance our programs so that the bindings with single mismatches would be taken into account, the current implementation would require about 45– times more computing time for both gtester and gmasker. the number comes from the fact that there are mismatched variants per each nucleotide within a given word. for example, 16-mer oligonucleotide would have different single-mismatch oligos. we could forbid the mismatch at 3'-end of oligo, but nevertheless the number of different variants to search is huge. the problem is particularly serious with the genometester which keeps track of the location of each potential binding site. thus, the memory requirement for storing all the locations would be enormous. also, there is no good model to estimate how different mismatches should be weighted. for example, it is usually expected that mismatches near the 3' end disturb primer binding and subsequent replication matter much more than the ones near 5' end. the exact dependence between mismatch location and binding strength is not known. additionally, the strength of the mismatched dna duplex is somewhat weaker than the duplex with exact matches. thus, the relative influence of mismatched binding sites to the success rate of pcr compared to fully complementary binding sites is poorly understood and their importance in predicting pcr success cannot be estimated without extensive experimental studies. however, we have examined the correlation between the number of perfect match binding sites and the number of binding sites with single mismatch. we have taken all strings with length nucleotides from the human genome. for each oligonucleotide, two things were counted 1) the number of binding sites in the genome as 100% identical match and 2) the number of binding sites in the genome containing single mismatch. these two numbers were plotted against each other and a strong linear correlation was observed. as these two values are strongly correlated we would expect them to be almost equally efficient predictors of pcr success. thus, counting of mismatched binding sites is not likely to give a significant improvement for the prediction of pcr success.  we have created a novel method for masking repeated regions in sequences, detecting all pcr primer binding sites and possible pcr products from the human genome. the genomemasker package is suitable for researchers who need to evaluate or design unique pcr primers in genomic scale. it is able to mask the entire human genome for non-unique primers within hours and find locations of all binding sites for designed primer pairs within minutes. availability and requirements project name: genomemasker package project homepage: operating system: unix/linux programming language: c/c++ other requirements: none license: the package is freely available to academic users any restrictions to use by non-academics: licence needed the web client for the genometester program is available at and the web client for the genomemasker is available at. authors' contributions ra conducted this study, carried out different tests on various methods, validated the package and was responsible for drafting the manuscript. er created the initial code of the package and lk optimized the code. mr contributed to the conception of this study, participated in its design and coordination and helped to draft the manuscript. all authors have read and approved the final manuscript. 
the eukaryotic genomes are particularly difficult to study due to abundant repeats. in order to improve the efficiency and success rate of automatic primer/oligo design, we created a novel method which allows rapid masking of repeats in large sequence files, for example in eukaryotic genomes. we also modified the primer program, to be able to design primers from lowercase-masked sequences. the new method was implemented in a collection of efficient programs, the genomemasker package. the genomemasker package is able to mask the entire human genome for non-unique primers within hours and find locations of all binding sites for designed primer pairs within minutes. the design of oligonucleotides and pcr primers for studying large genomes is complicated by the redundancy of sequences. it also allows the detection of all alternative binding sites of pcr primers and the prediction of pcr products. additionally, it predicts all alternative pcr products from large genomes for given primer pairs.
 the design of oligonucleotides and pcr primers for studying large genomes is complicated by the redundancy of sequences. the eukaryotic genomes are particularly difficult to study due to abundant repeats. the speed of most existing primer evaluation programs is not sufficient for large-scale experiments.  in order to improve the efficiency and success rate of automatic primer/oligo design, we created a novel method which allows rapid masking of repeats in large sequence files, for example in eukaryotic genomes. it also allows the detection of all alternative binding sites of pcr primers and the prediction of pcr products. the new method was implemented in a collection of efficient programs, the genomemasker package. the performance of the programs was compared to other similar programs. we also modified the primer program, to be able to design primers from lowercase-masked sequences.  the genomemasker package is able to mask the entire human genome for non-unique primers within hours and find locations of all binding sites for designed primer pairs within minutes. additionally, it predicts all alternative pcr products from large genomes for given primer pairs. 