def parse_dssp(dssp_file):
    """parses a DSSP file and returns a dictionary of
    keys=(resnum, chain) and values=(dssp code)"""
    dssp_ss = dict()
    with open(dssp_file, 'r') as infile:
        for line in infile:
            if line.startswith('  #  RESIDUE'):
                break
        for line in infile:
            if line[13] == '!':
                continue
            resnum = int(line[5:10])
            chain = line[11]
            if line[16] != ' ':
                dssp_ss[(resnum, chain)] = line[16]
            else:
                dssp_ss[(resnum, chain)] = '-'
    return dssp_ss