From d1f397c7115e37dd4b54091a60b71fdb57260d89 Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Wed, 12 Jun 2013 12:22:36 -0400 Subject: [PATCH] Fixing bug with dangling tails in which the tail connects all the way back to the reference source node. -- List of vertices can't contain a source node. --- .../sting/gatk/walkers/haplotypecaller/graphs/BaseGraph.java | 4 ++-- .../haplotypecaller/readthreading/ReadThreadingAssembler.java | 2 +- .../haplotypecaller/readthreading/ReadThreadingGraph.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/graphs/BaseGraph.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/graphs/BaseGraph.java index 70ef539f3..2b37d90c2 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/graphs/BaseGraph.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/graphs/BaseGraph.java @@ -309,7 +309,7 @@ public class BaseGraph extends Default } v = getNextReferenceVertex(v); // advance along the reference path while( v != null && !v.equals(toVertex) ) { - bytes = ArrayUtils.addAll( bytes, getAdditionalSequence(v) ); + bytes = ArrayUtils.addAll(bytes, getAdditionalSequence(v)); v = getNextReferenceVertex(v); // advance along the reference path } if( includeStop && v != null && v.equals(toVertex)) { @@ -561,7 +561,7 @@ public class BaseGraph extends Default verticesToRemove.removeAll(onPathFromRefSource); removeAllVertices(verticesToRemove); - // simple santity checks that this algorithm is working. + // simple sanity checks that this algorithm is working. if ( getSinks().size() > 1 ) { throw new IllegalStateException("Should have eliminated all but the reference sink, but found " + getSinks()); } diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingAssembler.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingAssembler.java index f4290f2bb..fc0f781c5 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingAssembler.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingAssembler.java @@ -207,7 +207,7 @@ public class ReadThreadingAssembler extends LocalAssemblyEngine { * @return */ private boolean reasonableNumberOfPaths(final SeqGraph graph) { - final KBestPaths pathFinder = new KBestPaths(false); + final KBestPaths pathFinder = new KBestPaths<>(false); final List> allPaths = pathFinder.getKBestPaths(graph, 100000); logger.info("Found " + allPaths.size() + " paths through " + graph + " with maximum " + maxAllowedPathsForReadThreadingAssembler); return allPaths.size() <= maxAllowedPathsForReadThreadingAssembler; diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingGraph.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingGraph.java index 8d8cb83f6..0844f979b 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingGraph.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/readthreading/ReadThreadingGraph.java @@ -339,7 +339,7 @@ public class ReadThreadingGraph extends BaseGraph altPath = findPathToLowestCommonAncestorOfReference(vertex); - if ( altPath == null ) + if ( altPath == null || isRefSource(altPath.get(0)) ) return null; // now get the reference path from the LCA