Skip to content

Commit

Permalink
extended help file descriptions and vignette
Browse files Browse the repository at this point in the history
minor bugfixing for k=1
  • Loading branch information
MartinFXP committed Aug 16, 2018
1 parent 17321b0 commit 4afec7e
Show file tree
Hide file tree
Showing 15 changed files with 808 additions and 449 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: mnem
Type: Package
Title: mnem
Version: 0.99.5
Title: Mixture Nested Effects Models
Version: 0.99.6
Author: Martin Pirkl
Maintainer: Martin Pirkl <martin.pirkl@bsse.ethz.ch>
Description: Given a single cell populations from different perturbation experiments mnem infers sub populations with different states for a signaling pathway.
Description: Mixture Nested Effects Models (mnem) is an extension of Nested Effects Models and allows for the analysis of single cell perturbation data provided by methods like Perturb-Seq (Dixit et al., 2016) or Crop-Seq (Datlinger et al., 2017). In those experiments each of many cells is perturbed by a knock-down of a specific gene, i.e. several cells are perturbed by a knock-down of gene A, several by a knock-down of gene B, ... and so forth. The observed read-out has to be multi-trait and in the case of the Perturb-/Crop-Seq gene are expression profiles for each cell. mnem uses a mixture model to simultaneously cluster the cell population into k clusters and and infer k networks causally linking the perturbed genes for each cluster. The mixture components are inferred via an expectation maximization algorithm.
Depends: R (>= 3.5)
License: GPL-3
Encoding: UTF-8
LazyData: true
biocViews: Pathways, SystemsBiology, NetworkInference, Network, RNASeq, PooledScreens, SingleCell, CRISPR, ATACSeq, DNASeq
biocViews: Pathways, SystemsBiology, NetworkInference, Network, RNASeq, PooledScreens, SingleCell, CRISPR, ATACSeq, DNASeq, GeneExpression
RoxygenNote: 6.0.1
Imports: cluster, nem, epiNEM, graph, Rgraphviz, flexclust, lattice, naturalsort, snowfall, stats4, tsne, methods, graphics, stats, utils
VignetteBuilder: knitr
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(plot,bootmnem)
S3method(plot,mnem)
export(bootstrap)
export(clustNEM)
Expand Down
560 changes: 335 additions & 225 deletions R/mnems.r

Large diffs are not rendered by default.

56 changes: 27 additions & 29 deletions R/mnems_low.r
Original file line number Diff line number Diff line change
Expand Up @@ -762,19 +762,17 @@ mynem <- function(D, search = "greedy", start = NULL, method = "llr",
subweights <- Dw%*%cbind(tmp$phi[colnames(Dw), ], 0)
subtopo <- apply(subweights, 1, which.max)
}

if (!is.null(parallel)) {
sfStop()
}

if (is.null(subtopo)) {
subtopo <- scoreAdj(D, better, method = method, weights = weights,
subtopo = subtopo, prior = prior,
ratio = ratio)
subweights <- subtopo$subweights
subtopo <- subtopo$subtopo
}


subtopo <- scoreAdj(D, better, method = method, weights = weights,
subtopo = subtopo, prior = prior,
ratio = ratio)
subweights <- subtopo$subweights
subtopo <- subtopo$subtopo

better <- transitive.reduction(better)
better <- better[order(as.numeric(rownames(better))),
order(as.numeric(colnames(better)))]
Expand All @@ -786,24 +784,24 @@ mynem <- function(D, search = "greedy", start = NULL, method = "llr",
#' @noRd
adj2dnf <- function(A) {

dnf <- NULL

for (i in seq_len(ncol(A))) {
for (j in seq_len(nrow(A))) {
if (i %in% j) { next() }
if (A[i, j] == 1) {
dnf <- c(dnf, paste(colnames(A)[i], rownames(A)[j], sep = "="))
}
if (A[i, j] == -1) {
dnf <- c(dnf, paste("!", colnames(A)[i], "=",
rownames(A)[j], sep = ""))
}
}
}
dnf <- NULL
for (i in seq_len(ncol(A))) {
for (j in seq_len(nrow(A))) {
if (i %in% j) { next() }
if (A[i, j] == 1) {
dnf <- c(dnf, paste(colnames(A)[i], rownames(A)[j], sep = "="))
}
if (A[i, j] == -1) {
dnf <- c(dnf, paste("!", colnames(A)[i], "=",
rownames(A)[j], sep = ""))
}
}
}

dnf <- unique(dnf)

return(dnf)
dnf <- unique(dnf)
return(dnf)

}
#' @noRd
Expand Down Expand Up @@ -869,8 +867,8 @@ scoreAdj <- function(D, adj, method = "llr", weights = NULL,
#' @noRd
adj2dnf <- function(A) {

dnf <- NULL

dnf <- NULL
for (i in seq_len(ncol(A))) {
dnf <- c(dnf, rownames(A))
for (j in seq_len(nrow(A))) {
Expand Down
18 changes: 13 additions & 5 deletions man/bootstrap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/clustNEM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions man/getAffinity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions man/getIC.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions man/hamSim.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4afec7e

Please sign in to comment.