def get_wild_type_adjacencies(segment_data, max_seg_gap):
    """ Calculate adjacencies in segment data.

    Args:
        segment_data (pandas.DataFrame): segmentation of the genome
        max_seg_gap (int): maximum gap between adjacent segments

    Returns:
        set of tuple: pairs of segment indices adjacent in the reference genome

    """

    # Adjacent segments in the same chromosome
    adjacencies = set()
    for idx in range(len(segment_data.index) - 1):
        same_chrom = segment_data.iloc[idx]['chromosome'] == segment_data.iloc[idx+1]['chromosome']
        gap_length = segment_data.iloc[idx+1]['start'] - segment_data.iloc[idx]['end']
        if same_chrom and gap_length <= max_seg_gap:
            adjacencies.add((idx, idx+1))
    return adjacencies