def analyze_alignment(alignment, pdb_contact_idxs=[]):
    """Return scores describing the qualit of the alignment.

    Returns
    -------
    identity : float <= 1
        Core identity.
    coverage : float <= 1
        Core coverage.
    if_identity : float <= 1
        Interface identity.
    if_coverage : float <= 1
        Interface coverage.
    """
    pdb_aa_idx = -1
    sequence_1_length = 0
    sequence_1_identity = 0
    sequence_1_coverage = 0
    interface_1_identity = 0
    interface_1_coverage = 0
    for aa_1, aa_2 in zip(*alignment):
        is_interface = False
        if aa_1 == '-':
            continue
        sequence_1_length += 1
        if aa_2 == '-':
            continue
        pdb_aa_idx += 1
        if pdb_aa_idx in pdb_contact_idxs:
            is_interface = True
        sequence_1_coverage += 1
        if is_interface:
            interface_1_coverage += 1
        if aa_1 != aa_2:
            continue
        sequence_1_identity += 1
        if is_interface:
            interface_1_identity += 1
    identity = sequence_1_identity / float(sequence_1_length)
    coverage = sequence_1_coverage / float(sequence_1_length)
    assert identity <= 1
    assert coverage <= 1
    if pdb_contact_idxs:
        if_identity = sequence_1_identity / float(len(pdb_contact_idxs))
        if_coverage = interface_1_coverage / float(len(pdb_contact_idxs))
        assert if_identity <= 1
        assert if_coverage <= 1
    else:
        if_identity = None
        if_coverage = None
    return identity, coverage, if_identity, if_coverage
