def get_scilife_to_customer_name(project_name, p_con, s_con, get_barcode_seq=False):
    """Get scilife to customer name mapping optionally with barcodes, represented as a
    dictionary.

    :param project_name: project name
    :param p_con: object of type <ProjectSummaryConnection>
    :param s_con: object of type <SampleRunMetricsConnection>
    :param get_barcode_seq: True/False(default)

    :returns: dictionary with keys scilife name and values customer name and barcodes(optional)
    """
    name_d = {}
    for samp in s_con.get_samples(sample_prj=project_name):
        bcname = samp.get("barcode_name", None)
        s = p_con.get_project_sample(project_name, bcname)
        name_d[bcname] = {'scilife_name': s['project_sample'].get('scilife_name', bcname),
                          'customer_name' : s['project_sample'].get('customer_name', None)
                          }
        if get_barcode_seq:
            name_d[bcname]["barcode_seq"] = samp.get("sequence", None)
    return name_d