}
type tileLibrary struct {
- includeNoCalls bool
+ retainNoCalls bool
skipOOO bool
retainTileSequences bool
basesOut += countBases(job.fasta[last.pos+last.taglen : f.pos+f.taglen])
} else {
// If we dropped this tile
- // (because !includeNoCalls),
+ // (because !retainNoCalls),
// set taglen=0 so the
// overlapping tag is counted
// toward coverage on the
// Return a tileLibRef for a tile with the given tag and sequence,
// adding the sequence to the library if needed.
func (tilelib *tileLibrary) getRef(tag tagID, seq []byte) tileLibRef {
- if !tilelib.includeNoCalls {
+ dropSeq := false
+ if !tilelib.retainNoCalls {
for _, b := range seq {
if b != 'a' && b != 'c' && b != 'g' && b != 't' {
- // return "tile not found" if seq has any
- // no-calls
- return tileLibRef{Tag: tag}
+ dropSeq = true
+ break
}
}
}
}
tilelib.variants++
tilelib.variant[tag] = append(tilelib.variant[tag], seqhash)
- if tilelib.retainTileSequences {
+ if tilelib.retainTileSequences && !dropSeq {
if tilelib.seq == nil {
tilelib.seq = map[[blake2b.Size256]byte][]byte{}
}
tilelib.mtx.Unlock()
if tilelib.encoder != nil {
+ saveSeq := seq
+ if dropSeq {
+ // Save the hash, but not the sequence
+ saveSeq = nil
+ }
tilelib.encoder.Encode(LibraryEntry{
TileVariants: []TileVariant{{
Tag: tag,
Variant: variant,
Blake2b: seqhash,
- Sequence: seq,
+ Sequence: saveSeq,
}},
})
}