View source: R/pipeline_functions.R
generate_interaction_score_graphs | R Documentation |
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').
generate_interaction_score_graphs(graphs, drug_target_edgelists, settings)
graphs |
[list] A named list with elements 'groupA' and 'groupB' containing the combined graphs
of each group as iGraph object ('graphs' from output of |
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 |
settings |
[list] A named list containing pipeline settings. The settings list has to be
initialized by |
A named list (elements 'groupA' and 'groupB'). Each element contains an iGraph object containing the interaction scores as interaction_weight attributes.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.