def write(self, read):
        if not self._insert_order:
            k = (read.tid, read.pos, len(self._reads))
            self._reads[k] = read
            self._read_keys.append(k)
            self._read_keys.sort()
        else:
            self._reads[read.qname] = read
            self._read_keys.append(read.qname)

        if self._ref_lengths[read.tid] < read.aend:
            self._ref_lengths[read.tid] = read.aend
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/bam/t/__init__.py/MockBam.write/original