From a1894543430e558ca7e8a517f2503926e02370ae Mon Sep 17 00:00:00 2001 From: kshakir Date: Thu, 17 Feb 2011 19:09:03 +0000 Subject: [PATCH] FCP only adds the expand intervals QFunction once per script instead of once per QFunction using the ExpandTargets scala trait. Eval dbSNP's type now based on eval dbSNP instead of genotype dbSNP. Using an external treemap instead of the JGraphT internal node set to speed up larger graph generation. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5261 348d0f76-0448-11de-a6fe-93d51630548a --- .../datasources/pipeline/PipelineProject.java | 2 +- .../qscript/playground/FullCallingPipeline.q | 6 ++++-- .../sting/queue/engine/QGraph.scala | 19 +++++++++++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/java/src/org/broadinstitute/sting/datasources/pipeline/PipelineProject.java b/java/src/org/broadinstitute/sting/datasources/pipeline/PipelineProject.java index 77a8c0479..7967ba5df 100644 --- a/java/src/org/broadinstitute/sting/datasources/pipeline/PipelineProject.java +++ b/java/src/org/broadinstitute/sting/datasources/pipeline/PipelineProject.java @@ -85,7 +85,7 @@ public class PipelineProject { } public String getEvalDbsnpType() { - return getDbsnpType(genotypeDbsnp); + return getDbsnpType(evalDbsnp); } public File getRefseqTable() { diff --git a/scala/qscript/playground/FullCallingPipeline.q b/scala/qscript/playground/FullCallingPipeline.q index 9cd3aecdb..010ad3c25 100755 --- a/scala/qscript/playground/FullCallingPipeline.q +++ b/scala/qscript/playground/FullCallingPipeline.q @@ -160,11 +160,13 @@ class FullCallingPipeline extends QScript { val ei : ExpandIntervals = new ExpandIntervals(qscript.pipeline.getProject.getIntervalList, 1, qscript.expandIntervals, new File("Resources", base + ".flanks.interval_list"), qscript.pipeline.getProject.getReferenceFile, "INTERVALS", "INTERVALS") ei.jobOutputFile = new File(".queue/logs/Overall/ExpandIntervals.out") + if (qscript.expandIntervals > 0) { + add(ei) + } + trait ExpandedIntervals extends CommandLineGATK { if (qscript.expandIntervals > 0) { this.intervals :+= ei.outList - - add(ei) } } diff --git a/scala/src/org/broadinstitute/sting/queue/engine/QGraph.scala b/scala/src/org/broadinstitute/sting/queue/engine/QGraph.scala index f0ddd18c0..07c03d289 100755 --- a/scala/src/org/broadinstitute/sting/queue/engine/QGraph.scala +++ b/scala/src/org/broadinstitute/sting/queue/engine/QGraph.scala @@ -13,6 +13,7 @@ import org.broadinstitute.sting.queue.function.{InProcessFunction, CommandLineFu import org.broadinstitute.sting.queue.function.scattergather.{CloneFunction, GatherFunction, ScatterGatherableFunction} import org.apache.commons.lang.StringUtils import org.broadinstitute.sting.queue.util._ +import collection.immutable.TreeMap /** * The internal dependency tracker between sets of function input and output files. @@ -23,7 +24,13 @@ class QGraph extends Logging { private def dryRun = !settings.run private var numMissingValues = 0 + private val jobGraph = newGraph + // A map of nodes by list of files. + private var nodeMap = TreeMap.empty[Iterable[File], QNode](Ordering.Iterable(Ordering.by[File,String](_.getAbsolutePath))) + // The next unique id for a node if not found in the nodeMap. + private var nextNodeId = 0 + private var running = true private val runningLock = new Object private val nl = "%n".format() @@ -212,8 +219,12 @@ class QGraph extends Logging { } } - if (running) - jobGraph.removeAllVertices(jobGraph.vertexSet.filter(isOrphan(_))) + if (running) { + for (orphan <- jobGraph.vertexSet.filter(isOrphan(_))) { + jobGraph.removeVertex(orphan) + nodeMap -= orphan.files + } + } } /** @@ -606,9 +617,8 @@ class QGraph extends Logging { private def newGraph = new SimpleDirectedGraph[QNode, QEdge](new EdgeFactory[QNode, QEdge] { def createEdge(input: QNode, output: QNode) = new MappingEdge(input, output)}) - private var nextNodeId = 0 private def getQNode(files: List[File]) = { - jobGraph.vertexSet.find(node => node.files == files) match { + nodeMap.get(files) match { case Some(node) => node case None => @@ -617,6 +627,7 @@ class QGraph extends Logging { val node = new QNode(nextNodeId, files) nextNodeId += 1 jobGraph.addVertex(node) + nodeMap += files -> node node } }