## the barcode
barcodes=c("ACACTG","ACTAGC","ATGGCT","TTGCGA")
## the multiplexed data
alns <- readAligned(
system.file(
"extdata",
package="RnaSeqTutorial"),
pattern="multiplex_export",
filter=compose(
chastityFilter(),
nFilter(2),
chromosomeFilter(regex="chr")),
type="SolexaExport",
withAll=TRUE)
## barcode plot
barcodePlot(alns,
barcodes=barcodes,
type="within",
barcode.length=6,
show.barcode=20,
main="All samples",
xlim=c(0,0.5))
## demultiplexing
dem.alns <- demultiplex(alns,
barcodes=barcodes,
edition.dist=2,
barcodes.qty=4,
type="within")
## plotting again
par(mfrow=c(2,2))
barcode.frequencies <- lapply(
names(dem.alns$barcodes),
function(barcode,alns){
barcodePlot(
alns$barcodes[[barcode]],
barcodes=barcode,
type="within",barcode.length=6,
show.barcode=20,
main=paste(
"Expected barcode:",
barcode))
},dem.alns)
Run the code above in your browser using DataLab