From 573acafafc61d91c43d021247e1d0961eded35c8 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 27 Feb 2025 15:09:07 +0100 Subject: [PATCH] Patch bug on ecotag with too short sequences --- pkg/obioptions/version.go | 2 +- pkg/obitools/obitag/obitag.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index 8751533..2ac8e39 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -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. diff --git a/pkg/obitools/obitag/obitag.go b/pkg/obitools/obitag/obitag.go index ea72003..ccb4888 100644 --- a/pkg/obitools/obitag/obitag.go +++ b/pkg/obitools/obitag/obitag.go @@ -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)