mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Add the possibility to look for patterns allowing indels.
Former-commit-id: 0599c2b0ad16df086dbdb08e491503870d8904be
This commit is contained in:
46
pkg/obiseq/compare.go
Normal file
46
pkg/obiseq/compare.go
Normal file
@ -0,0 +1,46 @@
|
||||
package obiseq
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
|
||||
type Compare func(a, b *BioSequence) int
|
||||
|
||||
func CompareSequence(a, b *BioSequence) int {
|
||||
return bytes.Compare(a.sequence, b.sequence)
|
||||
}
|
||||
|
||||
func CompareQuality(a, b *BioSequence) int {
|
||||
return bytes.Compare(a.qualities, b.qualities)
|
||||
}
|
||||
|
||||
// func CompareAttributeBuillder(key string) Compare {
|
||||
// f := func(a, b *BioSequence) int {
|
||||
// ak, oka := a.GetAttribute(key)
|
||||
// bk, okb := b.GetAttribute(key)
|
||||
|
||||
// switch {
|
||||
// case !oka && !okb:
|
||||
// return 0
|
||||
// case !oka:
|
||||
// return -1
|
||||
// case !okb:
|
||||
// return +1
|
||||
// }
|
||||
|
||||
// //av,oka := ak.(constraints.Ordered)
|
||||
// //bv,okb := bk.(constraints.Ordered)
|
||||
|
||||
// switch {
|
||||
// case !oka && !okb:
|
||||
// return 0
|
||||
// case !oka:
|
||||
// return -1
|
||||
// case !okb:
|
||||
// return +1
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// return f
|
||||
// }
|
Reference in New Issue
Block a user