def parse_sample_value_map(arguments, samples, default, sample_map, type):
    """Combine arguments specified for a default value and sample-value map file.

    Parameters
    ----------
    arguments
        Parsed arguments containing some the default value argument
        and the optionally the sample-value map file argument.
    samples : list
        List of sample names
    default : str
        Name of argument with default value.
    sample_map : str
        Path of file containing tab-seperated per sample values.
    type : type
        Type of the specified values.

    Returns
    -------
    sample_values : dict
        Dict mapping samples to values.
    """
    sample_value = dict()
    assert hasattr(arguments, default)
    # sample value map
    if hasattr(arguments, sample_map):
        path = getattr(arguments, sample_map)[0]
        if path:
            with open(path) as f:
                for line in f.readlines():
                    sample, value = line.strip().split("\t")
                    sample_value[sample] = type(value)
    # default value
    default_value = getattr(arguments, default)[0]
    for sample in samples:
        if sample in sample_value:
            pass
        else:
            sample_value[sample] = default_value
    return sample_value