def write_gmt(gmt, filepath):
    """
    Write a GMT DataFrame to filepath.gmt.
    :param gmt: DataFrame;
    :param filepath: str; filepath to a GMT compress
    :return: DataFrame; GMT
    """

    if 'Description' not in gmt.columns:
        gmt['Description'] = gmt.index
        gmt = gmt.reindex(
            columns=gmt.columns[-1:].tolist() + gmt.columns[:-1].tolist())

    if not filepath.endswith('gmt'):
        filepath += '.gmt'

    gmt.to_csv(filepath, header=None, sep='\t')

    return gmt