Update mix.go

This commit is contained in:
kuoi 2022-01-18 14:10:22 +00:00 committed by GitHub
parent de717bf419
commit 410f2e6156
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

13
mix.go
View file

@ -11,10 +11,10 @@ func fas_mix(sum_nex []dna, sum_charset []charset) (map[string][]string, int, in
sum_dna := make(map[string][]string) sum_dna := make(map[string][]string)
for _, v := range sum_nex { for _, v := range sum_nex { // v is sequence of a sample in a file
for k1 := range v.min { for k1 := range v.min { // v.min is sum of intaxname and indsq
_, has := sum_dna[k1] _, has := sum_dna[k1] // k1 indataxname
if !has { if !has { // has is true, not have is false
sum_dna[k1] = make([]string, len(sum_charset)) sum_dna[k1] = make([]string, len(sum_charset))
ntax++ ntax++
} }
@ -24,10 +24,9 @@ func fas_mix(sum_nex []dna, sum_charset []charset) (map[string][]string, int, in
for _, v1 := range v.min { for _, v1 := range v.min {
for k2 := range sum_dna { for k2 := range sum_dna {
if _, ok := v.min[k2]; ok { if _, ok := v.min[k2]; ok {
sum_dna[k2][k] = v1 sum_dna[k2][k] = v1 //include is fine
} else { } else {
sum_dna[k2][k] = strings.Repeat("?", v.count) sum_dna[k2][k] = strings.Repeat("?", v.count) //not include, repeat string ?
// 之前就没写错吗?已修复
} }
} }
} }