diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala index 0eab05598fc49307439534a0845a03d415b863fd..10a5cd8d0f8ed0c7e52da5583fe4c6b2b129f45b 100644 --- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala +++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala @@ -108,6 +108,11 @@ class Gentrap(val root: Configurable) extends QScript /** Default pipeline config */ override def defaults = Map( + "htseqcount" -> Map("stranded" -> (strandProtocol match { + case NonSpecific => "no" + case Dutp => "reverse" + case _ => null + }), "merge_strategy" -> "preprocessmergesam", "gsnap" -> Map( "novelsplicing" -> 1, diff --git a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala index 26bf4dc1453ab90471b83c427614c0facbb7eb4c..a614f93e9249a9396555a6b2da85694309d75f6f 100644 --- a/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala +++ b/public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/FragmentsPerGene.scala @@ -1,13 +1,28 @@ 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.utils.config.Configurable import org.broadinstitute.gatk.queue.QScript /** * Created by pjvan_thof on 1/12/16. */ -class FragmentsPerGene(val root: Configurable) extends QScript with Measurement { - def bamToCountFile(id: String, bamFile: File): (String, File) = ??? +class FragmentsPerGene(val root: Configurable) extends QScript with Measurement with AnnotationGtf { + def bamToCountFile(id: String, bamFile: File): (String, File) = { + //TODO: ID sorting job + + val job = new HtseqCount(this) + job.inputAnnotation = annotationGtf + job.inputAlignment = bamFile + job.output = new File(outputDir, s"$name.$id.counts") + job.format = Option("bam") + // We are forcing the sort order to be ID-sorted, since HTSeq-count often chokes when using position-sorting due + // to its buffer not being large enough. + //TODO: ID sorting job + //job.order = Option("name") + id -> job.output + } def mergeArgs = MergeArgs(List(1), 2, numHeaderLines = 1, fallback = "0") }