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.
This commit is contained in:
parent
b2dc7095ab
commit
d1f397c711
|
|
@ -309,7 +309,7 @@ public class BaseGraph<V extends BaseVertex, E extends BaseEdge> 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<V extends BaseVertex, E extends BaseEdge> 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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ public class ReadThreadingAssembler extends LocalAssemblyEngine {
|
|||
* @return
|
||||
*/
|
||||
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);
|
||||
logger.info("Found " + allPaths.size() + " paths through " + graph + " with maximum " + 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
|
||||
final List<MultiDeBruijnVertex> altPath = findPathToLowestCommonAncestorOfReference(vertex);
|
||||
if ( altPath == null )
|
||||
if ( altPath == null || isRefSource(altPath.get(0)) )
|
||||
return null;
|
||||
|
||||
// now get the reference path from the LCA
|
||||
|
|
|
|||
Loading…
Reference in New Issue