mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Correct the number of workers
Former-commit-id: febbccfb853263e0761ecfccb0f09c8c1bf88475
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package obiseq
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -17,15 +16,21 @@ import (
|
||||
// - error: an error if the subsequence parameters are invalid.
|
||||
func (sequence *BioSequence) Subsequence(from, to int, circular bool) (*BioSequence, error) {
|
||||
if from >= to && !circular {
|
||||
return nil, errors.New("from greater than to")
|
||||
return nil, fmt.Errorf("from: %d greater than to: %d", from, to)
|
||||
}
|
||||
|
||||
if from < 0 || from >= sequence.Len() {
|
||||
return nil, errors.New("from out of bounds")
|
||||
if from < 0 {
|
||||
return nil, fmt.Errorf("from out of bounds %d < 0", from)
|
||||
}
|
||||
|
||||
if to <= 0 || to > sequence.Len() {
|
||||
return nil, errors.New("to out of bounds")
|
||||
if from >= sequence.Len() {
|
||||
return nil,
|
||||
fmt.Errorf("from out of bounds %d >= %d", from, sequence.Len())
|
||||
}
|
||||
|
||||
if to > sequence.Len() {
|
||||
return nil,
|
||||
fmt.Errorf("to out of bounds %d > %d", to, sequence.Len())
|
||||
}
|
||||
|
||||
var newSeq *BioSequence
|
||||
|
||||
Reference in New Issue
Block a user