landscape.new.locus: Add a locus

Description Usage Arguments Examples

Description

Add a locus to a Rmetasim landscape object

Usage

1
2
3
4
## must be called AFTER integer, switch, and float params have been created
landscape.new.locus(rland,type=0,ploidy=1,
             mutationrate=0,transmission=1,numalleles=2,
             allelesize=50,frequencies=NULL, states = NULL)

Arguments

rland

partially created landscape object, required

type

(default=0) type of locus, 0=Infinite Allele mutation model (Integer), 1=Stepwise mutation model (Integer) state, 2=DNA base (variable length string state)

ploidy

(default=1) locus ploidy, 1 or 2

mutationrate

(default=0) probability of mutation per generation, less than or equal to 1

transmission

(default=1) 1=uniparental inheritance, 0=biparental inheritance

numalleles

(default=2) number of different alleles at the time of creation

allelesize

(default=50) length of DNA strings if type=2

frequencies

(default=NULL) vector of frequencies for each allele, must be numalleles long and add up to 1, if NULL frequencies are equally distributed

states

States for each of the alleles specified. If NULL sequential numeric states used.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  exampleland <- landscape.new.empty()
  exampleland <- landscape.new.intparam(exampleland, s=2, h=2)
  exampleland <- landscape.new.floatparam(exampleland)
  exampleland <- landscape.new.switchparam(exampleland)

  exampleland <- landscape.new.locus(exampleland,type=2,ploidy=2,
                          mutationrate=.001,numalleles=5,allelesize=100)

  exampleland$loci

  rm(exampleland)

rmetasim documentation built on Feb. 8, 2020, 1:06 a.m.