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

Add merge jobs for cufflinks outputs

parent beb6cf00
No related branches found
No related tags found
No related merge requests found
......@@ -132,21 +132,34 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
/** Adds output merge jobs for the given expression mode */
// TODO: can we combine the enum with the file extension (to reduce duplication and potential errors)
def addMergeTableJob(expMode: ExpMeasures.Value, inFunc: (Sample => Option[File]), ext: String,
idCols: List[Int], valCol: Int, outName: String): Unit =
idCols: List[Int], valCol: Int, outBaseName: String = "all_samples"): Unit =
if (expMeasures.contains(expMode)) {
val job = new MergeTables(qscript)
job.inputTables = samples.values.map { inFunc }.toList.flatten
job.output = new File(outputDir, outName)
job.output = new File(outputDir, outBaseName + ext)
job.idColumnIndices = idCols.map(_.toString)
job.valueColumnIndex = valCol
job.fileExtension = Option(ext)
add(job)
}
addMergeTableJob(FragmentsPerGene, (s: Sample) => s.geneFragmentsCount, ".fragments_per_gene", List(1), 2,
"all_samples.fragments_per_gene")
addMergeTableJob(FragmentsPerExon, (s: Sample) => s.exonFragmentsCount, ".fragments_per_exon", List(1), 2,
"all_samples.fragments_per_exon")
// merge htseq outputs
addMergeTableJob(FragmentsPerGene, (s: Sample) => s.geneFragmentsCount, ".fragments_per_gene", List(1), 2)
addMergeTableJob(FragmentsPerExon, (s: Sample) => s.exonFragmentsCount, ".fragments_per_exon", List(1), 2)
// merge cufflinks outputs
addMergeTableJob(CufflinksStrict, (s: Sample) => s.geneFpkmCufflinksStrict, ".genes_fpkm_cufflinks_strict",
List(1, 7), 10)
addMergeTableJob(CufflinksStrict, (s: Sample) => s.isoformFpkmCufflinksStrict, ".isoforms_fpkm_cufflinks_strict",
List(1, 7), 10)
addMergeTableJob(CufflinksGuided, (s: Sample) => s.geneFpkmCufflinksGuided, ".genes_fpkm_cufflinks_guided",
List(1, 7), 10)
addMergeTableJob(CufflinksGuided, (s: Sample) => s.isoformFpkmCufflinksGuided, ".isoforms_fpkm_cufflinks_guided",
List(1, 7), 10)
addMergeTableJob(CufflinksBlind, (s: Sample) => s.geneFpkmCufflinksBlind, ".genes_fpkm_cufflinks_blind",
List(1, 7), 10)
addMergeTableJob(CufflinksBlind, (s: Sample) => s.isoformFpkmCufflinksBlind, ".isoforms_fpkm_cufflinks_blind",
List(1, 7), 10)
// TODO: use proper notation
addSummaryJobs
......
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