def _milliBad(self, ismRNA=False):
        sizeMult = self._sizeMult

        qAlnSize, tAlnSize = self.qspan * sizeMult, self.tspan
        alnSize = min(qAlnSize, tAlnSize)
        if alnSize <= 0:
            return 0

        sizeDiff = qAlnSize - tAlnSize
        if sizeDiff < 0:
            sizeDiff = 0 if ismRNA else -sizeDiff

        insertFactor = self.qNumInsert
        if not ismRNA:
            insertFactor += self.tNumInsert

        total = (self.matches + self.repMatches + self.misMatches) * sizeMult

        return (1000 * (self.misMatches * sizeMult + insertFactor + \
                round(3 * math.log(1 + sizeDiff)))) / total if total != 0 else 0
calculate badness in parts per thousand
dataset/ETHPy150Open tanghaibao/jcvi/formats/psl.py/PslLine._milliBad