def supported(aln):
def col_consensus(columns):<EOL><INDENT>"""<STR_LIT>"""<EOL>for col in columns:<EOL><INDENT>if (<EOL>(col.count('<STR_LIT:->') >= len(col)/<NUM_LIT:2>) or<EOL>all(c.islower() for c in col if c not in '<STR_LIT>')<EOL>):<EOL><INDENT>yield '<STR_LIT:->'<EOL>continue<EOL><DEDENT>if any(c.islower() for c in col):<EOL><INDENT>logging.warn('<STR_LIT>'<EOL>'<STR_LIT>' + '<STR_LIT>'.join(col))<EOL>col = map(str.upper, col)<EOL><DEDENT>most_common = Counter(<EOL>[c for c in col if c not in '<STR_LIT:->']<EOL>).most_common()<EOL>if not most_common:<EOL><INDENT>logging.warn("<STR_LIT>")<EOL><DEDENT>if most_common[<NUM_LIT:0>][<NUM_LIT:1>] == <NUM_LIT:1>:<EOL><INDENT>yield '<STR_LIT:->'<EOL><DEDENT>elif (len(most_common) > <NUM_LIT:1> and<EOL>most_common[<NUM_LIT:0>][<NUM_LIT:1>] == most_common[<NUM_LIT:1>][<NUM_LIT:1>]):<EOL><INDENT>ties = [x[<NUM_LIT:0>] for x in most_common<EOL>if x[<NUM_LIT:1>] == most_common[<NUM_LIT:0>][<NUM_LIT:1>]]<EOL>yield '<STR_LIT>'.join(ties)<EOL><DEDENT>else:<EOL><INDENT>yield most_common[<NUM_LIT:0>][<NUM_LIT:0>]<EOL><DEDENT><DEDENT><DEDENT>return list(col_consensus(zip(*aln)))<EOL>
Get only the supported consensus residues in each column.

    Meaning:
    - Omit majority-gap columns
    - Omit columns where no residue type appears more than once
    - In case of a tie, return all the top-scoring residue types
      (no prioritization)

    Returns a *list* -- not a string! -- where elements are strings of the
    consensus character(s), potentially a gap ('-') or multiple chars ('KR').