Use tilelib to load for export and pca.
[lightning.git] / tilelib.go
index 75e952696ad3c14ef94fe927103ccf06f3747983..31fbb314a5eabf79187c90cdf800c28c07a41d11 100644 (file)
@@ -53,6 +53,7 @@ type tileLibrary struct {
        taglib         *tagLibrary
        variant        [][][blake2b.Size256]byte
        refseqs        map[string]map[string][]tileLibRef
+       compactGenomes map[string][]tileVariantID
        // count [][]int
        // seq map[[blake2b.Size]byte][]byte
        variants int
@@ -151,6 +152,11 @@ func (tilelib *tileLibrary) loadCompactGenomes(cgs []CompactGenome, variantmap m
                                        return
                                }
                        }
+                       if tilelib.compactGenomes != nil {
+                               tilelib.mtx.Lock()
+                               defer tilelib.mtx.Unlock()
+                               tilelib.compactGenomes[cg.Name] = cg.Variants
+                       }
                }()
        }
        wg.Wait()
@@ -348,10 +354,9 @@ func (tilelib *tileLibrary) TileFasta(filelabel string, rdr io.Reader) (tileSeq,
                pathcopy := make([]tileLibRef, len(path))
                copy(pathcopy, path)
                ret[job.label] = pathcopy
-               log.Debugf("%s %s tiled with path len %d, skipped %d", filelabel, job.label, len(path), skipped)
 
                basesIn := countBases(job.fasta)
-               log.Infof("%s %s fasta in %d coverage in %d coverage out %d", filelabel, job.label, len(job.fasta), basesIn, basesOut)
+               log.Infof("%s %s fasta in %d coverage in %d coverage out %d path len %d skipped %d", filelabel, job.label, len(job.fasta), basesIn, basesOut, len(path), skipped)
                stats = append(stats, importStats{
                        InputFile:              filelabel,
                        InputLabel:             job.label,