R/test.code.falsification.R

Defines functions .test.code.falsification

.test.code.falsification <- function(barcodes=character(), d=1, metric=c("hamming","seqlev","levenshtein","phaseshift"), cores=detectCores()/2) {
  metric <- match.arg(metric)

  # Calculated mutated closure of barcodes
  cf <- .code_falsification(barcodes, d, metric, cores)

  # Demultiplex them
  dm <- demultiplex(cf$mutation, barcodes, metric=metric)

  if (sum(cf$barcode != dm) > 0) {
    show("The barcode set could not be correctly demultiplexed.")
  } else {
    show("Correct.")
  }
  return(sum(cf$barcode != dm) / nrow(cf))
}

Try the DNABarcodes package in your browser

Any scripts or data that you put into this service are public.

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