예제 #1
0
파일: custom.py 프로젝트: VDBWRAIR/pbs
def create_command(module_type):
    cmd_dict = get_cmd_spec(module_type)
    vars, inner_cmd = cmd_dict['vars'], cmd_dict['inner_cmd']
    cmd_opts = dictzip(vars, map(getvar, vars))
    if module_type != None:
          whole_cmd = wrap_cmd(module_type, inner_cmd)
          return whole_cmd.format(**cmd_opts)
    else:
          return inner_cmd
예제 #2
0
def create_command(module_type):
    cmd_dict = get_cmd_spec(module_type)
    vars, inner_cmd = cmd_dict['vars'], cmd_dict['inner_cmd']
    cmd_opts = dictzip(vars, map(getvar, vars))
    if module_type != None:
        whole_cmd = wrap_cmd(module_type, inner_cmd)
        return whole_cmd.format(**cmd_opts)
    else:
        return inner_cmd
예제 #3
0
def _create_dict(obj_func, columns, getters, validator, dictgetters):
    obj = apply(obj_func)
    pre_dict = obj_to_dict(obj, dictzip(columns, getters))
    #optional intermediate schema here
    if dictgetters:
        extra_dict = obj_to_dict(pre_dict, dictgetters)
        full_dict = merge_dicts(pre_dict, extra_dict)
    else:
        full_dict = pre_dict
    return validator.validate(full_dict)
예제 #4
0
def _create_dict(obj_func, columns, getters, validator, dictgetters):
    obj = apply(obj_func)
    pre_dict = obj_to_dict(obj, dictzip(columns, getters))
    #optional intermediate schema here
    if dictgetters:
        extra_dict = obj_to_dict(pre_dict, dictgetters)
        full_dict = merge_dicts(pre_dict, extra_dict)
    else:
        full_dict = pre_dict
    return validator.validate(full_dict)
예제 #5
0
def make_ovrlp_graph(kmers):
    N = len(kmers)
    ov = len(kmers[0]) - 1
    M = np.zeros((N, N))
    D = dictzip(kmers, xrange(N))
    def update(M, pre, suff):
         sfx, suffg = suff
         nbrs = imap(X[0], ifilter(X[1]==sfx, pre))
         nbr_idxs = map(D.__getitem__, nbrs)
         s_idxs = map(D.__getitem__, suffg)
         M[ s_idxs, nbr_idxs] = 1
    pre, suff = groupby(kmers, X[:ov]), groupby(kmers, X[-ov:])
    pre = izip(kmers, imap(X[:ov], kmers))
    Mupdate = F(update, M, pre)
    #NOTE: starmap drains itertools.groupby
    map(Mupdate, suff)
    return D, M
예제 #6
0
파일: custom.py 프로젝트: VDBWRAIR/pbs
def make_job_dict():
    modules = get_available_modules() + ['Other']
    module_type = select_interactive_menu(modules)
    pbs_opts = dictzip(opts, map(option_with_default, opts))
    pbs_opts['command'] = create_command(module_type)
    return pbs_opts
예제 #7
0
def make_job_dict():
    modules = get_available_modules() + ['Other']
    module_type = select_interactive_menu(modules)
    pbs_opts = dictzip(opts, map(option_with_default, opts))
    pbs_opts['command'] = create_command(module_type)
    return pbs_opts