Closed jblachly closed 4 years ago
How should it be iterable? Should we return CigarOps (i.e 6M, 3I, 3D ...)? CigarItr returns a sequence of ops (i.e. 6M3I3D -> M, M, M, M, M, M, I, I, I, D, D, D).
I should be able to do this:
foreach(c; read.cigar) {
f( c.op );
g( c.length);
}
which is how it works in pysam (kind of, that returns a tuple) - we shoudl return a struct which I thought you were already doing? I saw the iter returns a struct with properties .ops and .length already
No my CigarItr returns an Ops enum and repeats until the CigarOp is exhausted.
(wishlist only) Evidently there is a generator
CigarItr
which takes cigar struct and makes range, but couldn't we embed range primitives within Cigar itself? would be more ergonomic