def length_difference_check(orthologLen, inparalogLen, lenRatioThr, debug=False
    ):
    """
    Check the difference in length between a inparalong and its ortholog sequence (from the same species).

    Return a tuple of type (1, 0.4) where 1 means the inparalog should be kept, and 0.4 is
    the difference in length from the closest ortholog in the cluster.
    If the inparalog should be dropped then the first value is 0
    """
    if debug:
        print('\nlength_difference_check :: START')
        print('Ortholog length: %d' % orthologLen)
        print('Inparalogs length: %d' % inparalogLen)
        print('Length difference threshold: %s' % str(lenRatioThr))
    lenDiffRatio = 0
    if orthologLen == inparalogLen:
        return 1, 0.0, 1.0
    else:
        inparaVsOrthoLen = 1.0
        if inparalogLen < orthologLen:
            seqLenDiff = orthologLen - inparalogLen
            lenDiffRatio = round(float(seqLenDiff) / float(orthologLen), 2)
            inparaVsOrthoLen = -round(float(orthologLen) / float(
                inparalogLen), 2)
        else:
            seqLenDiff = inparalogLen - orthologLen
            lenDiffRatio = round(float(seqLenDiff) / float(inparalogLen), 2)
            inparaVsOrthoLen = round(float(inparalogLen) / float(
                orthologLen), 2)
        if lenDiffRatio <= lenRatioThr:
            return 1, lenDiffRatio, inparaVsOrthoLen
        else:
            return 0, lenDiffRatio, inparaVsOrthoLen
