# A Method for Degenerate Primer Design Based on Artificial Bee Colony Algorithm
## 2 Problem Description  
The aim of this paper is to find the degenerate primer with the minimum degeneracy and the maximum coverage among all possible candidate primers in the case of a small number of base mismatches. To facilitate evaluation, for any candidate primer \(P\), the coverage and degeneracy were evaluated in this paper using Formula (1). \[f(P)=\mu Unconverge\ (P)+\varphi Degeneracy\ (P) \tag{1}\]  
In Formula (1), _Unconverge_() represents the uncovering function, that is, the number of primers that failed to match DNA template sequences. For example, if there are 10 groups of target DNA sequences and a candidate primer \(P\) completes matching with 6 groups of target sequences, the uncoverage is 4. _Degeneracy_() stands for a degeneracy function whose degeneracy is at most d. Degeneracy refers to a degenerate PCR primer as a primer sequence that contains several possible bases in one or more positions. For example, both DNA and primer sequences are composed of four bases of AGCT. Assuming that there is a primer \(P\), \(P=\{\)A\(\}\)\(\{\)GT\(\}\)\(\{\)ATG\(\}\), then the length k of \(P\) is 4 and the degeneracy d = 1 \(\times\) 2 \(\times\) 2 \(\times\) 3 is 12. \(\mu\) and \(\varphi\) are the corresponding weight parameters. In addition, for a pair of candidate primers, the following constraints need to be met in this study:  
In general, the primer length should be between 18 and 26 bps. The _length_() function is defined to represent the length of the primer, and its length is the sum of the number of bases at each position, as shown in Formula (2). \[length(P)=\left\{ \begin{array}{ll}true&if\ 18\leq|P|\leq 26\\ false&Otherwise\end{array} \right. \tag{2}\]  
where \(|P|\) indicates the total number of bases in primer \(P\). The differential length of a primer pair is restricted to being smaller than 3 bps. \(P_{forward}\) denotes the forward primers in a primer pair, and \(P_{reverse}\) denotes the reverse primers in a primer pair. Define _length_() function to represent the length difference of primer pairs, as shown in Formula (3). \[length(P)=\left\{ \begin{array}{ll}true&if\ \left|\left|P_{forward}\right|- \left|P_{reverse}\right|\right|\leq 3\\ false&Otherwise\end{array} \right. \tag{3}\]  
In general, the primer design has strict requirements on temperature. An empirical formula was proposed by [PERSON] for calculating the melting temperature of a primer \(P\) with a length between 18 and 26 bps. This function \(Tm(P)\) can be written as in Formula (4). \[Tm(P)=(\#G+\#C)\times 4+(\#A+\#T)\times 2 \tag{4}\]  
This simple formula depends directly on the length and composition of the primer. \(\#G\) indicates the amount of nucleotide \"\(A\)\" in \(P\), \(\#T\) indicates the amount of nucleotide \"\(T\)\" in \(P\); \(\#C\) and \(\#G\) can then be defined accordingly. Additionally, the differential melting temperature of a primer pair must be under 2 \({}^{\circ}\)C. The \(Tmd()\) function is as shown in Formula (5). \[Tmd(P)=\left\{ \begin{array}{ll}true&if\ \left|Tm(P_{forward})-Tm(P_{ reverse})\right|\leq 2\\ false&Otherwise\end{array} \right. \tag{5}\]  
The \(GC\) content is the ratio of the number of nucleotide \"\(G\)\"s and the number of nucleotide \"\(C\)\"s in the primer \(P\) sequence. It should be limited to within a certain range. Ingeneral, an appropriate range of \(GC\) content for a primer is between 40% and 60%. The GC content \(GC(P)\) is as shown in Formula (6). \[GC(P)=\frac{\#G+\#C}{|P|}\times 100\% \tag{6}\]  
where \(\#G\) indicates the number of nucleotide \"\(G\)\"s in \(P\), and \(\#C\) indicates the number of nucleotide \"\(C\)\"s in \(P\). The \(GC_{content}(P)\) function is as shown in Formula (7). \[GC_{content}(P)=\left\{ \begin{array}{ll}true&if\ 40\%\leq GC(P)\leq 60\%\\ false&Otherwise\end{array} \right. \tag{7}\]  
The \(3^{\prime}\) end of a primer cannot choose nucleotide \"\(A\)\", it is better to choose nucleotide \"\(T\)\".