getGenerateBy.GeneralInsertor: Get the function object used for generating inserts

Description Usage Arguments Value Author(s) See Also Examples

Description

Get the function object used for generating inserts.

Usage

1
2
## S3 method for class 'GeneralInsertor'
getGenerateBy(this, ...)

Arguments

this

A GeneralInsertor object.

...

Not used.

Value

A function object.

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see GeneralInsertor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
	# create a GeneralInsertor object
	i<-GeneralInsertor(
		rate=0.5,
		propose.by=function(process){sample(c(5:10),1)}, # inserts between 5 and 10
		template.seq=NucleotideSequence(string="AAAAAAA")
	)

	# save insert generator
	old.gen<-getGenerateBy(i)
	# set a new insert generator
	i$generateBy<-function(
                           process,
                           length,
                           target.seq,
                           event.pos,
                           insert.pos
                        ){
                           return(NucleotideSequence(string="AATTGGCC"))
                           }
	# get the generator function
	i$generateBy
	# generate insert
	generateInsert(i)
	# restore old generator
	i$generateBy<-old.gen
	# generate insert
	generateInsert(i)
 

phylosim documentation built on Nov. 22, 2019, 1:07 a.m.