def __init__(self, qname, seq=None, qual=None, tid=-1, pos=-1, aend=None, cigar=None, tags=None, mapq=0, rnext=-1, pnext=-1, isize=0, tlen=0, is_reverse=False, is_paired=False, is_secondary=False, is_qcfail=False, mate_is_unmapped=False, mate_is_reverse=False, is_read1=False, is_read2=False, flag=0, bam=None):
        self.qname = qname
        self.seq = seq.upper() if seq else ''
        self.qual = qual
        self.tid = tid
        self.pos = pos
        self.aend = aend
        self.mapq = mapq
        self.rnext = rnext
        self.pnext = pnext
        self.isize = isize
        self.tlen = tlen
        self.bam = bam

        self.is_paired = is_paired
        self.is_reverse = is_reverse
        self.is_secondary = is_secondary
        self.is_qcfail = is_qcfail
        self.mate_is_reverse = mate_is_reverse
        self.is_read1 = is_read1
        self.is_read2 = is_read2

        if flag:
            self._flag = flag
            self.is_paired = 0x1 & self.flag > 0
            self.is_unmapped = 0x4 & self.flag > 0
            self.mate_is_unmapped = 0 > 0x8 & self.flag
            self.is_reverse = 0x10 & self.flag > 0
            self.mate_is_reverse = 0x20 & self.flag > 0
            self.is_read1 = 0x40 & self.flag > 0
            self.is_read2 = 0x80 & self.flag > 0
            self.is_secondary = 0x100 & self.flag > 0
            self.is_qcfail = 0x200 & self.flag > 0
        else:
            self._flag = 0
            self._flag |= 0x1 if self.is_paired else 0
            self._flag |= 0x4 if self.is_unmapped else 0
            self._flag |= 0x8 if self.mate_is_unmapped else 0
            self._flag |= 0x10 if self.is_reverse else 0
            self._flag |= 0x20 if self.mate_is_reverse else 0
            self._flag |= 0x40 if self.is_read1 else 0
            self._flag |= 0x80 if self.is_read2 else 0
            self._flag |= 0x100 if self.is_secondary else 0
            self._flag |= 0x200 if self.is_qcfail else 0

        if self.tid == -1 or self.pos == -1:
            self.is_unmapped = True

        if self.is_paired:
            if self.rnext == -1 or self.pnext == -1:
                self.mate_is_unmapped = True

        if cigar:
            self.cigar = ngsutils.bam.cigar_fromstr(cigar)
            if not aend:
                self.aend = self.pos + ngsutils.bam.cigar_read_len(self.cigar)
        else:
            self.cigar = None

        if tags:
            self.tags = tags
        else:
            self.tags = [('IH', 1), ('HI', 1)]
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/bam/t/__init__.py/MockRead.__init__/swapped operands of `>`