import (
"bufio"
+ "context"
"errors"
"flag"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
- "sort"
"git.arvados.org/arvados.git/sdk/go/arvados"
"github.com/james-bowman/nlp"
defer input.Close()
}
log.Print("reading")
- cgs, err := ReadCompactGenomes(input)
+ tilelib := tileLibrary{
+ includeNoCalls: true,
+ compactGenomes: map[string][]tileVariantID{},
+ }
+ err = tilelib.LoadGob(context.Background(), input, nil)
if err != nil {
return 1
}
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)
+ data, rows, cols := cgs2array(tilelib.compactGenomes)
if *onehot {
log.Printf("recode one-hot: %d rows, %d cols", rows, cols)
data, cols = recodeOnehot(data, cols)
}
- cgs = nil
log.Printf("creating matrix backed by array: %d rows, %d cols", rows, cols)
mtx := array2matrix(rows, cols, data).T()