Description Usage Arguments Value Author(s) See Also Examples
Set the function object used for generating inserts.
The provided function must return a Sequence object whne called and must have the
following arguments: process, length, target.seq, event.pos, insert.pos (see generateInsert.GeneralInsertor
).
1 2 | ## S3 method for class 'GeneralInsertor'
setGenerateBy(this, value, ...)
|
this |
A GeneralInsertor object. |
value |
A function object. |
... |
Not used. |
The function object.
Botond Sipos, Gregory Jordan
For more information see GeneralInsertor
.
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 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.