import re


def get_max_deltas(filename):
    """Returns maximum gap parameters for the specified CoMetGeNe result file.

    :param filename: CoMetGeNe result file
    :return: tuple representing the gap parameters for genome and metabolic
        pathway, respectively
    """
    pattern = re.compile("--- delta_G = (\d+), delta_D = (\d+).* ---")
    with open(filename, 'r') as f_in:
        for line in f_in:
            deltas = pattern.search(line)
            if deltas:
                dG, dD = deltas.groups()
                return int(dG), int(dD)
    return None, None