{"id":24528995,"url":"https://github.com/saezlab/cnorprob","last_synced_at":"2025-03-15T17:44:45.319Z","repository":{"id":77872539,"uuid":"111784465","full_name":"saezlab/CNORprob","owner":"saezlab","description":"Probabilistic logic version of CellNOpt (derived from FALCON)","archived":false,"fork":false,"pushed_at":"2019-04-20T22:33:37.000Z","size":1346,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T07:37:34.697Z","etag":null,"topics":["knockout-bootstrap","logic","optimization-tools","probabilistic-models","r","sensitivity-analysis"],"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,"governance":null}},"created_at":"2017-11-23T08:40:37.000Z","updated_at":"2020-09-23T20:49:19.000Z","dependencies_parsed_at":"2023-09-06T23:30:37.730Z","dependency_job_id":null,"html_url":"https://github.com/saezlab/CNORprob","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%2FCNORprob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FCNORprob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FCNORprob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saezlab%2FCNORprob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saezlab","download_url":"https://codeload.github.com/saezlab/CNORprob/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243769947,"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":["knockout-bootstrap","logic","optimization-tools","probabilistic-models","r","sensitivity-analysis"],"created_at":"2025-01-22T07:34:20.884Z","updated_at":"2025-03-15T17:44:45.296Z","avatar_url":"https://github.com/saezlab.png","language":"R","readme":"# CNORprob\n\nThis is a probabilistic logic variant of [CellNOpt](https://www.bioconductor.org/packages/release/bioc/html/CNORode.html) which allows for quantitative optimisation of logical network for (quasi-)steady-state data. The core optimisation pipeline is derived from [FALCON](https://github.com/sysbiolux/FALCON): a toolbox for the fast contextualization of logical networks.\n\nCNORprob takes prior knowledge network and experimental data in SIF and MIDAS formats, respectively, and it outputs graphical representation of results in CellNOpt's format. Post-optimisation analyses including systematic edge-knockout, systematic node-knockout, bootstrapping and local parameter sensitivity analyses (LPSA) were also included in the pipeline as offered in the original FALCON toolbox. \n\n## Getting Started\n\nA vignette of CNORprob is provided in the 'vignette' folder which could either be used as a Driver script to run the pipeline step-by-step or to simply generate the whole results with Knit(r). A condensed set of optmisation settings are listed at the beginning of the vignette for users' convenience.\n\n### Prerequisites\n\nCNORprob requires prior installation of the \"CellNOptR\" package (install either from Bioconductor or GitHub page via devtools). It also requires the \"Rsolnp\" packages as the optimisation algorithm as well as \"R.utils\" to call for some related functions. Please run the following commands at the beginning of the vignette to perform the installation.\n\n```R\n# Install required packages (if were not previously installed)\n# CellNOptR\nif (!requireNamespace(\"BiocManager\", quietly = TRUE))\n    install.packages(\"BiocManager\")\nBiocManager::install(\"CellNOptR\", version = \"3.8\")\n# --- OR ---\n# install.packages('devtools') # in case devtools hasn't been installed\nlibrary(devtools)\ninstall_github('saezlab/CellNOptR', force=TRUE)\n\n# Rsolnp and R.utils\ninstall.packages(\"Rsolnp\") # optimisation algorithm\ninstall.packages(\"R.utils\") # Timeout control\n```\n\n### Installing\n\nCNORprob is currently available for the installation as an R-package from our GitHub page\n\n```R\n# Install CNORprob from Github (or load library for development version)\n# install.packages('devtools') # in case devtools hasn't been installed\nlibrary(devtools)\ninstall_github('saezlab/CNORprob') # Doesn't work currently as the repository is still private\n# or download the source file from GitHub and install from source\ninstall.packages('path_to_extracted_CNORprob_directory', repos = NULL, type=\"source\")\n```\n\n## Running the tests\n\nSeveral examples are available as the test case for CNORprob. Users can select the examples by assigning the example number to the \"Selected_Model\" variable. Current examples include: \n1) CNOToy (the running example of the CellNOpt package)\n2) FALCON pipeline example, see [paper](https://academic.oup.com/bioinformatics/article/33/21/3431/3897376)\n3) PDGF (dissecting PDGF signalling in Gastrointestinal Stromal Tumour - GIST), see [paper](http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0156223)\n4) L-plastin (investigating L-plastin activating signalling pathways in breast cancer cell lines), see [paper](http://www.fasebj.org/content/30/3/1218.long)\n\n```R\n# Load required packages\nlibrary(CNORprob)\nlibrary(CellNOptR) # for loading network/data and pre-processing\nlibrary(Rsolnp) # optimisation algorithm\nlibrary(R.utils) # timeout control\n\n# Select CNORprob example\n# 1 = CNO-Toy, 2 = FALCON-Ex, 3 = PDGF, 4 = L-plastin\nCNORprob_Example \u003c- 1\nCNORprob_inputs \u003c- loadExample_Prob(CNORprob_Example = CNORprob_Example)\noptmodel \u003c- CNORprob_inputs$optmodel\noptCNOlist \u003c- CNORprob_inputs$optCNOlist\n```\n\n### Setting and options for optimisation and subsequent analyses \n\nA set of optimisation parameters can be assigned at the beginning of the vignette. Several options can be chosen for the printing of intermedate results and the extraction of the final results. In the post optimisation analyses section, users can define which types of analysis, how many rounds (as well as the number of parameters' increment for LPSA) to perform.\n\n```R\n# Assign optimisation and parameter settings\noptRound_optim    \u003c- 3        # rounds of optimisation\nL1Reg             \u003c- 1e-4     # assign weight for L1-regularisation\nMaxTime           \u003c- 180      # time for each round of optimisation [seconds]\nHLbound           \u003c- 0.5      # cut-off for high and low weights\nSSthresh          \u003c- 2e-16    # cut-off for states' difference at steady-state\nprintCost         \u003c- 0        # print or not print intermediate fitting cost [0,1]\nPlotIterations    \u003c- 1        # rounds of optimisation to generate plots\nSaveOptResults    \u003c- TRUE     # [TRUE,FALSE] generate reports from optimisation\n\n# Optimiser (rsolnp) options/control list (see rsolnp vignette: https://cran.r-project.org/web/packages/Rsolnp/Rsolnp.pdf)\nrho               \u003c- 1        # penalty weighting scaler / default = 1\nouter.iter        \u003c- 100       # maximum major iterations / default = 400\ninner.iter        \u003c- 100       # maximum minor iterations / default = 800\ndelta             \u003c- 1e-7     # relative step size eval. / default = 1e-7\ntol               \u003c- 1e-8     # relative tol. for optim. / default = 1e-8\ntrace             \u003c- 1        # print objfunc every iter / default = 1\n\n# Post-optimisation analysis\nAnalyses          \u003c- c(T,T,T,T) # [F,T] edge knockout, node knockout, sensitivity analysis\noptRound_analysis \u003c- 1        # rounds of optmisation in each analysis\nLPSA_Increments   \u003c- 2        # number of increments in LPSA analysis\nBS_Type           \u003c- 1        # Type of Bootstrapping [1=resample with replacement from residual; 2=resampling from mean \u0026 variant]\nBS_Round          \u003c- 5       # number of rounds for bootstrapping\n```\n\nSubsequent to these assignments, users can run the vignette using Knit to generate a HTML report from the pipeline. In this case, the results from the optimisation and subsequent analyses will be saved in the sub-folder \"Results\" within the \"vignette\" directory. Alternatively, users can also proceed further with manual execution of the pipeline on R-console as outlined below.\n\n### Optimisation\n\nPrior to the optimisation, model and experimental descriptions together with optimisation parameters are combined into an optimisation object 'estim', then the optimisation can be performed.\n\n```R\nestim_Result   \u003c\u003c- list() # Initialise global variable of results\nrsolnp_options  \u003c- list(rho=rho,outer.iter=outer.iter,inner.iter=inner.iter,delta=delta,tol=tol,trace=trace) # Collapase optimisation options\n\n# Generate optimisation object\nestim \u003c- CNORprob_buildModel(optCNOlist,optmodel,expandOR=CNORprob_inputs$ProbExpandOR,ORlist=CNORprob_inputs$ORlist,HardConstraint=CNORprob_inputs$ProbHardConstraint,Force=CNORprob_inputs$ProbForce,L1Reg=L1Reg,HLbound=HLbound,SSthresh=SSthresh,PlotIterations=PlotIterations,rsolnp_options=rsolnp_options)\n\n# Run Optimisation\nestim$maxtime \u003c- MaxTime; estim$printCost \u003c- printCost\nestim$optimOptions \u003c- c(rho,outer.iter,inner.iter,delta,tol,trace)\nres \u003c- CNORprob_optimise(estim,optRound_optim,SaveOptResults)\n```\n\n### Plot results and post-optimisation analyses\n\nThe results from CNORprob are stored in the 'res' variable and can be used to plot resulting figures (compare fitting quality and fitted network with weights on edges).\n\n```R\n# Plot results\nCNORprob_plotFit(optmodel,optCNOlist,estim,res,show=TRUE, plotPDF=TRUE, tag=NULL, plotParams=list(cex=0.8, cmap_scale=1, ymin=0))\nMappedProb \u003c- CNORprob_mapModel(optmodel,optCNOlist,estim,res)\npdf(\"Results/Figures/Optimised_CNORprob_Model.pdf\")\nplotModel(MappedProb$model,MappedProb$CNOlist,round(MappedProb$bString,digits=2))\ndev.off()\n```\n\nIn addition, the 'res' variable can also be passed to run post-optimisation analyses i.e. local parameter sensitivity analysis (LPSA), edge/edge knockout and boot-strapping analysis. Results of plotting and post-optimisation analyses will be stored in the \"Results\" folder.\n\n```R\n# Post-optimisation analyses\nestim$ProbCompression \u003c- CNORprob_inputs$ProbCompression\nestim$ProbCutNONC \u003c- CNORprob_inputs$ProbCutNONC\nestim$ProbExpandOR \u003c- CNORprob_inputs$ProbExpandOR\nestim$optRound_analysis \u003c- optRound_analysis\nestim_original \u003c- estim\nestim_based \u003c- estim_original; if (Analyses[1]) { estim_Result  \u003c- CNORprob_edgeKO(optmodel,optCNOlist,estim_based,res) }\nestim_based \u003c- estim_original; if (Analyses[2]) { estim_Result  \u003c- CNORprob_nodeKO(optmodel,optCNOlist,estim_based,res) }\nestim_based \u003c- estim_original; if (Analyses[3]) { estim_Result  \u003c- CNORprob_LPSA(estim_based,res,HLbound,LPSA_Increments,Force=F) }\nestim_based \u003c- estim_original; if (Analyses[4]) { estim_Result  \u003c- CNORprob_BS(optmodel,optCNOlist,estim_based,res,BS_Type,BS_Round) }\n\nsave(estim_Result,file=\"Results/CNORprob_PostHocResults.Rdata\")\n```\n\n### Manual assignment of input files \u0026 additonal/special assignments in CNORprob\n\nIn case users would like to use own prior knowledge network (PKN) and experimental data which are in the MIDAS format (please refer to the original documentation of the CellNOptR package and publication), users could the following codes to manually assign the input files which will then converted into model and data in the CellNOpt format.\n\n```R\n# Manual assignment of network (PKN) and experimental data (MIDAS) files\npknmodel \u003c- readSIF('path_to_your_PKN_model_here') # build a prior-knowledge network from SIF file\nCNOlist \u003c- CNOlist('path_to_your_MIDAS_data_here') # import experimental data from MIDAS file\n``` \n\nApart from applying the default setting as used in CNORprob examples, users can also assign additional features e.g. the preprocessing of prior knowledge network (please refer to the documentation of CellNOpt for more detail) as well as the network constraint.\n\n\"CNORprob_buildModel\" provide 4 additional variables: \n1) \"expandOR\" refers to the expansion of the OR gate which it was not assigned from the initial list. \n2) \"ORlist\" refers to the introduction of specific OR relationship for specific interaction e.g. 'Grb2SoS_OR_GabSOS=GGSOS' for PDGF model. \n3) \"HardConstraint\" refers to the assignment that the sum of all weights/probabilities for all incoming activation reactions to be 1 (might be too strict for some cases). \n4) \"Force\" refers to the assignment of weight/probability for a single activated to always be 1 (might also be too strict for several cases).\n\n```R\n# Assign CNORprob-specitifc parameters for pre-processing step\nProbCompression \u003c- F;ProbCutNONC \u003c- F; ProbExpandOR \u003c- F; ProbHardConstraint \u003c- F; ProbForce \u003c- F # Default (most-relaxed) setting \n\n# Run CNORprob-specific pre-processing (expansion=FALSE by default and report)\nModDatppProb \u003c- preprocessing_Prob(CNOlist, pknmodel, expansion=FALSE,\n                                     compression=ProbCompression, cutNONC=ProbCutNONC,\n                                     verbose=FALSE) \noptmodel \u003c- ModDatppProb$cutModel\noptCNOlist \u003c- ModDatppProb$data\n``` \n\nThe variables 'optmodel' and 'optCNOlist' could then be passed into the optimisation pipeline to generate results as outlined above (start from the 'Optimisation' section).\n\nAlternatively, CNORprob also offer a one-line wrapper function 'runCNORprob' where users can either call CNORprob examples or use own PKN and experimental data as follows:\n\n```R\n# Call from CNORprob examples\nres \u003c- runCNORprob(CNORprob_Example = 1) # Please also see all adjustable parameters in the help file of the function\n\n# Call from input files (here CNORprob example 2 is used as an example \nfile.copy(from=system.file(\"FALCON_Ex1_Model.sif\",package=\"CNORprob\"),to=getwd(),overwrite=TRUE) # retrieve network file\nfile.copy(from=system.file(\"FALCON_Ex1_Exp.csv\",package=\"CNORprob\"),to=getwd(),overwrite=TRUE) # retrieve measurement file\nres \u003c- runCNORprob(model=\"FALCON_Ex1_Model.sif\",data = \"FALCON_Ex1_Exp.csv\",CNORprob_Example = NULL)\n``` \n\n## Authors\n\nPanuwat Trairatphisan (panuwat.trairatphisan -at - gmail.com)\n\nSee also the list of [contributors](https://github.com/saezlab/CNORprob/contributors) who participated in this project.\n\n## License\n\nDistributed under the GNU GPLv3 License. See accompanying file [LICENSE.txt](https://github.com/saezlab/combiMS/blob/master/LICENSE.txt) or copy at [http://www.gnu.org/licenses/gpl-3.0.html](http://www.gnu.org/licenses/gpl-3.0.html).\n\n## References\n\n[De Landtsheer et al.](https://academic.oup.com/bioinformatics/article/33/21/3431/3897376):\n\n\u003e De Landtsheer S, Trairatphisan P, Lucarelli P, and Sauter, T. (2017). FALCON: a toolbox for the fast contextualization of logical networksa. *Bioinformatics*, Volume 33, Issue 21, 1 November 2017, Pages 3431–3436, https://doi.org/10.1093/bioinformatics/btx380.\n\n## Acknowledgement\n\nCNORprob have been developed for the modelling projects within the [TransQST Consortium](https://transqst.org)\n\n\"This project has received funding from the Innovative Medicines Initiative 2 Joint Undertaking under grant agreement No 116030. The Joint Undertaking receives support from the European Union's Horizon 2020 research and innovation programme and EFPIA.\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaezlab%2Fcnorprob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaezlab%2Fcnorprob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaezlab%2Fcnorprob/lists"}