Commit 6623805f authored by bow's avatar bow
Browse files

Merge branch 'fix-basecounter' into 'develop'

Fix basecounter

Some small fixes

See merge request !373
parents 34ffaaf0 3297f0bf
......@@ -37,7 +37,7 @@ class BaseCounter(val root: Configurable) extends ToolCommandFunction {
var prefix: String = "output"
override def defaultCoreMemory = 3.0
override def defaultCoreMemory = 5.0
override def defaultThreads = 4
def transcriptTotalCounts = new File(outputDir, s"$prefix.base.transcript.counts")
......@@ -89,6 +89,7 @@ class BaseCounter(val root: Configurable) extends ToolCommandFunction {
nonStrandedMetaExonCounts,
strandedMetaExonCounts, strandedSenseMetaExonCounts, strandedAntiSenseMetaExonCounts)
jobOutputFile = new File(outputDir, s".$prefix.basecounter.out")
if (bamFile != null) deps :+= new File(bamFile.getAbsolutePath.stripSuffix(".bam") + ".bai")
super.beforeGraph()
}
......
......@@ -70,7 +70,9 @@ object BaseCounter extends ToolCommand {
logger.info("Finding overlapping genes")
val overlapGenes = groupGenesOnOverlap(geneReader.getAll)
logger.info("Start reading bamFile")
counter = 0
logger.info(s"Start reading bamFile divided over ${overlapGenes.values.flatten.size} chunks")
val counts = (for (genes <- overlapGenes.values.flatten.par) yield runThread(cmdArgs.bamFile, genes)).toList
logger.info("Done reading bamFile")
......@@ -292,6 +294,8 @@ object BaseCounter extends ToolCommand {
else samRecord.getReadNegativeStrandFlag == strand
}
private[tools] var counter = 0
private[tools] case class ThreadOutput(geneCounts: List[GeneCount],
nonStrandedMetaExonCounts: List[(String, RegionCount)],
strandedMetaExonCounts: List[(String, RegionCount)])
......@@ -315,6 +319,8 @@ object BaseCounter extends ToolCommand {
}
bamReader.close()
counter += 1
if (counter % 1000 == 0) logger.info(s"${counter} chunks done")
ThreadOutput(counts.values.toList, metaExons, plusMetaExons ::: minMetaExons)
}
......
Supports Markdown
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