barcode.set.distances: Calculate distances between each barcode pair of a barcode...

Description Usage Arguments Details Value References See Also Examples

View source: R/barcode.set.distances.R

Description

The function calculates the distance between each pair of a set of barcodes. The user may choose one of several distance metrics ("hamming", "seqlev", "levenshtein")).

Usage

1
barcode.set.distances(barcodes, metric=c("hamming", "seqlev", "levenshtein"), cores=detectCores()/2, cost_sub = 1, cost_indel = 1)	

Arguments

barcodes

A set of barcodes (as vector of characters)

metric

The distance metric which should be calculated.

cores

The number of cores (CPUs) that will be used for parallel (openMP) calculations.

cost_sub

The cost weight given to a substitution.

cost_indel

The cost weight given to insertions and deletions.

Details

The primary purpose of this function is the analysis of barcode sets. Seeing the individual paired barcode distances helps to understand which pairings are exceptionally similar and which barcodes have a smaller or higher average distance to other barcodes.

Details if the distance metrics can be found in the man page of create.dnabarcodes.

Value

A symmetric Matrix of distances between each pair of barcodes with zeros on the main diagonal.

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.

See Also

analyse.barcodes

Examples

1
2
3
barcodes <- c("AGGT", "TTCC", "CTGA", "GCAA")
barcode.set.distances(barcodes)
barcode.set.distances(barcodes,metric="seqlev")

Example output

Loading required package: Matrix
Loading required package: parallel
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
4 x 4 Matrix of class "dspMatrix"
     AGGT TTCC CTGA GCAA
AGGT    0    4    3    4
TTCC    4    0    3    4
CTGA    3    3    0    3
GCAA    4    4    3    0
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
4 x 4 Matrix of class "dspMatrix"
     AGGT TTCC CTGA GCAA
AGGT    0    3    3    3
TTCC    3    0    3    3
CTGA    3    3    0    3
GCAA    3    3    3    0

DNABarcodes documentation built on Nov. 8, 2020, 5 p.m.