generate_interaction_score_graphs {DrDimont}R Documentation

Computes interaction score for combined graphs

Description

Writes the input data (combined graphs for both groups in 'gml' format and lists of edges adjacent to drug targets for both groups in 'tsv' format) to files and calls a Python script for calculating the interaction scores. Output files written by the Python script are two graphs in 'gml' format containing the interaction score as an additional 'interaction_weight' edge attribute. These are loaded and returned in a named list. ATTENTION: Data exchange via files is mandatory and takes a long time 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 the parameter 'max_path_length' in drdimont_settings to a large value and only consider this step if your graphs have approximately 2 million edges or less. Computation is initiated by calculate_interaction_score. The Python script is parallelized using Ray. Use the drdimont_settings parameter '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. Use DrDimont's install_python_dependencies to install a virtual Python or conda environment containing the required Python packages. You can use the parameter 'conda' in drdimont_settings to specify if Python packages were installed with conda ('conda=TRUE'), else a virtual environment installed with pip is assumed (default: 'conda=FALSE').

Usage

generate_interaction_score_graphs(graphs, drug_target_edgelists, settings)

Arguments

graphs

[list] A named list with elements 'groupA' and 'groupB' containing the combined graphs of each group as iGraph object ('graphs' from output of generate_combined_graphs)

drug_target_edgelists

[list] A named list (elements 'groupA' and 'groupB'). Each element contains the list of edges adjacent to drug targets as a data frame (columns 'from', 'to' and 'weight'). 'edgelists' from output of determine_drug_targets

settings

[list] A named list containing pipeline settings. The settings list has to be initialized by drdimont_settings. Items in the named list can be adjusted as desired.

Value

A named list (elements 'groupA' and 'groupB'). Each element contains an iGraph object containing the interaction scores as interaction_weight attributes.

Examples

data(combined_graphs_example)
data(drug_target_edges_example)

example_settings <- drdimont_settings()


example_interaction_score_graphs <- generate_interaction_score_graphs(
                                        graphs=combined_graphs_example$graphs,
                                        drug_target_edgelists=drug_target_edges_example$edgelists,
                                        settings=example_settings)



[Package DrDimont version 0.1.4 Index]