https://github.com/cbg-ethz/pcnem

https://github.com/cbg-ethz/pcnem

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: cbg-ethz
  • License: other
  • Language: R
  • Default Branch: master
  • Size: 5.99 MB
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 8 years ago · Last pushed over 6 years ago
Metadata Files
Readme License

README.md

pcNEM

Probabilistic combinatorial nested effects model (pc-NEM), is a variant of NEM, which probabilistically models the perturbations for network reconstruction from combinatorial gene knockdown data. The model and the inference algorithm are implemented as part of the R/Bioconductor package nem.

Installation with devtools

install.packages("devtools") library(devtools) install_github("cbg-ethz/pcNEM")

Running pc-NEM ###

A small toy example with 6 S-genes, 6 knockdown experiments, and 90 E-genes. First, we sample a random network and then generate a perturbation map with on-target probabilities set to 0.8 and off-target probabilities set to 0.2. Next, we simulate data using the network and the perturbation map with FPR = 0.05 and FNR = 0.01. Once we have simulated the data, we use pc-NEM to learn the network and noise parameters. ``` library(pcnem) library(Rgraphviz)

set.seed(42)

Sample a toy network with N S-genes and M E-genes

N <- 6 M <- 90 Sgenes <- paste0("S", 1:N) Phi <- pcnem:::sampleRndNetwork(Sgenes = Sgenes, trans.close = TRUE)

Generate knockout map with one experiment for each Sgene

KOmap <- matrix(0, nrow = N, ncol = N ) rownames(KOmap) <- paste0("K", 1:N) colnames(KOmap) <- Sgenes

On target probabilities set to 0.8 in this example

diag(KOmap) <- 0.8

Off-target probabilities set to 0.2 in this example

KOmap[sample(1:N^2, 4)] <- 0.2

Generating data

alpha <- 0.05 beta <- 0.01 D <- pcnem:::sampleData.pcnem(Phi = Phi, M = M, map = KOmap, typeI.err = alpha, typeII.err = beta)$D

Setting all the control parameters and runnin pc-nem

control <- set.default.parameters(unique(colnames(D)), type = "mLL", pcombi = TRUE, trans.close = FALSE) control$map <- as.matrix(KOmap) control$iterations <- 10000 pcnem_mle <- nem(D, inference = "AdaSimAnneal", control = control, verbose = FALSE)

True network likelihood

control$para <- c(alpha,beta) true_mle <- nem(D, inference = "search", control = control, verbose = FALSE, models = list(Phi))

Plotting true and inferred network

par(mfrow = c(1,2)) plot(as(Phi, "graphNEL"), main = "True network") plot(pcnem_mle$graph, main = "MLE graph")

Estimated noise

cat("Estimated type I error:", pcnemmle$typeIEst, "\n") cat("Estimated type II error:", pcnemmle$typeIIEst)

``` The FNR is slightly underestimated due to finite sample size from small number of experiments and effects in this example.

pc-NEM parameters

You can tune several hyperparameters for your case using the set.default.parameters() function.

pcombi : Logical parameter set to TRUE for pc-NEM. Default set to FALSE.
temper : Binary parameter to choose between two variant implementations of adaptive simulated annealing. FALSE corresponds to adaptation of temperatures at varying intervals but cooled at a fixed rate. TRUE corresponds to the scheme described in the paper. Both are very similar in performance. Default is set to FALSE.
iterations : Number of iterations for adaptive simulated annealing (ASA). Deafult is 2e4.
stepsave : The length of intervals to adapt tempertature and noise. Default is 1e2.
revallowed : Binary parameter for including reversal moves. Default allows reversals and is set to 1.
AcceptRate : The ideal acceptance rate for ASA.
Temp : Initial temperature. Default is 50.
AdaptRate : Rate of adaptation of temperature. Default is 0.3.
noiseEst : Binary parameter to include estimation of noise parameters. Default is TRUE.
moveprobs : Probability of moving between DAG space and noise space if noiseEst = TRUE. Default = c(0.6,0.4).
moveprobsNoise : Probability of moving between alpa and beta space for noise estimation. Default = c(0.5,0.5).
sigma : Initial covariance matrix for noise estimation.

Contact

Sumana Srivatsa
sumana.srivatsa (at) bsse.ethz.ch

Owner

  • Name: Computational Biology Group (CBG)
  • Login: cbg-ethz
  • Kind: organization
  • Location: Basel, Switzerland

Beerenwinkel Lab at ETH Zurich

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels