def internal_parse_args(parser):
    """ Parse incoming arguments, catch issues, and convert to lists.

    Keyword arguments:

    parser -- an ArgumentParser()

    Returns:
    dict of arguments: new values
    """
    args = parser.parse_args()
    if args.logs is None:
        raise ValueError('Must provide at least one log file.')
    if args.code is None:
        raise ValueError('Must provide phenotype code.')
    if args.ancestry_vec is None:
        raise ValueError('Must provide at least one ancestry.')
    if args.out is None:
        raise ValueError('Must provide output directory.')
    list_of_logs = args.logs.split(',')
    list_of_ancestry = args.ancestry_vec.split(',')
    if len(list_of_logs) != len(list_of_ancestry):
        raise ValueError('The list of logs and list of ancestries must be the same length.')
    args_dict = vars(args)
    args_dict.update({'logs': list_of_logs, 'ancestry_vec': list_of_ancestry})
    return args_dict