def is_s35_bad(qua, quafmt):
    """s35 filter

    From the 5' end of the read, the first 25 of 35 bases must
    have quality scores of at least 30, otherwise the read is discarded.
    If the read length is lower than 35, the read is discarded.
    """
    assert quafmt in [33, 64]

    if len(qua) < 35:
        return True

    q30 = 0
    for i in range(35):
        if ord(qua[i]) - quafmt >= 30:
            q30 += 1

    if q30 < 25:
        return True
    else:
        return False