def shrink_alignments(alignments):
    """
    Remove columns from alignment which all consist of gaps.
    """
    excludes = []
    for i in range(len(alignments[0])):
        col = set([line[i] for line in alignments])
        if "-" in col and len(col) == 1:
            excludes.append(i)
    return [
        [site for i, site in enumerate(alignment) if i not in excludes]
        for alignment in alignments
    ]