markDuplicates: Program dispatchers to mark duplicated reads from a BAM file

View source: R/markDuplicates.R

markDuplicatesR Documentation

Program dispatchers to mark duplicated reads from a BAM file

Description

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

Usage

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

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.

Value

The output filename

Examples

## Not run: 
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)

## End(Not run)

imbforge/dupRadar documentation built on Oct. 18, 2023, 8:54 a.m.