distance: Calculate distance between two barcodes.

Description Usage Arguments Value References Examples

View source: R/RcppExports.R View source: R/distance.R

Description

The function calculates the distance between two barcodes. The user may choose one of several distance metrics ("hamming", "seqlev", "levenshtein", "phaseshift").

Usage

1
distance(sequence1, sequence2, metric=c("hamming","seqlev","levenshtein", "phaseshift"), cost_sub=1, cost_indel=1) 

Arguments

sequence1

The first sequence (a string)

sequence2

The second sequence (a string)

metric

The distance metric which should be calculated.

cost_sub

The cost weight given to a substitution.

cost_indel

The cost weight given to insertions and deletions.

Value

The distance between the two sequences.

References

Buschmann, T. and Bystrykh, L. V. (2013) Levenshtein error-correcting barcodes for multiplexed DNA sequencing. BMC bioinformatics, 14(1), 272. Available from http://www.biomedcentral.com/1471-2105/14/272.

Levenshtein, V. I. (1966). Binary codes capable of correcting deletions, insertions and reversals. In Soviet physics doklady (Vol. 10, p. 707).

Hamming, R. W. (1950). Error detecting and error correcting codes. Bell System technical journal, 29(2), 147-160.

Examples

1
2
distance("AGGT", "TTCC")
distance("AGGT", "TTCC", metric="seqlev")

Example output

Loading required package: Matrix
Loading required package: parallel
[1] 4
[1] 3

DNABarcodes documentation built on May 2, 2018, 4:27 a.m.