def write_index_line(feat, chrom, start, stop, sign, fh):
    """ Write a new line in an index file. """
    feat_by_biotype = []
    for biot, cat in feat.items():
        feat_by_biotype.append(':'.join((str(biot), ','.join(sorted(cat)))))
    fh.write('\t'.join((chrom, start, stop, sign)) + '\t' + '\t'.join(
        feat_by_biotype) + '\n')
