From 15aac99e188aeaa61f4cb3a57e52f96ec5f2c33f Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 17 Sep 2020 12:47:59 -0400 Subject: [PATCH] Logs. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- pca.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pca.go b/pca.go index 2bb8471d1b..d32751ea6d 100644 --- a/pca.go +++ b/pca.go @@ -137,6 +137,7 @@ func (cmd *goPCA) RunCommand(prog string, args []string, stdin io.Reader, stdout } defer input.Close() } + log.Print("reading") cgs, err := ReadCompactGenomes(input) if err != nil { return 1 @@ -145,18 +146,23 @@ func (cmd *goPCA) RunCommand(prog string, args []string, stdin io.Reader, stdout if err != nil { return 1 } + log.Print("sorting") sort.Slice(cgs, func(i, j int) bool { return cgs[i].Name < cgs[j].Name }) + log.Print("converting cgs to array") data, rows, cols := cgs2array(cgs) if *onehot { data, cols = recodeOnehot(data, cols) } + log.Print("running fit+transform") pca, err := nlp.NewPCA(*components).FitTransform(array2matrix(rows, cols, data).T()) if err != nil { return 1 } + log.Print("transposing result") pca = pca.T() + log.Print("copying result to numpy output array") rows, cols = pca.Dims() out := make([]float64, rows*cols) for i := 0; i < rows; i++ { @@ -181,6 +187,7 @@ func (cmd *goPCA) RunCommand(prog string, args []string, stdin io.Reader, stdout return 1 } npw.Shape = []int{rows, cols} + log.Print("writing numpy") npw.WriteFloat64(out) err = bufw.Flush() if err != nil { @@ -190,6 +197,7 @@ func (cmd *goPCA) RunCommand(prog string, args []string, stdin io.Reader, stdout if err != nil { return 1 } + log.Print("done") return 0 } -- 2.30.2