interaction_score: Computes interaction score for combined graphs

Description Usage Arguments Value Examples

View source: R/pipeline_functions.R

Description

Writes the input data (combined graphs for both groups in gml format and lists of edges adjacent to drug targets for both groups) to files and calls a python script for calculating the score. Output files written by the python script are two graphs in gml format containing the interaction score as weight. These are loaded and returned in a named list. ATTENTION: Data exchange via files is mandatory and takes a long for large data. Interaction score computation is expensive and slow because it involves finding all simple paths up to a certain length between source and target node of the drug target edges. Don't set 'max_path_length' in settings to a large value and only consider this step if your graphs have up to approximately 2 million edges. Computation is initiated by calculate_interaction_score. The python script is parallelized using Ray. Use the setting 'int_score_mode' to force sequential or parallel computation. Refer to the Ray documentation if you encounter problems with running the python script in parallel. DISCLAIMER: Depending on the operating system Python comes pre-installed or has to be installed manually. Please pay attention to the version and the executable used (python/python3 or homebrew python). You can use the 'python_executable' setting to specify the command or path.

Usage

1
interaction_score(graphs, drug_target_edgelists, settings)

Arguments

graphs

A named list (elements 'group1' and 'group2'). Each element contains the combined graph for its group.

drug_target_edgelists

A named list (elements 'group1' and 'group2'). Each element contains the list of edges adjacent to drug targets as a data frame (columns 'from', 'to' and 'weight')

settings

A named list containing pipeline settings

Value

A named list (elements 'group1' and 'group2'). Each element contains an iGraph object containing the interaction score as weight.

Examples

1
2
3
4
5
6
7
8
data(combined_graphs_example)
data(drug_targets_example)
settings <- molnet_settings()
## the next step requires Python

interaction_score_graphs <- interaction_score(combined_graphs_example[["graphs"]],
drug_target_edgelists=drug_targets_example[["edgelist"]],
settings=settings)

molnet-org/molnet documentation built on Dec. 21, 2021, 8:59 p.m.