def get_qlabel(qckeyword, calcindex):
    """
    Returns a string that can be used as a label for
    a given quantum chemistry calculation with qckeyword specified by the user
    and calculation index. The string is based on the dependencies of the
    corresponding calculation.
    """
    calcs = qckeyword.split(',')
    calc = calcs[calcindex]
    if calc.startswith('compos'):
        label = ','.join(calcs[0:calcindex+1])
    else:
        labels = []
        for i in range(0, calcindex):
            if calcs[i].startswith('energy') or calcs[i].startswith('compos'):
                pass
            else:
                labels.append(calcs[i])
        labels.append(calcs[calcindex])
        label = ','.join(labels)
    return label