コード例 #1
0
ファイル: enhance.py プロジェクト: ig-ghub/Metaboverse
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
ファイル: enhance.py プロジェクト: ig-ghub/Metaboverse
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
ファイル: enhance.py プロジェクト: ig-ghub/Metaboverse
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
ファイル: curate.py プロジェクト: ig-ghub/Metaboverse
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
ファイル: enhance.py プロジェクト: ig-ghub/Metaboverse
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