Commit a43106b2 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fixed config conversions

parent 413bbf93
......@@ -54,16 +54,16 @@ class Gentrap(val root: Configurable) extends QScript
/** Expression measurement modes */
// see the enumeration below for valid modes
lazy val expMeasures = config("expression_measures", default = Nil).asStringList.map(value =>
ExpMeasures.values.find(x => Gentrap.camelize(x.toString) == value) match {
ExpMeasures.values.find(_.toString == Gentrap.camelize(value)) match {
case Some(v) => v
case _ => throw new IllegalArgumentException(s"'$value' is not a valid Expression measurement")
}
).toSet
/** Strandedness modes */
lazy val strandProtocol: StrandProtocol.Value = {
val strandProtocol: StrandProtocol.Value = {
val value: String = config("strand_protocol")
StrandProtocol.values.find(x => Gentrap.camelize(x.toString) == value) match {
StrandProtocol.values.find(_.toString == Gentrap.camelize(value)) match {
case Some(v) => v
case other =>
Logging.addError(s"'$other' is no strand_protocol or strand_protocol is not given")
......@@ -122,7 +122,7 @@ class Gentrap(val root: Configurable) extends QScript
Some(new FragmentsPerExon(this)) else None
lazy val baseCounts = if (expMeasures.contains(ExpMeasures.BaseCounts))
Some(new FragmentsPerExon(this)) else None
Some(new BaseCounts(this)) else None
lazy val cufflinksBlind = if (expMeasures.contains(ExpMeasures.CufflinksBlind))
Some(new CufflinksBlind(this)) else None
......
......@@ -15,14 +15,15 @@ class BaseCounts(val root: Configurable) extends QScript with Measurement with A
/** Pipeline itself */
def biopetScript(): Unit = {
val jobs = bamFiles.map { case (id, file) =>
val baseCounter = new BaseCounter(this)
baseCounter.bamFile = file
baseCounter.outputDir = new File(outputDir, id)
baseCounter.prefix = id
baseCounter.refFlat = annotationRefFlat
add(baseCounter)
id -> baseCounter
val jobs = bamFiles.map {
case (id, file) =>
val baseCounter = new BaseCounter(this)
baseCounter.bamFile = file
baseCounter.outputDir = new File(outputDir, id)
baseCounter.prefix = id
baseCounter.refFlat = annotationRefFlat
add(baseCounter)
id -> baseCounter
}
def addTableAndHeatmap(countFiles: List[File], outputName: String): Unit = {
......
......@@ -16,10 +16,11 @@ trait CufflinksMeasurement extends QScript with Measurement {
}
def biopetScript(): Unit = {
val jobs = bamFiles.map { case (id, file) =>
val cufflinks = makeCufflinksJob(id, file)
add(cufflinks)
id -> cufflinks
val jobs = bamFiles.map {
case (id, file) =>
val cufflinks = makeCufflinksJob(id, file)
add(cufflinks)
id -> cufflinks
}
addMergeTableJob(jobs.values.map(_.outputGenesFpkm).toList, mergeGenesFpkmTable, "genes_fpkm")
......
......@@ -13,19 +13,20 @@ class FragmentsPerGene(val root: Configurable) extends QScript with Measurement
/** Pipeline itself */
def biopetScript(): Unit = {
val jobs = bamFiles.map { case (id, file) =>
//TODO: ID sorting job
val jobs = bamFiles.map {
case (id, file) =>
//TODO: ID sorting job
val job = new HtseqCount(this)
job.inputAnnotation = annotationGtf
job.inputAlignment = file
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
val job = new HtseqCount(this)
job.inputAnnotation = annotationGtf
job.inputAlignment = file
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
}
addMergeTableJob(jobs.values.map(_.output).toList, mergedTable, "fragments_per_gene")
......
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