filterBamByReadNames {FilterFFPE} | R Documentation |
Generate filtered BAM file that does not contain reads with the input read names.
filterBamByReadNames(file, readsToFilter, index=file, destination=sub("\\.bam(\\.gz)?", ".FilterFFPE.bam", file), overwrite=FALSE)
file |
Path to the input BAM file. |
readsToFilter |
A character vector of read names to filter. |
index |
Path of the index file of the input BAM file. |
destination |
Path of the output filtered BAM file. |
overwrite |
Boolean value indicating whether the destination can be over-written if it already exists. |
Generate filtered BAM file that does not contain reads with the input read names, index file is also created.
The file name of the created destination file.
Lanying Wei <lanying.wei@uni-muenster.de>
FilterFFPE
, findArtifactChimericReads
,
FFPEReadFilter
file <- system.file("extdata", "example.bam", package = "FilterFFPE") outFolder <- tempdir() FFPEReadsFile <- paste0(outFolder, "/example.FFPEReads.txt") dupChimFile <- paste0(outFolder, "/example.dupChim.txt") destination <- paste0(outFolder, "/example.FilterFFPE.bam") artifactReads <- findArtifactChimericReads(file = file, threads = 2, FFPEReadsFile = FFPEReadsFile, dupChimFile = dupChimFile) dupChim <- readLines(dupChimFile) readsToFilter <- c(artifactReads, dupChim) filterBamByReadNames(file = file, readsToFilter = readsToFilter, destination = destination, overwrite=TRUE)