"runtime"
"strings"
"sync"
+ "sync/atomic"
"git.arvados.org/arvados.git/sdk/go/arvados"
"github.com/klauspost/pgzip"
bufws []*bufio.Writer
gzws []*pgzip.Writer
encs []*gob.Encoder
+
+ countTileVariants int64
+ countGenomes int64
+ countReferences int64
)
throttle := throttle{Max: runtime.GOMAXPROCS(0)}
if err := throttle.Err(); err != nil {
return err
}
+ atomic.AddInt64(&countTileVariants, int64(len(ent.TileVariants)))
for _, tv := range ent.TileVariants {
err := encs[int(tv.Tag)/tagsPerFile].Encode(LibraryEntry{
TileVariants: []TileVariant{tv},
// genome, even if there are no
// variants in the relevant range.
// Easier for downstream code.
+ atomic.AddInt64(&countGenomes, int64(len(ent.CompactGenomes)))
for _, cg := range ent.CompactGenomes {
for i, enc := range encs {
start := i * tagsPerFile
}
// Write all ref seqs to the first
// slice. Easier for downstream code.
+ atomic.AddInt64(&countReferences, int64(len(ent.CompactSequences)))
if len(ent.CompactSequences) > 0 {
err := encs[0].Encode(LibraryEntry{CompactSequences: ent.CompactSequences})
if err != nil {
closeOutFiles(fs, bufws, gzws, encs)
return throttle.Err()
}
+ defer log.Printf("Total %d tile variants, %d genomes, %d reference sequences", countTileVariants, countGenomes, countReferences)
return closeOutFiles(fs, bufws, gzws, encs)
}