def replace_filepaths(case, new_path, new_marker_list, new_event_count):
    """Rewrite filepath element of the meta data json for each of the merged sample

    Args:
        case: case id of the sample
        new_path: new file path of the merged FCS file
        new_marker_list: list of marker names in the merged FCS
        new_event_count: new event count of the merged sample

    Returns:
        The modified "filepath" for the give case id
    """

    fp = [{'id': case['id'],
           'panel': case['filepaths'][0].get('panel'),
           'tube': 1,
           'date': case['date'],
           'material': case['filepaths'][0].get('material'),
           'fcs': {'path': new_path,
                   'markers': new_marker_list,
                   'event_count': new_event_count}}]
    return fp