mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-10 01:24:41 +00:00
Introduce sequence roles and filtering logic
Implement new data structures for corpus management, multi-match filtering, and barcode resolution.
This commit is contained in:
1 parent
d7d63f315c
commit
d6dd39f878
22 files changed
+1083
-342
No files matched your search
@@ -138,7 +138,8 @@ func matchCorpus(c *Corpus, words []uint64, mk scannerMaker) []WordMatches {
|
||||
}
|
||||
|
||||
// SequencesMatched returns, for the matches of one word, the number of
|
||||
// distinct example and counterexample sequences it occurs in.
|
||||
// distinct example and counterexample sequences it occurs in. The other
|
||||
// sequences are not counted.
|
||||
func (w WordMatches) SequencesMatched(c *Corpus) (examples, counterExamples int) {
|
||||
last := ^uint32(0)
|
||||
for _, m := range w.Matches {
|
||||
@@ -146,9 +147,10 @@ func (w WordMatches) SequencesMatched(c *Corpus) (examples, counterExamples int)
|
||||
continue
|
||||
}
|
||||
last = m.Seq
|
||||
if c.Roles[m.Seq] == Example {
|
||||
switch c.Roles[m.Seq] {
|
||||
case Example:
|
||||
examples++
|
||||
} else {
|
||||
case CounterExample:
|
||||
counterExamples++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user