def calculate_fcc(listA, listB):
    """
    Calculates the fraction of common elements between two lists
    taking into account chain IDs
    """
    
    cc = len(listA.intersection(listB))
    cc_v = len(listB.intersection(listA))
    
    return (cc, cc_v)