Get start and end coordinates that approximate the reference axis for a collection of chains
     (not necessarily all the same length).

    Parameters
    ----------
    chains : [Polypeptide]

    Returns
    -------
    start, end : numpy.array
        3D start and end coordinates for defining the reference axis.

def start_and_end_of_reference_axis(chains):
    """ Get start and end coordinates that approximate the reference axis for a collection of chains
     (not necessarily all the same length).

    Parameters
    ----------
    chains : [Polypeptide]

    Returns
    -------
    start, end : numpy.array
        3D start and end coordinates for defining the reference axis.
    """
    coords = [numpy.array(chains[0].primitive.coordinates)]
    orient_vector = polypeptide_vector(chains[0])
    # Append the coordinates for the remaining chains, reversing the direction in antiparallel arrangements.
    for i, c in enumerate(chains[1:]):
        if is_acute(polypeptide_vector(c), orient_vector):
            coords.append(numpy.array(c.primitive.coordinates))
        else:
            coords.append(numpy.flipud(numpy.array(c.primitive.coordinates)))
    start = numpy.mean([x[0] for x in coords], axis=0)
    end = numpy.mean([x[-1] for x in coords], axis=0)
    return start, end