def get_distance_and_orientation (line, cols):
    """return distance and orientation, given a list representing a line from the pairs input file and a ColIndices object """
    distance = int(line[cols.pos2]) - int(line[cols.pos1])

    # distance will always be > 0 for upper triangle, but in case it is not true.
    if distance > 0:
        orientation = str(line[cols.strand1]) + str(line[cols.strand2])
    else:
        orientation = str(line[cols.strand2]) + str(line[cols.strand1])
        distance = abs(distance)

    return(distance, orientation)