Iterates over all Sii entries of a specfile in siiContainer and validates
    if they surpass a user defined quality threshold. The parameters for
    validation are defined in ``siiContainer.info[specfile]``:

        - ``qcAttr``, ``qcCutoff`` and ``qcLargerBetter``

    In addition to passing this validation a ``Sii`` has also to be at the first
    list position in the ``siiContainer.container``. If both criteria are met
    the attribute ``Sii.isValid`` is set to ``True``.

    :param siiContainer: instance of :class:`maspy.core.SiiContainer`
    :param specfile: unambiguous identifier of a ms-run file. Is also used as
        a reference to other MasPy file containers.

def applySiiQcValidation(siiContainer, specfile):
    """Iterates over all Sii entries of a specfile in siiContainer and validates
    if they surpass a user defined quality threshold. The parameters for
    validation are defined in ``siiContainer.info[specfile]``:

        - ``qcAttr``, ``qcCutoff`` and ``qcLargerBetter``

    In addition to passing this validation a ``Sii`` has also to be at the first
    list position in the ``siiContainer.container``. If both criteria are met
    the attribute ``Sii.isValid`` is set to ``True``.

    :param siiContainer: instance of :class:`maspy.core.SiiContainer`
    :param specfile: unambiguous identifier of a ms-run file. Is also used as
        a reference to other MasPy file containers.
    """
    attr = siiContainer.info[specfile]['qcAttr']
    cutOff = siiContainer.info[specfile]['qcCutoff']
    if siiContainer.info[specfile]['qcLargerBetter']:
        evaluator = lambda sii: getattr(sii, attr) >= cutOff and sii.rank == 1
    else:
        evaluator = lambda sii: getattr(sii, attr) <= cutOff and sii.rank == 1

    for itemList in listvalues(siiContainer.container[specfile]):
        #Set the .isValid attribute of all Sii to False
        for sii in itemList:
            sii.isValid = False

        #Validate the first Sii
        sii = itemList[0]
        if evaluator(sii):
            sii.isValid = True