Skip to content
Snippets Groups Projects
Commit d717a546 authored by bow's avatar bow
Browse files

Merge branch 'feature-idsort_htseq' into 'develop'

Added id sorting step

Fixes #346 

See merge request !407
parents 807482be f6f703ca
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ package nl.lumc.sasc.biopet.pipelines.gentrap.measures
import nl.lumc.sasc.biopet.core.annotations.AnnotationGtf
import nl.lumc.sasc.biopet.extensions.HtseqCount
import nl.lumc.sasc.biopet.extensions.picard.SortSam
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
......@@ -25,19 +26,31 @@ import org.broadinstitute.gatk.queue.QScript
class FragmentsPerGene(val root: Configurable) extends QScript with Measurement with AnnotationGtf {
def mergeArgs = MergeArgs(idCols = List(1), valCol = 2, numHeaderLines = 0, fallback = "0")
override def fixedValues: Map[String, Any] = Map("htseqcount" -> Map("order" -> "pos"))
override def fixedValues: Map[String, Any] = Map("htseqcount" -> Map("order" -> ""))
lazy val sortOnId: Boolean = config("sort_on_id", default = true)
/** Pipeline itself */
def biopetScript(): Unit = {
val jobs = bamFiles.map {
case (id, file) =>
//TODO: ID sorting job
val bamFile = if (sortOnId) {
val sortSam = new SortSam(this)
sortSam.input = file
sortSam.output = swapExt(outputDir, file, ".bam", ".idsorted.bam")
sortSam.sortOrder = "queryname"
sortSam.isIntermediate = true
add(sortSam)
sortSam.output
} else file
val job = new HtseqCount(this)
job.inputAnnotation = annotationGtf
job.inputAlignment = file
job.inputAlignment = bamFile
job.output = new File(outputDir, s"$id.$name.counts")
job.format = Option("bam")
job.order = if (sortOnId) Some("name") else Some("pos")
add(job)
id -> job
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment