From 21819cd41e0610d768c05e58322f92780dfae181 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Tue, 28 Mar 2023 11:43:46 +0700 Subject: [PATCH] Add some geometry data to the GML edges Former-commit-id: 81022c8b6916819e5351026ebabe9641856cc06d --- pkg/obikmer/debruijn.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/obikmer/debruijn.go b/pkg/obikmer/debruijn.go index 4017d0d..a496f94 100644 --- a/pkg/obikmer/debruijn.go +++ b/pkg/obikmer/debruijn.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "log" + "math" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq" ) @@ -377,7 +378,7 @@ func (graph *DeBruijnGraph) Push(sequence *obiseq.BioSequence) { } -func (graph *DeBruijnGraph) GML() string { +func (graph *DeBruijnGraph) Gml() string { buffer := bytes.NewBuffer(make([]byte, 0, 1000)) buffer.WriteString( @@ -415,9 +416,14 @@ func (graph *DeBruijnGraph) GML() string { target "%s" color "#00FF00" label "%c[%d]" + graphics [ + width %f + arrow "last" + fill "#007F80" + ] ] - `, src, dst, label, weight), + `, src, dst, label, weight, math.Log(float64(weight))), ) } buffer.WriteString("]\n")