예제 #1
0
def include_reactions_replications(
        reactions_process,
        args_dict):

    # Collect information about replicate reactions
    reactions_replicates = collect_reactions_replicates(
        reactions=reactions_process)

    # Get cores and chunks
    cores = get_cores(args_dict)

    # Chunk data based on core #
    chunks = split_dictionary(
        data=reactions_process,
        cores=cores)
    func = partial(
        run_reactions_replication,
        reactions_replicates=reactions_replicates)
    reactions_novel = run_chunks(
        func,
        chunks,
        cores)

    # Join dictionary chunks
    reactions_result = {}
    for dictionary_chunk in reactions_novel:
        reactions_result.update(dictionary_chunk)

    return reactions_result
예제 #2
0
def include_reactions_transport_processes(
        reactions_behavior,
        args_dict):

    # Collect information about compartments in which each metabolite
    # participates in each process
    processes_dispersal = collect_processes_metabolites_compartments(
        reactions=reactions_behavior)

    # Filter information for prospective transports of metabolites between
    # compartments in processes
    processes_transports = filter_processes_transports(
        processes_dispersal=processes_dispersal)

    # Get cores and chunks
    cores = get_cores(args_dict)

    # Chunk data based on core #
    chunks = split_dictionary(
        data=reactions_behavior,
        cores=cores)
    func = partial(
        run_reactions_transport,
        processes_transports=processes_transports)
    reactions_novel = run_chunks(
        func,
        chunks,
        cores)

    # Join dictionary chunks
    reactions_result = {}
    for dictionary_chunk in reactions_novel:
        reactions_result.update(dictionary_chunk)

    return reactions_result
예제 #3
0
def enhance_metabolites(
        metabolites_recon,
        hmdb,
        args_dict):

    # Get cores and chunks
    cores = get_cores(args_dict)

    # Chunk data based on core #
    chunks = split_dictionary(
        data=metabolites_recon,
        cores=cores)
    func = partial(
        run_metabolite_enhance,
        summary_hmdb=hmdb)
    metabolites_novel = run_chunks(
        func,
        chunks,
        cores)

    # Join dictionary chunks
    metabolites_result = {}
    for dictionary_chunk in metabolites_novel:
        metabolites_result.update(dictionary_chunk)

    return metabolites_result
예제 #4
0
def curate_reactions(reactions_curation, reactions_original, args_dict):

    # Copy information
    reactions_novel = copy.deepcopy(reactions_original)

    # Get cores and chunks
    cores = get_cores(args_dict)

    # Chunk data based on core #
    chunks = np.array_split(reactions_curation, cores)
    func = partial(run_curate_reactions,
                   reactions_original=reactions_original,
                   reactions_novel=reactions_novel)
    reactions_chunks = run_chunks(func, chunks, cores)

    reactions_replicates = {}
    for sub_dictionary in reactions_chunks:
        reactions_replicates.update(sub_dictionary)

    return reactions_replicates
예제 #5
0
def include_reactions_behaviors(
        reactions_recon,
        args_dict):

    # Get cores and chunks
    cores = get_cores(args_dict)

    # Chunk data based on core #
    chunks = split_dictionary(
        data=reactions_recon,
        cores=cores)

    reactions_novel = run_chunks(
        run_reaction_behavior,
        chunks,
        cores)

    # Join dictionary chunks
    reactions_result = {}
    for dictionary_chunk in reactions_novel:
        reactions_result.update(dictionary_chunk)

    return reactions_result