Files
obitools4/pkg/obiseq/compare.go
Eric Coissac 27d6c60e25 Add the possibility to look for patterns allowing indels.
Former-commit-id: 0599c2b0ad16df086dbdb08e491503870d8904be
2023-03-20 15:28:24 +07:00

47 lines
797 B
Go

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
// }