def remove_small_components(rec, minlen):
    newseq = []
    removed = 0
    for gap, seq in groupby(rec.seq, lambda x: x.upper() == 'N'):
        seq = "".join(seq)
        seqlen = len(seq)
        if not gap and minlen < seqlen:
            seq = seqlen * "N"  # Mask small components
            logging.debug("Discard component ({0}) in {1}".\
                            format(seqlen, rec.name))
            removed += seqlen
        newseq.append(seq)
    rec.seq = Seq("".join(newseq))
    return removed
dataset/ETHPy150Open tanghaibao/jcvi/formats/fasta.py/remove_small_components/swapped operands of `<`