Algorithm 4.
1: // This function mutates exactly m positions. The inputs are the number of positions to mutate, sequence, target structure, pair probabilities, nested pair probabilities, non-nested pair probabilities and the design template, respectively. |
2: mutation_count ← 0 |
3: while mutation_count < m do |
4: i ← random(1, length(τ)) |
5: if ϕi is a free nucleotide OR mutation_count = = (m − 1) then |
6: ϕ ← mutate_single_nucleotide(ϕ, τ, Pi, j, t) |
7: mutation_count ← mutation_count + 1 |
8: end if |
9: if ϕi is not a single nucleotide then |
10: |
11: mutation_count ← mutation_count + 2 |
12: end if |
13: end while |
14: Return ϕ |