Skip to content

Commit

Permalink
Updated version number.
Browse files Browse the repository at this point in the history
Not populating simplification list when SIMPLIFY_AFTER_REMOVAL is false.
  • Loading branch information
d-cameron committed Feb 7, 2017
1 parent b32432b commit 5279626
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>au.edu.wehi</groupId>
<artifactId>gridss</artifactId>
<packaging>jar</packaging>
<version>1.2.0</version>
<version>1.2.1</version>
<name>gridss</name>
<url>https://github.com/PapenfussLab/gridss</url>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import au.edu.wehi.idsv.Defaults;
import au.edu.wehi.idsv.DirectedEvidence;
import au.edu.wehi.idsv.SanityCheckFailureException;
import au.edu.wehi.idsv.configuration.AssemblyConfiguration;
import au.edu.wehi.idsv.debruijn.DeBruijnGraphBase;
import au.edu.wehi.idsv.debruijn.KmerEncodingHelper;
import au.edu.wehi.idsv.graph.ScalingHelper;
Expand Down Expand Up @@ -177,7 +176,6 @@ private void ensureCalledContig() {
while (called.isEmpty()) {
// Safety calling to ensure loaded graph size is bounded
if (!nonReferenceGraphByPosition.isEmpty()) {
AssemblyConfiguration ap = aes.getContext().getAssemblyParameters();
int frontierStart = bestContigCaller.frontierStart(nextPosition());
// Need to make sure our contig that we're forcing a call on is comprised of evidence that has
// been fully loaded into the graph
Expand Down Expand Up @@ -532,8 +530,13 @@ private void removeFromGraph(Set<KmerEvidence> evidence) {
if (bestContigCaller != null) {
bestContigCaller.remove(toRemove.keySet());
}
Set<KmerPathNode> simplifyCandidates = new ObjectOpenCustomHashSet<KmerPathNode>(new KmerPathNode.HashByFirstKmerStartPositionKmer<KmerPathNode>());
Set<KmerPathNode> simplifyCandidates = null;
if (SIMPLIFY_AFTER_REMOVAL) {
simplifyCandidates = new ObjectOpenCustomHashSet<KmerPathNode>(new KmerPathNode.HashByFirstKmerStartPositionKmer<KmerPathNode>());
}
for (Entry<KmerPathNode, List<List<KmerNode>>> entry : toRemove.entrySet()) {
// removing down-weighted replacement nodes from memoization is unnecessary since we just
// removed the entire node earlier in this function
removeWeight(entry.getKey(), entry.getValue(), simplifyCandidates, false);
}
if (SIMPLIFY_AFTER_REMOVAL) {
Expand Down Expand Up @@ -628,17 +631,21 @@ private void removeWeight(KmerPathNode node, List<List<KmerNode>> toRemove, Set<
assert(node.length() >= toRemove.size());
// remove from graph
removeFromGraph(node, includeMemoizationRemoval);
simplifyCandidates.addAll(node.next());
simplifyCandidates.addAll(node.prev());
simplifyCandidates.remove(node);
if (SIMPLIFY_AFTER_REMOVAL) {
simplifyCandidates.addAll(node.next());
simplifyCandidates.addAll(node.prev());
simplifyCandidates.remove(node);
}
Collection<KmerPathNode> replacementNodes = KmerPathNode.removeWeight(node, toRemove);
for (KmerPathNode split : replacementNodes) {
if (Defaults.SANITY_CHECK_DE_BRUIJN) {
assert(evidenceTracker.matchesExpected(new KmerPathSubnode(split)));
}
addToGraph(split);
}
simplifyCandidates.addAll(replacementNodes);
if (SIMPLIFY_AFTER_REMOVAL) {
simplifyCandidates.addAll(replacementNodes);
}
}
private void addToGraph(KmerPathNode node) {
boolean added = graphByPosition.add(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public void should_remove_misassembled_partial_paths() {
pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 1;
List<DirectedEvidence> e = new ArrayList<>();
for (int i = 1; i < 100; i++) {
e.add(SCE(FWD, ses, withReadName(String.format("%d-%d", 0, i), withSequence("TAAAAAAAAAAAAAAAAAAA", Read(0, i*10, "4M16S")))[0]));
e.add(SCE(FWD, ses, withReadName(String.format("%d-%d", 0, i), withSequence("TAAAAAAAAAAAAAAAAAAAAAAAAAAAA", Read(0, i*20, "4M25S")))[0]));
}
List<SAMRecord> output = go(pc, false, e.toArray(new DirectedEvidence[0]));
// the rest should have been removed
Expand Down

0 comments on commit 5279626

Please sign in to comment.