mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-10 09:40:27 +00:00
Patch a bug in obliclean for d>1 leading to some instability in the result
This commit is contained in:
@@ -354,6 +354,7 @@ func extendSimilarityGraph(seqs *[]*seqPCR, step int, workers int) int {
|
|||||||
son := (*seqs)[i]
|
son := (*seqs)[i]
|
||||||
for j := i + 1; j < nseq; j++ {
|
for j := i + 1; j < nseq; j++ {
|
||||||
father := (*seqs)[j]
|
father := (*seqs)[j]
|
||||||
|
if father.Count > son.Count {
|
||||||
d, _, _, _ := obialign.D1Or0(son.Sequence, father.Sequence)
|
d, _, _, _ := obialign.D1Or0(son.Sequence, father.Sequence)
|
||||||
|
|
||||||
if d < 0 {
|
if d < 0 {
|
||||||
@@ -370,6 +371,7 @@ func extendSimilarityGraph(seqs *[]*seqPCR, step int, workers int) int {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lineChan := make(chan int)
|
lineChan := make(chan int)
|
||||||
// idxChan := make(chan [][]Ratio)
|
// idxChan := make(chan [][]Ratio)
|
||||||
@@ -411,7 +413,10 @@ func FilterGraphOnRatio(seqs *[]*seqPCR, ratio float64) {
|
|||||||
j := 0
|
j := 0
|
||||||
for i, s2 := range e {
|
for i, s2 := range e {
|
||||||
e[j] = e[i]
|
e[j] = e[i]
|
||||||
if (c1 / float64((*seqs)[s2.Father].Weight)) <= math.Pow(ratio, float64(e[i].Dist)) {
|
// log.Warnf("ratio %f, dist: %d, threshold %f",
|
||||||
|
// c1/float64((*seqs)[s2.Father].Weight),
|
||||||
|
// e[i].Dist, math.Pow(ratio, float64(e[i].Dist)))
|
||||||
|
if (c1 / float64((*seqs)[s2.Father].Weight)) < math.Pow(ratio, float64(e[i].Dist)) {
|
||||||
j++
|
j++
|
||||||
} else {
|
} else {
|
||||||
(*seqs)[s2.Father].SonCount--
|
(*seqs)[s2.Father].SonCount--
|
||||||
|
|||||||
Reference in New Issue
Block a user