uniqueBar: Tool function to obtain unique barcode sequences from a...

Description Usage Arguments Value Examples

View source: R/uniqueBar.R

Description

This a function for removing the duplicated barcodes in the library file that will be used for the bcSeq alignment.

Usage

1
uniqueBar(inputFile,outputFile)

Arguments

inputFile

(string) filename for the library sequences, needs to be a fasta or fastq file.

outputFile

(string) output filename.

Value

default

No objects are returned to R

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#### Generate barcodes
lFName    <- "./libFile.fasta"
bases     <- c(rep('A', 4), rep('C',4), rep('G',4), rep('T',4))
numOfBars <- 20
Barcodes  <- rep(NA, numOfBars*2)
for (i in 1:numOfBars){
    Barcodes[2*i-1] <- paste0(">barcode_ID: ", i)
    Barcodes[2*i]   <- paste(sample(bases, length(bases)), collapse = '')
}
Barcodes <- rbind(Barcodes, Barcodes)
write(Barcodes, lFName)

outFile  <- "./libFile_unique.fasta"
uniqueBar(lFName, outFile)

bcSeq documentation built on Nov. 8, 2020, 8:03 p.m.