def filterDiscordantCluster(chrom, beg, end, readPairList, bamFile):
    '''
    '''
    nbDiscordant = len(readPairList)
    nbClippedBothSides = 0
    readPairFilteredList = []

    ## Extract alignments in the interval
    iterator = bamFile.fetch(chrom, beg, end)

    ## Iterate over the alignments
    for alignmentObj in iterator:

        ## Supporting discordant paired-end read and cigar available
        if (alignmentObj.query_name in readPairList) and (alignmentObj.cigartuples is not None):

            firstOperation = alignmentObj.cigartuples[0][0]
            lastOperation = alignmentObj.cigartuples[-1][0]

            ### A) Read clipped both in the beginning and ending
            if ((firstOperation == 4) or (firstOperation == 5)) and ((lastOperation == 4) or (lastOperation == 5)):
                nbClippedBothSides += 1