Learn R Programming

hiReadsProcessor (version 1.8.2)

splitByBarcode: Split DNAStringSet object using first X number of bases defined by a vector.

Description

Given a character vector of barcodes/MID to sample association and a DNAStringSet object, the function splits/demultiplexes the DNAStringSet object by first few bases dictated by length of barcodes/MID supplied. This is an accessory function used by findBarcodes

Usage

splitByBarcode(barcodesSample, dnaSet, trimFrom = NULL, showStats = FALSE,
  returnUnmatched = FALSE)

Arguments

barcodesSample
a character vector of barcodes to sample name associations. Ex: c("ACATCCAT"="Sample1", "GAATGGAT"="Sample2",...)
dnaSet
DNAStringSet object to evaluate.
trimFrom
integer value serving as start point to trim the sequences from. This is calculated internally length barcode+1. Default is NULL.
showStats
boolean flag denoting whether to show decoding statistics per sample & barcode. Default is FALSE.
returnUnmatched
boolean flag denoting whether to return unmatched reads. Default is FALSE.

Value

  • DNAStringSet object split by sample name found in barcodesSample.

See Also

findBarcodes, dereplicateReads, replicateReads

Examples

Run this code
dnaSet <- DNAStringSet(c("read1"="ACATCCATAGAGCTACGACGACATCGACATA",
"read2"="GAATGGATGACGACTACAGCACGACGAGCAGCTACT",
"read3"="GAATGGATGCGCTAAGAAGAGA", "read4"="ACATCCATTCTACACATCT"))
splitByBarcode(c("ACATCCAT"="Sample1", "GAATGGAT"="Sample2"), dnaSet,
showStats=TRUE)

Run the code above in your browser using DataLab