I'm starting to think we should cache the mate cigar like we do with the record's cigar. It would require similar trickery to detect when a new mate cigar is updated upon the record since we would have to intercept any call to setAttribute, check if the attribute is being set with the MC tag, and then reset the in-memory mate cigar to the new value. If I implement this suggestion, it will be in a separate PR.
This might be my next PR since we already have all Cigar stats cached after a single stat is accessed:
|
/** Statistics about this cigar which are computed once on first access and then cached. */ |
|
private lazy val stats: CigarStats = CigarStats(this) |
From:
I'm starting to think we should cache the mate cigar like we do with the record's cigar. It would require similar trickery to detect when a new mate cigar is updated upon the record since we would have to intercept any call to
setAttribute, check if the attribute is being set with theMCtag, and then reset the in-memory mate cigar to the new value. If I implement this suggestion, it will be in a separate PR.This might be my next PR since we already have all Cigar stats cached after a single stat is accessed:
fgbio/src/main/scala/com/fulcrumgenomics/alignment/Alignment.scala
Lines 177 to 178 in 42aaae7
From: