Skip to content

Commit

Permalink
add mark_duplicates to BWA
Browse files Browse the repository at this point in the history
  • Loading branch information
hrehrauer committed Oct 30, 2020
1 parent 6ac8f91 commit 4fb0e99
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions R/app-mapping.r
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,19 @@ ezMethodBWA = function(input=NA, output=NA, param=NA){
file.remove(trimmedInput$getColumn("Read1"))
if(param$paired)
file.remove(trimmedInput$getColumn("Read2"))

ezSortIndexBam("aligned.bam", basename(bamFile), ram=param$ram, removeBam=TRUE,
cores=param$cores)


if (!is.null(param$markDuplicates) && param$markDuplicates){
ezSortIndexBam("aligned.bam", "sorted.bam", ram=param$ram, removeBam=TRUE,
cores=param$cores)
dupBam(inBam="sorted.bam", outBam=basename(bamFile),
operation="mark", program="picard", cores=param$cores)
file.remove("sorted.bam")
}else{
ezSortIndexBam("aligned.bam", basename(bamFile), ram=param$ram,
removeBam=TRUE, cores=param$cores)
}


## write an igv link
if (param$writeIgvLink){
if ("IGV" %in% output$colNames){
Expand Down Expand Up @@ -623,7 +632,8 @@ EzAppBWA <-
runMethod <<- ezMethodBWA
name <<- "EzAppBWA"
appDefaults <<- rbind(algorithm=ezFrame(Type="character", DefaultValue="mem", Description="bwa's alignment algorithm. One of aln, bwasw, mem."),
writeIgvSessionLink=ezFrame(Type="logical", DefaultValue="TRUE", Description="should an IGV link be generated"))
writeIgvSessionLink=ezFrame(Type="logical", DefaultValue="TRUE", Description="should an IGV link be generated"),
markDuplicates=ezFrame(Type="logical", DefaultValue="TRUE", Description="should duplicates be marked with sambamba"))
}
)
)
Expand Down

0 comments on commit 4fb0e99

Please sign in to comment.