mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Switch to faster json library go-json and sonic
Former-commit-id: ab9b4723f1dcf79fe5c073fff4d86f4f6969edfd
This commit is contained in:
@@ -2,6 +2,9 @@ package obialign
|
||||
|
||||
import (
|
||||
"math"
|
||||
"sync"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var _FourBitsCount = []float64{
|
||||
@@ -28,6 +31,7 @@ var _InitializedDnaScore = false
|
||||
var _NucPartMatch [32][32]float64
|
||||
var _NucScorePartMatchMatch [100][100]int
|
||||
var _NucScorePartMatchMismatch [100][100]int
|
||||
var _InitDNAScoreMatrixMutex = &sync.Mutex{}
|
||||
|
||||
// _MatchRatio calculates the match ratio between two bytes.
|
||||
//
|
||||
@@ -120,7 +124,11 @@ func _InitNucScorePartMatch() {
|
||||
}
|
||||
|
||||
func _InitDNAScoreMatrix() {
|
||||
_InitDNAScoreMatrixMutex.Lock()
|
||||
defer _InitDNAScoreMatrixMutex.Unlock()
|
||||
if !_InitializedDnaScore {
|
||||
log.Info("Initializing the DNA Scoring matrix")
|
||||
|
||||
_InitNucPartMatch()
|
||||
_InitNucScorePartMatch()
|
||||
_InitializedDnaScore = true
|
||||
|
||||
Reference in New Issue
Block a user