markDuplicates Mark duplicated reads from a BAM file by calling widely used tools.

markDuplicates(
  dupremover = c("bamutil", "picard"),
  bam = NULL,
  out = gsub("\\.bam$", "_duprm.bam", bam),
  rminput = TRUE,
  path = ".",
  verbose = TRUE,
  ...
)

Arguments

dupremover

The tool to be called. Currently, "picard" and "bamutils" are supported

bam

The bam file to mark duplicates from

out

Regular expression describing the transformation on the original filename to get the output filename. By default, a "_duprm" suffix is added before the bam extension

rminput

Whether to keep the original, non duplicate-marked, bam file

path

Path to the duplicate marker binaries

verbose

Redirect all the program output to the R console

...

Other parameters sent to the caller function

Value

The output filename

Details

This function works as a wrapper for several tools widely adopted tr mark duplicated reads in a BAM file. Currently, it supports PICARD and BamUtils.

Examples

if (FALSE) {
bam <- system.file("extdata","sample1Aligned.out.bam",package="dupRadar")
gtf <- "genes.gtf"
stranded <- 2    # '0' (unstranded), '1' (stranded) and '2' (reverse)
paired   <- FALSE
threads  <- 4

# call the duplicate marker and analyze the reads
bamDuprm <- markDuplicates(dupremover="bamutil",bam,
                           path="/opt/bamUtil-master/bin",rminput=FALSE)
dm <- analyzeDuprates(bamDuprm,gtf,stranded,paired,threads)
}