def get_y_offset(read, coords):
    """ get the y-position for the read, within the first row with open space
    
    This is decidedly less than optimal, but will produce a more compact plot.
    
    Args:
        read: dictionary with 'position' and 'bases' entries e.g.
            {'position': 15555, bases ['M', 'MTA', 'M']}
        positions: ordered dictionary of max end position at each row, indexed
            by row number e.g. {10: 100, 20: 150, 30: 50}
    
    Returns:
        y-axis offset.
    """
    if len(coords) == 0:
        return 10
    for key in coords:
        if read['position'] > coords[key] + 1:
            return key
    return max(coords) + 10
