Learn R Programming

eDNAfuns (version 0.1.0)

mutation: Generate mutated DNA sequences

Description

This function takes DNA sequences and generates mutated variants. Useful for testing classification algorithms on sequences with either PCR-induced or naturally occurring mutations.

Usage

mutation(sequence = NULL, format = "bin", n.mutations = NA, prob.mutation = NA)

Value

A list of mutated sequences of the same class as the input.

Arguments

sequence

A list of DNA sequences, either as "DNAbin" objects or character vectors.

format

Character. Format of the input sequences. "bin" for DNAbin, "char" for character vectors.

n.mutations

Integer. Number of mutations to introduce per sequence. Exclusive with prob.mutation.

prob.mutation

Numeric. Probability of mutation per position. Exclusive with n.mutations.

Examples

Run this code
data("test_seqs")
mutation(test_seqs, n.mutations = 2)
mutation(test_seqs, prob.mutation = 0.1)
seqs <- fasta_reader(system.file("extdata", "test.fasta", package="eDNAfuns"))
mutation(seqs$seq, format = "char", n.mutations = 1)

Run the code above in your browser using DataLab