mutations: Creates Random Mutations of a Sequence

View source: R/random_sequences.R

mutationsR Documentation

Creates Random Mutations of a Sequence

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

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

### 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 24, 2024, 3:36 p.m.