def build_database_url(ensembl_database):
    """ Build the correct URL based on the database required
    GRCh37 databases are on port 3337, all other databases are on port 3306
    """
    port = 3337 if str(ensembl_database).endswith('37') else 3306
    return 'mysql+mysqldb://anonymous@ensembldb.ensembl.org:{}/{}'\
        .format(port, ensembl_database)