Patch bug on ecotag with too short sequences

This commit is contained in:
Eric Coissac
2025-02-27 15:09:07 +01:00
parent 0067152c2b
commit 573acafafc
2 changed files with 5 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "791d253"
var _Commit = "0067152"
var _Version = "Release 4.2.0"
// Version returns the version of the obitools package.

View File

@ -73,6 +73,10 @@ func FindClosests(sequence *obiseq.BioSequence,
refcounts []*obikmer.Table4mer,
runExact bool) (obiseq.BioSequenceSlice, int, float64, string, []int) {
if sequence.Len() < 5 {
return obiseq.BioSequenceSlice{}, 1000, 0, "NA", []int{}
}
var matrix []uint64
seqwords := obikmer.Count4Mer(sequence, nil, nil)