mutations: Creates Random Mutations of a Sequence

Description Usage Arguments Value Author(s) Examples

Description

Creates a set of sequences which are random mutations (with base changes, insertions and deletions) for a given DNA, RNA or AA sequence.

Usage

1
mutations(x, number=1, change=0.01, insertion=0.01, deletion=0.01, prob=NULL)

Arguments

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 DNA_BASES, RNA_BASES and the first 20 letters in AA_ALPHABET). The default is to estimate the probabilities from the sequence in x.

Value

A XStringSet.

Author(s)

Michael Hahsler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
### 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)

mhahsler/rMSA documentation built on May 22, 2019, 8:55 p.m.