Merge pull request #270 from broadinstitute/rp_reference_haplotype_mismatch_bug
Fixing bug with dangling tails in which the tail connects all the way ba...
This commit is contained in:
commit
17d3ccb03b
|
|
@ -309,7 +309,7 @@ public class BaseGraph<V extends BaseVertex, E extends BaseEdge> extends Default
|
||||||
}
|
}
|
||||||
v = getNextReferenceVertex(v); // advance along the reference path
|
v = getNextReferenceVertex(v); // advance along the reference path
|
||||||
while( v != null && !v.equals(toVertex) ) {
|
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
|
v = getNextReferenceVertex(v); // advance along the reference path
|
||||||
}
|
}
|
||||||
if( includeStop && v != null && v.equals(toVertex)) {
|
if( includeStop && v != null && v.equals(toVertex)) {
|
||||||
|
|
@ -561,7 +561,7 @@ public class BaseGraph<V extends BaseVertex, E extends BaseEdge> extends Default
|
||||||
verticesToRemove.removeAll(onPathFromRefSource);
|
verticesToRemove.removeAll(onPathFromRefSource);
|
||||||
removeAllVertices(verticesToRemove);
|
removeAllVertices(verticesToRemove);
|
||||||
|
|
||||||
// simple santity checks that this algorithm is working.
|
// simple sanity checks that this algorithm is working.
|
||||||
if ( getSinks().size() > 1 ) {
|
if ( getSinks().size() > 1 ) {
|
||||||
throw new IllegalStateException("Should have eliminated all but the reference sink, but found " + getSinks());
|
throw new IllegalStateException("Should have eliminated all but the reference sink, but found " + getSinks());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ public class ReadThreadingAssembler extends LocalAssemblyEngine {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean reasonableNumberOfPaths(final SeqGraph graph) {
|
private boolean reasonableNumberOfPaths(final SeqGraph graph) {
|
||||||
final KBestPaths<SeqVertex,BaseEdge> pathFinder = new KBestPaths<SeqVertex,BaseEdge>(false);
|
final KBestPaths<SeqVertex,BaseEdge> pathFinder = new KBestPaths<>(false);
|
||||||
final List<Path<SeqVertex,BaseEdge>> allPaths = pathFinder.getKBestPaths(graph, 100000);
|
final List<Path<SeqVertex,BaseEdge>> allPaths = pathFinder.getKBestPaths(graph, 100000);
|
||||||
logger.info("Found " + allPaths.size() + " paths through " + graph + " with maximum " + maxAllowedPathsForReadThreadingAssembler);
|
logger.info("Found " + allPaths.size() + " paths through " + graph + " with maximum " + maxAllowedPathsForReadThreadingAssembler);
|
||||||
return allPaths.size() <= maxAllowedPathsForReadThreadingAssembler;
|
return allPaths.size() <= maxAllowedPathsForReadThreadingAssembler;
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,7 @@ public class ReadThreadingGraph extends BaseGraph<MultiDeBruijnVertex, MultiSamp
|
||||||
|
|
||||||
// find the lowest common ancestor path between vertex and the reference sink if available
|
// find the lowest common ancestor path between vertex and the reference sink if available
|
||||||
final List<MultiDeBruijnVertex> altPath = findPathToLowestCommonAncestorOfReference(vertex);
|
final List<MultiDeBruijnVertex> altPath = findPathToLowestCommonAncestorOfReference(vertex);
|
||||||
if ( altPath == null )
|
if ( altPath == null || isRefSource(altPath.get(0)) )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// now get the reference path from the LCA
|
// now get the reference path from the LCA
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue