Commit c7be8c6d authored by Wai Yi Leung's avatar Wai Yi Leung

Fixing WipeReads

parent bb8b4550
...@@ -18,9 +18,8 @@ import java.io.File ...@@ -18,9 +18,8 @@ import java.io.File
import nl.lumc.sasc.biopet.core.ToolCommandFunction import nl.lumc.sasc.biopet.core.ToolCommandFunction
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
// TODO: finish implementation for usage in pipelines
/** /**
* WipeReads function class for usage in Biopet pipelines * WipeReads function class for usage in Biopet pipelines
* *
...@@ -36,9 +35,44 @@ class WipeReads(val root: Configurable) extends ToolCommandFunction { ...@@ -36,9 +35,44 @@ class WipeReads(val root: Configurable) extends ToolCommandFunction {
@Input(doc = "Interval file", shortName = "r", required = true) @Input(doc = "Interval file", shortName = "r", required = true)
var intervalFile: File = null var intervalFile: File = null
@Argument(doc = "Minimum MAPQ of reads in target region to remove (default: 0)")
var minMapQ: Option[Int] = config("min_mapq")
@Argument(doc = "Read group IDs to be removed (default: remove reads from all read groups)")
var readgroup: Set[String] = config("read_group", default = Nil)
@Argument(doc = "Whether to remove multiple-mapped reads outside the target regions (default: yes)")
var limitRemoval: Boolean = config("limit_removal")
@Argument(doc = "Whether to index output BAM file or not (default: yes)")
var noMakeIndex: Boolean = config("no_make_index")
@Argument(doc = "GTF feature containing intervals (default: exon)")
var featureType: Option[String] = config("feature_type")
@Argument(doc = "Expected maximum number of reads in target regions (default: 7e7)")
var bloomSize: Option[Long] = config("bloom_size")
@Argument(doc = "False positive rate (default: 4e-7)")
var falsePositive: Option[Long] = config("false_positive")
@Output(doc = "Output BAM", shortName = "o", required = true) @Output(doc = "Output BAM", shortName = "o", required = true)
var outputBam: File = null var outputBam: File = null
@Output(doc = "BAM containing discarded reads", shortName = "f", required = false) @Output(doc = "BAM containing discarded reads", shortName = "f", required = false)
var discardedBam: File = null var discardedBam: Option[File] = None
override def cmdLine = super.cmdLine +
required("-I", inputBam) +
required("-r", intervalFile) +
required("-o", outputBam) +
optional("-f", discardedBam) +
optional("-Q", minMapQ) +
readgroup.foreach(rg => required("-G", rg)) +
conditional(limitRemoval, "--limit_removal") +
conditional(noMakeIndex, "--no_make_index") +
optional("-t", featureType) +
optional("--bloom_size", bloomSize) +
optional("--false_positive", falsePositive)
} }
...@@ -209,7 +209,7 @@ class Gentrap(val root: Configurable) extends QScript ...@@ -209,7 +209,7 @@ class Gentrap(val root: Configurable) extends QScript
job.inputBam = bamFile.get job.inputBam = bamFile.get
ribosomalRefFlat().foreach(job.intervalFile = _) ribosomalRefFlat().foreach(job.intervalFile = _)
job.outputBam = createFile("cleaned.bam") job.outputBam = createFile("cleaned.bam")
job.discardedBam = createFile("rrna.bam") job.discardedBam = Some(createFile("rrna.bam"))
add(job) add(job)
Some(job.outputBam) Some(job.outputBam)
} else bamFile } else bamFile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment