{"id":24529107,"url":"https://github.com/saezlab/phonemes-ilp","last_synced_at":"2025-03-15T17:45:37.244Z","repository":{"id":54462286,"uuid":"98633168","full_name":"saezlab/PHONEMeS-ILP","owner":"saezlab","description":"ILP implementation of PHONEMeS","archived":false,"fork":false,"pushed_at":"2022-06-20T07:22:30.000Z","size":96171,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-22T07:37:40.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saezlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-28T09:25:09.000Z","updated_at":"2022-06-20T07:22:34.000Z","dependencies_parsed_at":"2022-08-13T16:20:42.365Z","dependency_job_id":null,"html_url":"https://github.com/saezlab/PHONEMeS-ILP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FPHONEMeS-ILP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FPHONEMeS-ILP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FPHONEMeS-ILP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FPHONEMeS-ILP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saezlab","download_url":"https://codeload.github.com/saezlab/PHONEMeS-ILP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243769949,"owners_count":20345215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-22T07:34:47.946Z","updated_at":"2025-03-15T17:45:37.214Z","avatar_url":"https://github.com/saezlab.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHONEMeS-ILP\nILP implementation of PHONEMeS - Enio GJERGA\n\n**PHONEMeS** (**PHO**sphorylation **NE**tworks for **M**ass **S**pectrometry) is a method to model signalling networks based on untargeted phosphoproteomics mass spectrometry data and kinase/phosphatase-substrate interactions. \nPlease see [Gjerga et al.](https://pubs.acs.org/doi/abs/10.1021/acs.jproteome.0c00958) and [Terfve et al.](http://www.nature.com/articles/ncomms9033) for an explanation of the methodolgy.\n\nThis repository contains the scripts for the ILP (Integer Linear Programming) implementation of the [PHONEMeS R package](https://github.com/saezlab/PHONEMeS/tree/master/Package) and accompanying scripts that implement the method. ILP is a mathematical optimisation algorithm in which the objective function and constraints are linear and the variables are integers.\n\n### License\n\nDistributed under the GNU GPLv3 License. See accompanying file [LICENSE.txt](https://github.com/saezlab/PHONEMeS-ILP/blob/master/LICENSE).\n\n### Installation\n\n#### 1. Solver Prerequisites\nBefore installing PHONEMeS, please keep in mind the following solver pre-requisites:\n\nPHONEMeS requires the interactive version of IBM Cplex or CBC-COIN solver as the network optimiser. The IBM ILOG Cplex is freely available through Academic Initiative [here](https://www.ibm.com/products/ilog-cplex-optimization-studio?S_PKG=CoG\u0026cm_mmc=Search_Google-_-Data+Science_Data+Science-_-WW_IDA-_-+IBM++CPLEX_Broad_CoG\u0026cm_mmca1=000000RE\u0026cm_mmca2=10000668\u0026cm_mmca7=9041989\u0026cm_mmca8=kwd-412296208719\u0026cm_mmca9=_k_Cj0KCQiAr93gBRDSARIsADvHiOpDUEHgUuzu8fJvf3vmO5rI0axgtaleqdmwk6JRPIDeNcIjgIHMhZIaAiwWEALw_wcB_k_\u0026cm_mmca10=267798126431\u0026cm_mmca11=b\u0026mkwid=_k_Cj0KCQiAr93gBRDSARIsADvHiOpDUEHgUuzu8fJvf3vmO5rI0axgtaleqdmwk6JRPIDeNcIjgIHMhZIaAiwWEALw_wcB_k_|470|135655\u0026cvosrc=ppc.google.%2Bibm%20%2Bcplex\u0026cvo_campaign=000000RE\u0026cvo_crid=267798126431\u0026Matchtype=b\u0026gclid=Cj0KCQiAr93gBRDSARIsADvHiOpDUEHgUuzu8fJvf3vmO5rI0axgtaleqdmwk6JRPIDeNcIjgIHMhZIaAiwWEALw_wcB). The [CBC](https://projects.coin-or.org/Cbc) solver is open source and freely available for any user.\n\nOnce the solvers has been acquired by the user, they must save the executable files in any desired location in the machine they are using and then they can run the PHONEMeS analysis after specifying the solver type (through the *solver* parameter of the functions, 'cplex' or 'cbc') and the path to the executable file (through the *solverPath* parameter).\n\n**NOTE:** We strongly encourage using cplex to solve the PHONEMeS problems since the tool has been mostly maintained by considering CPLEX in mind and also because it showed to be more efficient computationally.\n\n#### 2. Package Depedencies\nAdditionally before installation, the users must install the following R-package depedencies: [BioNet](https://www.bioconductor.org/packages/release/bioc/html/BioNet.html),\n[igraph](https://igraph.org/r/),\n[tidyverse](https://cran.r-project.org/web/packages/tidyverse/index.html),\n[hash](https://cran.r-project.org/web/packages/hash/index.html),\n[dplyr](https://www.rdocumentation.org/packages/dplyr/versions/0.7.8),\n[readxl](https://readxl.tidyverse.org/),\n[readr](https://cran.r-project.org/web/packages/readr/index.html),\n[XML](https://cran.r-project.org/web/packages/XML/index.html),\n[limma](https://bioconductor.org/packages/release/bioc/html/limma.html),\n[OmnipathR](https://github.com/saezlab/OmnipathR),\n\n#### 3. Package installation\nOnce the required solvers have been obtained and the mentioned R-package depedencies have been installed, then the users can proceed with the installation of PHONEMeS [PHONEMeS](https://github.com/saezlab/PHONEMeS).\n\nFor this, the user can install directly from GitHub by using the [devtools](https://www.r-project.org/nosvn/pandoc/devtools.html) package:\n```R\n# Install PHONEMeS from Github using devtools\ninstall.packages('devtools') # in case devtools hasn't been installed\nlibrary(devtools)\ninstall_github('saezlab/PHONEMeS-ILP')\n```\n\nOtherwise users can install PHONEMeS directly from the source after downloading the source (tar file) and typing in ```R``` command line the following:\n\n```R\n# or download the source file from GitHub and install from source\ninstall.packages('path_to_extracted_PHONEMeS_directory', repos = NULL, type=\"source\")\n```\n\n## Running PHONEMeS\n\nThe PHONEMeS library can be initialized by:\n\n```R\nlibrary(PHONEMeS)\n```\n\n### References\n\n[Gjerga et al.](https://pubs.acs.org/doi/abs/10.1021/acs.jproteome.0c00958)\n\n\u003e Enio Gjerga, Aurelian Dugourd, Luis Tobalina, Abel Sousa, and Julio Saez-Rodriguez. PHONEMeS: Efficient Modeling of Signaling Networks Derived from Large-Scale Mass Spectrometry Data. *J. Proteome Res*. 2021, 20, 4, 2138–2144.\n\n[Terfve et al.](http://www.nature.com/articles/ncomms9033):\n\n\u003e Terfve, C. D. A., Wilkes, E. H., Casado, P., Cutillas, P. R., and Saez-Rodriguez, J. (2015). Large-scale models of signal propagation in human cells derived from discovery phosphoproteomic data. *Nature Communications*, 6:8033.\n\n[Wilkes et al.](http://www.pnas.org/content/112/25/7719.abstract) (description of parts of the data)\n\n\u003e Wilkes, E. H., Terfve, C., Gribben, J. G., Saez-Rodriguez, J., and Cutillas, P. R. (2015). Empirical inference of circuitry and plasticity in a kinase signaling network. *Proceedings of the National Academy of Sciences of the United States of America,* 112(25):7719–24.\n\n## Examples\n\n### MTORi and PI3Ki-AKTi-MTORi Perturbation Analysis\n\nHere we show the example from [Terfve et al.](http://www.nature.com/articles/ncomms9033) where PHONEMeS was used to model the perturbation effects of MTOR inhibition. \n\nWe start first by loading the required packages and the necessary PHONEMeS inputs:\n\n```R\n# Load packages\nlibrary(PHONEMeS)\nlibrary(BioNet)\nlibrary(igraph)\nlibrary(hash)\nlibrary(dplyr)\nlibrary(readxl)\nlibrary(readr)\nlibrary(XML)\n\n# Loading database and data-object\nload(file = system.file(\"NetworKIN_noCSK_filt.RData\", package=\"PHONEMeS\"))\nload(file = system.file(\"inputObj_Terfve.RData\", package=\"PHONEMeS\"))\n\n```\n\nScripts of how the inputs for this case-study have been provided [here](https://github.com/saezlab/PHONEMeS/tree/afd672ecadd0c4b72ffd41416bd3fb897b46a31b/Example/Example_MainData). These scripts are part of the [Release 1.0](https://github.com/saezlab/PHONEMeS/releases/tag/v1.0.0).\n\nNext we prepare the data objwcts which will be used as an input by PHONEMeS.\n\n```R\n# Preparation of the background network from the allD list of K/P-S interactions\nbg\u003c-new(\"KPSbg\", interactions=allD, species=unique(c(allD$K.ID, allD$S.cc)))\n\n# Creating the list where we show the experimental conditions\nconditions \u003c- list(c(\"AKT1 - Control\", \"AKT2 - Control\"), c(\"CAMK1 - Control\", \"CAMK2 - Control\"),\n                   c(\"EGFR1 - Control\", \"EGFR2 - Control\"), c(\"ERK1 - Control\", \"ERK2 - Control\"),\n                   c(\"MEK1 - Control\", \"MEK2 - Control\"), c(\"MTOR1 - Control\", \"MTOR2 - Control\"),\n                   c(\"P70S6K1 - Control\", \"P70S6K2 - Control\"), c(\"PI3K1 - Control\", \"PI3K2 - Control\"),\n                   c(\"PKC1 - Control\", \"PKC2 - Control\"), c(\"ROCK1 - Control\", \"ROCK2 - Control\"))\n\nnames(conditions) \u003c- c(\"AKT1_HUMAN\", \"KCC2D_HUMAN\", \"EGFR_HUMAN\", \"MK01_HUMAN\",\n                       \"MP2K1_HUMAN\", \"MTOR_HUMAN\",  \"KS6B1_HUMAN\", \"PK3CA_HUMAN\",\n                       \"KPCA_HUMAN\", \"ROCK1_HUMAN\")\n\n# For each experimental condition we assign a perturbation target\ntargets.P\u003c-list(cond1=c(\"AKT1_HUMAN\", \"AKT2_HUMAN\"), cond2=c(\"KCC2A_HUMAN\", \"KCC2B_HUMAN\", \"KCC2C_HUMAN\", \"KCC2D_HUMAN\"), cond3=c(\"EGFR_HUMAN\", \"ERBB2_HUMAN\"), \n                cond4=c(\"MK01_HUMAN\", \"MK03_HUMAN\", \"MK14_HUMAN\"), cond5=c(\"MP2K1_HUMAN\", \"MP2K2_HUMAN\"), cond6=c(\"MTOR_HUMAN\"), cond7=c(\"KS6B1_HUMAN\", \"KS6B2_HUMAN\"), \n                cond8=c(\"PK3CA_HUMAN\", \"PK3CD_HUMAN\", \"MTOR_HUMAN\"), cond9=c(\"KPCA_HUMAN\", \"KPCB_HUMAN\", \"KPCG_HUMAN\", \"KPCE_HUMAN\"), cond10=c(\"ROCK1_HUMAN\", \"ROCK2_HUMAN\"))\n\n```\n\nThen finally we perform the PHONEMeS analysis for the MTOR inhibition experiment (condition 6).\n\n**Attention:** Here the user must additionally provide the path to the executable CPLEX or CBC solver after having obtained the license and downloaded them. The path must be set on the ```solverPath``` variable (i.e. ```solverPath = \"~/Documents/cplex\"```, if the user wishes to use the *cplex* executable which he saved in the *Documents* direcotry; default: ```solverPath = \"/usr/bin/cplex\"```).\n\n```R\n# Select experimental condition\nexperiments \u003c- c(6) # for MTORi case\n\n# Running PHONEMeS - cplex\n# Run PHONEMeS providing one solution from CPLEX (nSolutions = 1)\nresultsSingle \u003c- runPHONEMeS(targets.P = targets.P, conditions = conditions, inputObj = inputObj, experiments = experiments, bg = bg, solver = \"cplex\", nSolutions = 1, nK = \"no\", solverPath = path_to_executable_solver)\nwrite.table(x = resultsSingle, file = \"MTORi_sif_cplex_single.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\n\n# Run PHONEMeS with multiple solutions from CPLEX (nSolutions = 100)\nresultsMulti \u003c- runPHONEMeS(targets.P = targets.P, conditions = conditions, inputObj = inputObj, experiments = experiments, bg = bg, solver = \"cplex\", nSolutions = 100, nK = \"no\", solverPath = path_to_executable_solver)\nwrite.table(x = resultsMulti, file = \"MTORi_sif_cplex_multiple.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\n\nnodesAttributes \u003c- assignAttributes(sif = resultsMulti, inputObj = inputObj, targets = targets.P[experiments], writeAttr = TRUE)\n\n```\n\nFor running PHONEMeS by considering multiple conditions we can consider the case where we wish to retrieve consensus network solutions for when combining evidences from the PI3Ki-AKTi-MTORi inhibition experimental conditions. This analysis can be performed either by requesting multiple solutions directly from the CPLEX options or by performing PHONEMeS analysis multiple times by randomly downsampling the measurements and retrieving one solution for each iteration. These single solutions are then integrated into a combined network. With increasing number of experimental conditions, the number of possible solutions is expected to increase substantially and the Downsampling porcedure is advised to be used for these situations since it integrates single solutions in a more unbiased manner and the integrated network is sparser.\n\n**Attention:** Here the user must additionally provide the path to the executable CPLEX or CBC solver after having obtained the license and downloaded them. The path must be set on the ```solverPath``` variable (i.e. ```solverPath = \"~/Documents/cplex\"```, if the user wishes to use the *cplex* executable which he saved in the *Documents* direcotry; default: ```solverPath = \"/usr/bin/cplex\"```).\n\n```R\n# Select experimental condition\nexperiments \u003c- c(1, 6, 8) # for PI3Ki-AKTi-MTORi case\n\n# Running PHONEMeS - cplex\n# Run PHONEMeS with multiple solutions from CPLEX\nresultsMulti \u003c- runPHONEMeS(targets.P = targets.P, conditions = conditions, inputObj = inputObj, experiments = experiments, bg = bg, solver = \"cplex\", nSolutions = 100, nK = \"no\", populate = 100, solverPath = path_to_executable_solver)\nwrite.table(x = resultsMulti, file = \"PI3Ki_AKTi_MTORi_sif_cplex.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\nresultsMulti \u003c- runPHONEMeS_Downsampling(targets.P = targets.P, conditions = conditions, inputObj = inputObj, experiments = experiments, bg = bg, nIter = 100, nK = \"no\")\nwrite.table(x = resultsMulti, file = \"PI3Ki_AKTi_MTORi_sif_downsampling.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\n\nnodesAttributes \u003c- assignAttributes(sif = resultsMulti, inputObj = inputObj, targets = targets.P[experiments], writeAttr = TRUE)\n\n```\n\n### Time-Point Analysis for the Modelling of Endothelin Signalling\n\nHere we show an example about how to perform PHONEMeS analsysis over phosphoproteomics time-course data. The example refers to the study from [Schaefer et al. 2019](https://www.embopress.org/doi/full/10.15252/msb.20198828). The PHONEMeS inputs used for this example have been prepared as described in detail in the separate [dedicated github repository](https://github.com/saezlab/EDN_phospho) of this study.\n\nWe start first by loading the required packages and the necessary PHONEMeS inputs for this example:\n\n```R\n# Load packages\nlibrary(PHONEMeS)\nlibrary(BioNet)\nlibrary(igraph)\nlibrary(hash)\nlibrary(dplyr)\nlibrary(readxl)\nlibrary(readr)\nlibrary(XML)\n\n# Loading database and data-object\nload(file = system.file(\"interactions_schaefer.RData\", package=\"PHONEMeS\"))\nload(file = system.file(\"dataUACC257.RData\", package=\"PHONEMeS\"))\n\n```\n\nNext we prepare the data objwcts which will be used as an input by PHONEMeS.\n\n```R\n# Preparing background network as a PHONEMeS input\nbg\u003c-new(\"KPSbg\", interactions=allD, species=unique(c(allD$K.ID, allD$S.cc)))\ndataInput\u003c-new(\"GMMres\", res=GMM, IDmap=GMM.ID, resFC=GMM.wFC)\n\n# Choose the conditions for each time-point\nconditions \u003c- list(c(\"tp_2min\"), c(\"tp_10min\"), c(\"tp_30min\"), c(\"tp_60min\"), c(\"tp_90min\"))\nnames(conditions) \u003c- c(\"tp_2min\", \"tp_10min\", \"tp_30min\", \"tp_60min\", \"tp_90min\")\n\n# Choose the targets for each time-point (EDNRB - the same)\ntargets.P \u003c- list(tp_2min=c(\"EDNRB_HUMAN\"), tp_10min=c(\"EDNRB_HUMAN\"), tp_30min=c(\"EDNRB_HUMAN\"), tp_60min=c(\"EDNRB_HUMAN\"), tp_90min=c(\"EDNRB_HUMAN\"))\n\n# Next we assign the experimental conditions from which we get the measurements at each specific time-point\n# In this case we have the same one experimental condition for each time-point\nexperiments \u003c- list(tp1=c(1), tp2=c(2), tp3=c(3), tp4=c(4), tp5=c(5))\n\n```\n\nNext we perform the PHONEMeS analysis to obtain the time-course modelling of signalling. We perform this analysis 100 times where for each iteration we retain a random sample of measurements. Each solution at each iteration contains one time-course signalling model which in the end is then combined into one integrated network.\n\n**Attention:** Here the user must additionally provide the path to the executable CPLEX or CBC solver after having obtained the license and downloaded them. The path must be set on the ```solverPath``` variable (i.e. ```solverPath = \"~/Documents/cplex\"```, if the user wishes to use the *cplex* executable which he saved in the *Documents* direcotry; default: ```solverPath = \"/usr/bin/cplex\"```).\n\n```R\n# Running multiple time-point variant of PHONEMeS and retain only those interactions which have a weight higher than 20/appear at least 20 times in the\n# separate solutions we have obtained out of the 100 runs we have set to perform (nIter=100).\nset.seed(383789)\nresultsMulti = runPHONEMeS_mult(targets.P = targets.P, conditions = conditions, inputObj = dataInput, experiments = experiments, bg = bg, nIter = 100, solverPath = path_to_executable_solver)\nnodeAttribudes \u003c- assignAttributes(sif = resultsMulti[, c(1, 2, 4)], inputObj = dataInput, targets = targets.P, writeAttr = FALSE)\n\nwrite.table(x = resultsMulti, file = \"ednrb_network.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\nwrite.table(x = resultsMulti[which(as.numeric(resultsMulti[, 2])\u003e=20), ], file = \"ednrb_network_20.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\nwrite.table(x = nodeAttribudes, file = \"ednrb_attributes.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\n\n```\n\n### PHONEMeS Upside-Down Analysis\n\nAs always, we start first by loading the required packages and the necessary PHONEMeS inputs for this example:\n```R\n# Load packages\nlibrary(PHONEMeS)\nlibrary(BioNet)\nlibrary(igraph)\nlibrary(hash)\nlibrary(dplyr)\nlibrary(readxl)\nlibrary(readr)\nlibrary(limma)\nlibrary(OmnipathR)\nlibrary(XML)\n\n# Load data\nload(file = system.file(\"colon_cancer_data.RData\", package=\"PHONEMeS\"))\nload(file = system.file(\"colon_cancer_kinase_activities.RData\", package=\"PHONEMeS\"))\n\n```\n\nFrom the Colon Cancer data we perform a differential analysis to estimate differentially regulated phospho-sites between the tumour and health samples. For that we rely on the [Limma R-Package](https://bioconductor.org/packages/release/bioc/html/limma.html) and the built-in PHONEMeS functions specifically designed for this purpose.\n\n```R\n# Differential analysis with Limma\n\n# Defining targets\ntargets \u003c- matrix(data = , nrow = ncol(colon_cancer_data), ncol = 2)\ntargets[, 1] \u003c- colnames(colon_cancer_data)\ntargets[, 2] \u003c- sapply(strsplit(x = colnames(colon_cancer_data), split = \"_\", fixed = TRUE), \"[[\", 1)\ncolnames(targets) \u003c- c(\"sample\", \"condition\")\ntargets \u003c- as.data.frame(targets)\ntargets$sample \u003c- as.character(targets$sample)\ntargets$condition \u003c- as.character(targets$condition)\n\n# Performing the differential analysis\nlimmaRes \u003c- runLimma(measurements = colon_cancer_data, targets = targets, comparisons = list(c(1, -2))) # tumor vs healthy\nttop \u003c- topTable(fit = limmaRes[[1]], coef = 1, number = nrow(colon_cancer_data), adjust.method = \"fdr\")\nttop$ID \u003c- rownames(ttop)\n\n# Generating the table-top object from the Limma analysis result\nttopList \u003c- list()\nttopList[[length(ttopList)+1]] \u003c- ttop\nnames(ttopList) \u003c- \"tumour_vs_healthy\"\n\n```\n\nResults from Limma can then be used to build the data-input object of PHONEMeS as below. Here we identify as significant those measurements with an\nabsolute *log2FC* threshold higher than 2 and adjusted p-value significance lower than 0.01.\n\n```R\n# Build PHONEMeS data-input object\ndataInput \u003c- buildInputs(tableTopList = ttopList, fcThresh = log2(2.5), pThresh = 0.05, idxID = 7, idxFC = 1, \n                         idxPval = 5, namesConditions = c(\"tumour_vs_healthy\"))\n\n```\n\nPHONEMeS also needs a set Kinase/Phosphatase-Substrate to be used as a prior knowledge network-input which we train to the data. For that we can rely on OmniPath, and for PHONEMeS such a PKN can be built as follows (via the [OmnipathR R-package](https://github.com/saezlab/OmnipathR)):\n\n```R\n# Obtaining the PTMS relations online from OmnipathR package and retaining only phosphorylation/dephosphorylation modifications\nptms \u003c- get_signed_ptms()\nptms \u003c- ptms[which(ptms$modification%in%c(\"phosphorylation\", \"dephosphorylation\")), ]\n\n# Initializing an empty PKN for PHONEMEeS\nbn \u003c- matrix(data = , nrow = nrow(ptms), ncol = 8)\ncolnames(bn) \u003c- c(\"S.AC\", \"S.ID\", \"K.AC\", \"K.ID\", \"res\", \"pos\", \"SID\", \"S.cc\")\n\n# Filling the initialized PKN with information from OmniPath\nbn[, 1] \u003c- ptms$substrate_genesymbol\nbn[, 2] \u003c- ptms$substrate_genesymbol\nbn[, 3] \u003c- ptms$enzyme_genesymbol\nbn[, 4] \u003c- ptms$enzyme_genesymbol\nbn[, 5] \u003c- ptms$residue_type\nbn[, 6] \u003c- ptms$residue_offset\nbn[, 7] \u003c- paste0(\"e\", 1:nrow(bn))\nbn[, 8] \u003c- paste0(ptms$substrate_genesymbol, \"_\", ptms$residue_type, ptms$residue_offset)\n\n# Making the PKN as a data-frame object\nallD \u003c- as.data.frame(bn)\nallD$S.AC \u003c- as.character(allD$S.AC)\nallD$S.ID \u003c- as.character(allD$S.ID)\nallD$K.AC \u003c- as.character(allD$K.AC)\nallD$K.ID \u003c- as.character(allD$K.ID)\nallD$res \u003c- as.character(allD$res)\nallD$pos \u003c- as.character(allD$pos)\nallD$SID \u003c- paste0(\"e\", 1:nrow(allD))\nallD$S.cc \u003c- as.character(allD$S.cc)\n\n```\n\nNow preparing the other inputs for PHONEMeS and also selecting the most regulated kinases based on kinase enrichment analysis results (with absolute kinase activities higher than 12).\n\n```R\n# Identifying top most regulated kinases\ntargetKinases \u003c- kinase_activities$kinase[which(abs(kinase_activities$activity)\u003e=12)]\n\n# Preparation of the background network from the allD list of K/P-S interactions\nbg\u003c-new(\"KPSbg\", interactions=allD, species=unique(c(allD$K.ID, allD$S.cc)))\n\n# Creating the list where we show the experimental conditions\nconditions \u003c- list(c(\"tumour_vs_healthy\"))\n\nnames(conditions) \u003c- c(\"tumour_vs_healthy\")\n\n# For each experimental condition we assign a perturbation target\ntargets.P\u003c-list(tumour_vs_healthy=targetKinases)\n\n# Select experimental condition\nexperiments \u003c- c(1)\n\n```\n\nFinally running the upside-down variant of PHONEMeS and saving the network results. The ```phonemes_ud``` output on this case will consist of a list of three objects: the downside network solution, the upside network solution as well as the combined network solution which integrates the two. These results can then be saved as matrices in a *txt* format which can then be used to visualize the network graph solutions.\n\n**Attention:** Here the user must additionally provide the path to the executable CPLEX or CBC solver after having obtained the license and downloaded them. The path must be set on the ```solverPath``` variable (i.e. ```solverPath = \"~/Documents/cplex\"```, if the user wishes to use the *cplex* executable which he saved in the *Documents* direcotry; default: ```solverPath = \"/usr/bin/cplex\"```).\n\n```R\nphonemes_ud \u003c- runPHONEMeS_UD(targets.P = targets.P, conditions = conditions, inputObj = dataInput, experiments = experiments, \n                              bg = bg, solverPath = path_to_executable_solver)\n\nwrite.table(x = phonemes_ud$Downside, file = \"phonemes_ud_down.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\nwrite.table(x = phonemes_ud$Upside, file = \"phonemes_ud_up.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\nwrite.table(x = phonemes_ud$Combined, file = \"phonemes_ud_combined.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\n\nnodesAttributes \u003c- assignAttributes(sif = phonemes_ud$Combined, inputObj = dataInput, targets = targets.P)\nwrite.table(x = nodesAttributes, file = \"nodes_attributes.txt\", quote = FALSE, sep = \"\\t\", row.names = FALSE, col.names = TRUE)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaezlab%2Fphonemes-ilp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaezlab%2Fphonemes-ilp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaezlab%2Fphonemes-ilp/lists"}