def remove_empty_cols(records):
<EOL>records = list(records)<EOL>seqstrs = [str(rec.seq) for rec in records]<EOL>clean_cols = [col<EOL>for col in zip(*seqstrs)<EOL>if not all(c == '<STR_LIT:->' for c in col)]<EOL>clean_seqs = ['<STR_LIT>'.join(row)<EOL>for row in zip(*clean_cols)]<EOL>for rec, clean_seq in zip(records, clean_seqs):<EOL><INDENT>yield SeqRecord(Seq(clean_seq, rec.seq.alphabet), id=rec.id,<EOL>name=rec.name, description=rec.description,<EOL>dbxrefs=rec.dbxrefs, features=rec.features,<EOL>annotations=rec.annotations,<EOL>letter_annotations=rec.letter_annotations)<EOL><DEDENT>
Remove all-gap columns from aligned SeqRecords.