Learn R Programming

seqtrie (version 0.3.5)

generate_cost_matrix: Generate a simple cost matrix

Description

Generate a cost matrix for use with the search method.

Usage

generate_cost_matrix(charset, ambiguity_base = NULL, match = 0L, mismatch = 1L)

Value

A square cost matrix with row- and column-names given by charset, plus the optional ambiguity_base. Gap costs are no longer included here; pass gap_cost and gap_open_cost to distance/search functions.

Arguments

charset

A string of all allowed characters in both query and target sequences (e.g. "ACGT").

ambiguity_base

A single character (e.g. "N") that will match any character in charset at the cost of match. Defaults to NULL.

match

Integer cost of a match.

mismatch

Integer cost of a mismatch.

Examples

Run this code
generate_cost_matrix("ACGT", match = 0, mismatch = 1)
generate_cost_matrix("ACGT", ambiguity_base = "N", match = 0, mismatch = 1)

Run the code above in your browser using DataLab