R/invmut.R

Defines functions invmut

Documented in invmut

# Inverse mutation
invmut = function(y, ...){
  n = length(y)
  v = sort(sample(1:n, size=2, replace=FALSE))
  subgenes = y[v[1]:v[2]] 
  subgenes = rev(subgenes)
  y[v[1]:v[2]] = subgenes
  return(list(mutant=y, mutrange=v))
}

Try the adana package in your browser

Any scripts or data that you put into this service are public.

adana documentation built on March 18, 2022, 6:03 p.m.