def check_clipping(alignment,log=None):
    """
    checks if there are soft clipping bases in the segment.
    If the read is clipping, the read is filtered and returns False.

    :param alignment: pysam AlignedSegment
    :return: Boolean
    """
    if not alignment.is_unmapped:
        cigar = alignment.cigarstring
        if 'S' in cigar or 'H' in cigar:
            alignment.is_qcfail = True
            if log:
                log.clipping(alignment)
            return False
        else:
            return True
    else:
        return True