mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
A first functional version of obiclean
This commit is contained in:
@@ -210,17 +210,22 @@ func ParseOBIFeatures(text string, annotations obiseq.Annotation) string {
|
||||
bvalue = bytes.TrimSpace(part[m[0]:(m[1] - 1)])
|
||||
j := bytes.ReplaceAll(bvalue, []byte("'"), []byte(`"`))
|
||||
var err error
|
||||
if strings.HasPrefix(key, "merged_") ||
|
||||
strings.HasSuffix(key, "_count") {
|
||||
switch {
|
||||
case strings.HasPrefix(key, "merged_") ||
|
||||
strings.HasSuffix(key, "_count"):
|
||||
dict := make(map[string]int)
|
||||
err = json.Unmarshal(j, &dict)
|
||||
value = dict
|
||||
} else {
|
||||
case strings.HasSuffix(key, "_status"):
|
||||
dict := make(map[string]string)
|
||||
err = json.Unmarshal(j, &dict)
|
||||
value = dict
|
||||
default:
|
||||
dict := make(map[string]interface{})
|
||||
err = json.Unmarshal(j, &dict)
|
||||
value = dict
|
||||
}
|
||||
|
||||
|
||||
if err != nil {
|
||||
value = string(bvalue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user