From 58dbdd86981cbd08f395b0b88c5ee1948f41a2dd Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Wed, 5 Oct 2022 09:53:56 +0200 Subject: [PATCH] requires that father.count > son.count --- pkg/obitools/obiclean/graph.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/obitools/obiclean/graph.go b/pkg/obitools/obiclean/graph.go index 63b1c69..533b4bc 100644 --- a/pkg/obitools/obiclean/graph.go +++ b/pkg/obitools/obiclean/graph.go @@ -266,7 +266,7 @@ func reweightSequences(seqs *[]*seqPCR) { //var rfunc func(*seqPCR) rfunc := func(node *seqPCR) { - node.AddedSons=0 + node.AddedSons = 0 nedges := len(node.Edges) if nedges > 0 { swf := 0.0 @@ -313,11 +313,13 @@ func buildSamplePairs(seqs *[]*seqPCR, workers int) int { for j := i + 1; j < nseq; j++ { father := (*seqs)[j] - d, pos, a1, a2 := obialign.D1Or0(son.Sequence, father.Sequence) - if d > 0 { - son.Edges = append(son.Edges, makeEdge(j, d, pos, a2, a1)) - father.SonCount++ + if father.Count > son.Count { + d, pos, a1, a2 := obialign.D1Or0(son.Sequence, father.Sequence) + if d > 0 { + son.Edges = append(son.Edges, makeEdge(j, d, pos, a2, a1)) + father.SonCount++ + } } }