Skip to main content
. 2016 Jul 22;7:129. doi: 10.3389/fgene.2016.00129

Algorithm 4.

m_mutation(m,ϕ,τ,Pi,j,Pi,j,Pi,j,t)

  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:     irandom(1, length(τ))
  5:     if ϕi is a free nucleotide OR mutation_count = = (m − 1) then
  6:        ϕ ← mutate_single_nucleotide(ϕ, τ, Pi, j, t)
  7:        mutation_countmutation_count + 1
  8:     end if
  9:     if ϕi is not a single nucleotide then
10:        ϕmutate_basepair(ϕ,τ,Pi,j,Pi,j,t)
11:        mutation_countmutation_count + 2
12:     end if
13:  end while
14:  Return ϕ