mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Patch obimatrix accoring to the new type obiseq.StatsOnValues
This commit is contained in:
@ -8,7 +8,7 @@ import (
|
|||||||
// corresponds to the last commit, and not the one when the file will be
|
// corresponds to the last commit, and not the one when the file will be
|
||||||
// commited
|
// commited
|
||||||
|
|
||||||
var _Commit = "9965370"
|
var _Commit = "add9d89"
|
||||||
var _Version = "Release 4.4.0"
|
var _Version = "Release 4.4.0"
|
||||||
|
|
||||||
// Version returns the version of the obitools package.
|
// Version returns the version of the obitools package.
|
||||||
|
@ -79,7 +79,11 @@ func (data1 *MatrixData) MergeMatrixData(data2 *MatrixData) *MatrixData {
|
|||||||
// - *MatrixData: The updated MatrixData object.
|
// - *MatrixData: The updated MatrixData object.
|
||||||
func (data *MatrixData) Update(s *obiseq.BioSequence, mapkey string) *MatrixData {
|
func (data *MatrixData) Update(s *obiseq.BioSequence, mapkey string) *MatrixData {
|
||||||
if v, ok := s.GetAttribute(mapkey); ok {
|
if v, ok := s.GetAttribute(mapkey); ok {
|
||||||
if obiutils.IsAMap(v) {
|
if m, ok := v.(*obiseq.StatsOnValues); ok {
|
||||||
|
m.RLock()
|
||||||
|
(*data)[s.Id()] = obiutils.MapToMapInterface(m.Map())
|
||||||
|
m.RUnlock()
|
||||||
|
} else if obiutils.IsAMap(v) {
|
||||||
(*data)[s.Id()] = obiutils.MapToMapInterface(v)
|
(*data)[s.Id()] = obiutils.MapToMapInterface(v)
|
||||||
} else {
|
} else {
|
||||||
log.Panicf("Attribute %s is not a map in the sequence %s", mapkey, s.Id())
|
log.Panicf("Attribute %s is not a map in the sequence %s", mapkey, s.Id())
|
||||||
|
Reference in New Issue
Block a user