View source: R/random_sequences.R
mutations | R Documentation |
Creates a set of sequences which are random mutations (with base changes, insertions and deletions) for a given DNA, RNA or AA sequence.
mutations(x, number=1, change=0.01, insertion=0.01, deletion=0.01, prob=NULL)
x |
A XString or an XStringSet of length 1. |
number |
number of sequences to create. |
change , insertion , deletion |
probability of this operation. |
prob |
a named vector with letter probabilities. 4 for DNA and RNA and 20
for AA (see |
A XStringSet.
Michael Hahsler
### create random sequences
s <- random_sequences(100, number=1)
s
### create 10 sequences with 1 percent base changes, insertions and deletions
m <- mutations(s, 10, change=0.01, insertion=0.01, deletion=0.01)
m
### calculate edit distance between the original sequence and the mutated
### sequences
stringDist(c(s,m))
### multiple sequence alignment
## Not run:
al <- clustal(c(s,m))
detail(al)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.