def comp_pos_ends(pos1, pos2):
    """Compare sequence data end positions"""
    if not pos1 or not pos2:
        return 0
    if pos1['chrom'] < pos2['chrom']:
        return -1
    elif pos1['chrom'] > pos2['chrom']:
        return 1
    else:
        if pos1['end'] < pos2['end']:
            return -1
        elif pos1['end'] > pos2['end']:
            return 1
        else:
            return 0