def longestSegment(self, segment, pIdentityMin=.9, minAlignSize=1,
                       mode=max, **kwargs):
        besthit = None
        for i in xrange(len(segment)):
            ni = 0 # IDENTITY COUNT
            nm = 0 # MISMATCH COUNT
            for j in xrange(i, -1, -1):
                ni += segment[j][2]
                l = mode(segment[i][0] + segment[i][2] - segment[j][0],
                       segment[i][1] + segment[i][2] - segment[j][1])
                pIdentity = float(ni) / l
                if pIdentity >= pIdentityMin and (besthit is None or
                                                  besthit[4] > ni + nm):
                    besthit = (segment[j][0], segment[i][0] + segment[i][2],
                               segment[j][1], segment[i][1] + segment[i][2],
                               ni + nm)
                nm += segment[j][3]
        if besthit is None:
            return None
        elif besthit[4] >= minAlignSize:
            return besthit[:4]
        else:
            return None
dataset/ETHPy150Open cjlee112/pygr/pygr/sequence.py/Seq2SeqEdge.longestSegment/swapped operands of `>`