Skip to content

Commit

Permalink
1.3 (#282)
Browse files Browse the repository at this point in the history
* add bioc information

* update website

* add crane and docs

* update crane

* update worflow

* update crane

* update workflows

* update workflows

* update workfolw

* update workfolw

* update workfolw

* update workfolw

* Update main.yml

* Update main.yml

* Update main.yml

* fix lioness py

* udpate lioness in R

* include calculations python

* update panda rm missing

* update panda

* update lioness joblib

* revert commits

* ALPACA fix to NAs in community assignement

* version bump

* revert lioness

* update crane with alpaca changes

* update lioness

* update lioness python

* fix test

* update workflows

* put back github actions

* Fixed typo

* Added LIONESS-pearson option + unit test

* changed param labels in LIONESS example

* updated docs for lioness() function

* Update main.yml

* Update main.yml

* bump x.y.z version to even y prior to creation of RELEASE_3_15 branch

* bump x.y.z version to odd y following creation of RELEASE_3_15 branch

* Update DESCRIPTION

* fix crane issue #240

* expanded PANDA and LIONESS description

* update crane fix

* added ALPACA, EGRET, and OTTER descriptions

* Update README.md

* typo in na.rm

* update workflow

* update workflow2

* fix-actions-3

* add r lib v2

* add r lib v2

* update condor test

* update condor test

* update condor test

* update condor test

* show testthat output

* add pandoc and use cache

* use built in check

* use built in check

* update actions with built in check

* bump version

* use built in coverage

* use built in coverage

* remove sudo

* update actions

* update actions

* removed sudo from actions

* ugrade to R42

* remove virtualenv

* remove virtualenv

* remove virtualenv

* modify condor test

* update condor test

* update condor test

* adding retiucualte to covr

* adding retiucualte to covr

* add panda test to coverignore

* update actions

* remove lioness tests from coverage

* remove lioness tests from coverage

* added MONSTER and SAMBAR

* remove lionessR test

* Added CONDOR and YARN

* Update README.md

* put back otter in rbuild

* remove condor test

* remove condor test

* remove lioness docs

* add lioness to buildingore

* donttest lionesss

* remove coverage from ubuntu test

* remove rbuilignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* put back tests

* add padanedge diff test

* add back egeret test

* add monster test

* fix monster test

* tolerance in expect equal

* tolerance in expect equal

* tolerance in expect equal

* tolerance in expect equal

* add sourceppi

* fixed PANDA tests

* modify panda test

* update lioness test

* fix expect message

* update tests

* update tests

* update tests

* update tests

* update tests

* update tests

* reduced lioness test data

* reduced lioness test data

* reduced lioness test data

* reduced lioness test data

* reduce test size

* updating bioc (#250)

* updating bioc

* remove empty lines

* remove empty lines

* update citation

* update citation

* update citation

* Update README.md

* Update README.md

* Update main.yml

* Update main.yml

* Update .Rbuildignore

* Update .Rbuildignore

* update lioness test

* removed two last lioness tests

* removed two last lioness tests

* removed two last lioness tests

* no saving of lioness networks

* no saving of lioness networks

* no saving of lioness networks

* no saving of lioness networks

* update lioness test

* lower sizeof test

* update test data

* update test data

* update test data

* reduce panda tests

* remove old test data

* remove old test data

* Update main.yml

* 1.1.16

update pandapy with header argument (#260)

* trying collapse readme (#261)

* trying collapse readme

* collapse animal description

* Update README.md

* Fix news file formatting

  o was not rendering list properly

* bump x.y.z version to even y prior to creation of RELEASE_3_16 branch

* bump x.y.z version to odd y following creation of RELEASE_3_16 branch

* update biconda (#265)

* add spider (#269)

* add spider

* udpate spider

* udpate spider

* update spuder with degreeadjust

* fix spider bug

* DRAGON and unit tests work in progress (#267)

- add DRAGON in R and unit tests

* update lioness (#276)

* update lioness code (#277)

* Update LIONESS.R

* Update LIONESS.R

* Update LIONESS.R

* add note about the function (#279)

* add note about the function

* Update sourcePPI.R

* Update README.md

* Update README.md

* Update sourcePPI.R

* Update sourcePPI.R

* add details about sourcePPI (#280)

* add parallelization option to lioness (#281)

* 1.2.1 (#271)

* add bioc information

* update website

* add crane and docs

* update crane

* update worflow

* update crane

* update workflows

* update workflows

* update workfolw

* update workfolw

* update workfolw

* update workfolw

* Update main.yml

* Update main.yml

* Update main.yml

* fix lioness py

* udpate lioness in R

* include calculations python

* update panda rm missing

* update panda

* update lioness joblib

* revert commits

* ALPACA fix to NAs in community assignement

* version bump

* revert lioness

* update crane with alpaca changes

* update lioness

* update lioness python

* fix test

* update workflows

* put back github actions

* Fixed typo

* Added LIONESS-pearson option + unit test

* changed param labels in LIONESS example

* updated docs for lioness() function

* Update main.yml

* Update main.yml

* Update DESCRIPTION

* fix crane issue #240

* expanded PANDA and LIONESS description

* update crane fix

* added ALPACA, EGRET, and OTTER descriptions

* Update README.md

* typo in na.rm

* update workflow

* update workflow2

* fix-actions-3

* add r lib v2

* add r lib v2

* update condor test

* update condor test

* update condor test

* update condor test

* show testthat output

* add pandoc and use cache

* use built in check

* use built in check

* update actions with built in check

* bump version

* use built in coverage

* use built in coverage

* remove sudo

* update actions

* update actions

* removed sudo from actions

* ugrade to R42

* remove virtualenv

* remove virtualenv

* remove virtualenv

* modify condor test

* update condor test

* update condor test

* adding retiucualte to covr

* adding retiucualte to covr

* add panda test to coverignore

* update actions

* remove lioness tests from coverage

* remove lioness tests from coverage

* added MONSTER and SAMBAR

* remove lionessR test

* Added CONDOR and YARN

* Update README.md

* put back otter in rbuild

* remove condor test

* remove condor test

* remove lioness docs

* add lioness to buildingore

* donttest lionesss

* remove coverage from ubuntu test

* remove rbuilignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* put back tests

* add padanedge diff test

* add back egeret test

* add monster test

* fix monster test

* tolerance in expect equal

* tolerance in expect equal

* tolerance in expect equal

* tolerance in expect equal

* add sourceppi

* fixed PANDA tests

* modify panda test

* update lioness test

* fix expect message

* update tests

* update tests

* update tests

* update tests

* update tests

* update tests

* reduced lioness test data

* reduced lioness test data

* reduced lioness test data

* reduced lioness test data

* reduce test size

* updating bioc (#250)

* updating bioc

* remove empty lines

* remove empty lines

* update citation

* update citation

* Update README.md

* Update README.md

* Update main.yml

* Update main.yml

* Update .Rbuildignore

* Update .Rbuildignore

* update lioness test

* removed two last lioness tests

* removed two last lioness tests

* removed two last lioness tests

* no saving of lioness networks

* no saving of lioness networks

* no saving of lioness networks

* no saving of lioness networks

* update lioness test

* lower sizeof test

* update test data

* update test data

* update test data

* reduce panda tests

* remove old test data

* remove old test data

* Update main.yml

* 1.1.16

update pandapy with header argument (#260)

* trying collapse readme (#261)

* trying collapse readme

* collapse animal description

* Update README.md

* update biconda (#265)

* add spider (#269)

* add spider

* udpate spider

* udpate spider

* update spuder with degreeadjust

* fix spider bug

Co-authored-by: Kate Hoff Shutta <kshutta@umass.edu>
Co-authored-by: katehoffshutta <43797774+katehoffshutta@users.noreply.github.com>

* 1.2.2 (#273)

- add DRAGON

* add option to run lioness on multiple cores by using parallel::mclapply in place of lapply

---------

Co-authored-by: Marouen <marouenbg@users.noreply.github.com>
Co-authored-by: Kate Hoff Shutta <kshutta@umass.edu>
Co-authored-by: katehoffshutta <43797774+katehoffshutta@users.noreply.github.com>

* fix monster error

* fix monster

* 1.3.2

* update tests

* update bioc verssion

* update monster test

* update argument description

* update argument description

* changed date

* updaate docs

* update dragon verbose

* update spider

* add puma (#270)

* add puma

* update PUMA

* updating mirna interactions

* add PUMA in readme

* Update PUMA.R

---------

Co-authored-by: Kate Hoff Shutta <kshutta@umass.edu>
Co-authored-by: Nitesh Turaga <nitesh.turaga@gmail.com>
Co-authored-by: katehoffshutta <43797774+katehoffshutta@users.noreply.github.com>
Co-authored-by: lshep <lori.shepherd@roswellpark.org>
Co-authored-by: J Wokaty <jennifer.wokaty@sph.cuny.edu>
Co-authored-by: Lauren Hsu <50427381+laurenhsu1@users.noreply.github.com>
  • Loading branch information
7 people committed Apr 12, 2023
1 parent e939677 commit 81cb072
Show file tree
Hide file tree
Showing 19 changed files with 1,131 additions and 285 deletions.
48 changes: 24 additions & 24 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: netZooR
Type: Package
Title: Unified methods for the inference and analysis of gene regulatory networks
Version: 1.2.1
Date: 2022-07-07
Version: 1.3.15
Date: 2023-03-16
Authors@R: c(person("Marouen", "Ben Guebila",
email = "benguebila@hsph.harvard.edu", role = c("aut","cre"), comment = c(ORCID = "0000-0001-5934-966X")),
person("Tian", "Wang",
Expand All @@ -18,10 +18,10 @@ Authors@R: c(person("Marouen", "Ben Guebila",
person("Des", "Weighill",
email = "",role = "aut", comment = c(ORCID = "0000-0003-4979-5871")),
person("Kate", "Shutta",
email = "",role = "ctb", comment = c(ORCID = "0000-0003-0402-3771")))
Maintainer: Marouen Ben Guebila <benguebila@hsph.harvard.edu>
email = "",role = "aut", comment = c(ORCID = "0000-0003-0402-3771")))
Maintainer: Marouen Ben Guebila <marouen.b.guebila@gmail.com>
Description: netZooR unifies the implementations of several Network Zoo methods (netzoo, netzoo.github.io) into a single package by creating interfaces between network inference and network analysis methods. Currently, the package has 3 methods for network inference including PANDA and its optimized implementation OTTER (network reconstruction using mutliple lines of biological evidence), LIONESS (single-sample network inference), and EGRET (genotype-specific networks). Network analysis methods include CONDOR (community detection), ALPACA (differential community detection), CRANE (significance estimation of differential modules), MONSTER (estimation of network transition states). In addition, YARN allows to process gene expresssion data for tissue-specific analyses and SAMBAR infers missing mutation data based on pathway information.
Depends: R (>= 4.1.0),
Depends: R (>= 4.2.0),
igraph,
reticulate,
pandaR,
Expand All @@ -37,12 +37,12 @@ biocViews:
GraphAndNetwork
Imports: RCy3,
viridisLite,
STRINGdb,
STRINGdb,
Biobase,
GOstats,
AnnotationDbi,
matrixStats,
GO.db,
matrixStats,
GO.db,
org.Hs.eg.db,
Matrix,
gplots,
Expand All @@ -51,21 +51,21 @@ Imports: RCy3,
vegan,
stats,
utils,
reshape,
reshape2,
penalized,
parallel,
doParallel,
foreach,
ggplot2,
ggdendro,
grid,
MASS,
assertthat,
tidyr,
methods,
dplyr,
graphics
reshape,
reshape2,
penalized,
parallel,
doParallel,
foreach,
ggplot2,
ggdendro,
grid,
MASS,
assertthat,
tidyr,
methods,
dplyr,
graphics
License: GPL-3
Encoding: UTF-8
LazyData: false
Expand All @@ -76,6 +76,6 @@ Suggests:
pkgdown
VignetteEngine: knitr
VignetteBuilder: knitr
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
BugReports: https://github.com/netZoo/netZooR/issues
URL: https://github.com/netZoo/netZooR, https://netzoo.github.io/
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export(pandaToCondorObject)
export(runEgret)
export(sambar)
export(sourcePPI)
export(spider)
export(visPandaInCytoscape)
import(AnnotationDbi, except= select)

Expand Down
20 changes: 14 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
CHANGES IN VERSION 1.3.2
--------------------------

- R implementation of SPIDER
- R implementation of DRAGON
- header argument in pandaPy

CHANGES IN VERSION 1.1.12
--------------------------

o Reactivated unit tests for Ubuntu GitHub actions.
o LIONESS can now build single-sample coexpression networks using @kshutta's implementation
o Fix for ALPACA singleton community case (detected by @talkhanz)
o Fix for CRANE significance test on constant modularity scores (detected by @talkhanz)
o Improved method description by @kshutta
o Fix for PANDA edge case when only expression is provided
- Reactivated unit tests for Ubuntu GitHub actions.
- LIONESS can now build single-sample coexpression networks using @kshutta's implementation
- Fix for ALPACA singleton community case (detected by @talkhanz)
- Fix for CRANE significance test on constant modularity scores (detected by @talkhanz)
- Improved method description by @kshutta
- Fix for PANDA edge case when only expression is provided

15 changes: 8 additions & 7 deletions R/DRAGON.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# X_mean = np.mean(X_temp, axis=0)
# return (X_temp - X_mean) / X_std

scale = function(x,bias=F)
scale = function(x,bias=FALSE)
{
# sd does 1/(n-1), python does 1/n
# use the bias option for exact match with python
Expand Down Expand Up @@ -135,8 +135,8 @@ risk = function(gamma, const, t11, t12, t21, t22, t3, t4)
# def estimate_penalty_parameters_dragon(X1, X2):
estimatePenaltyParameters = function(X1,X2)
{
# X1 = matrix(c(1,2,3,1,5,12),nrow=3,byrow=T)
# X2 = matrix(c(9,7,8),nrow=3,byrow=T)
# X1 = matrix(c(1,2,3,1,5,12),nrow=3,byrow=TRUE)
# X2 = matrix(c(9,7,8),nrow=3,byrow=TRUE)
# X1 is omics matrix 1, dimensions n x p1
# X2 is omics matrix 2, dimensions n x p2
# The matrices should have the same ordering by samples
Expand Down Expand Up @@ -233,7 +233,7 @@ estimatePenaltyParameters = function(X1,X2)
method="L-BFGS-B",
lower=c(0,0),
upper=c(1,1),
control = list(trace=T,pgtol = 1e-15))
control = list(trace=TRUE,pgtol = 1e-15))

# reparameterize
lambdas = c(1-res$par[1]^2, 1-res$par[2]^2)
Expand Down Expand Up @@ -296,7 +296,7 @@ get_precision_matrix_dragon = function(X1, X2, lambdas)
# mu = np.mean(X, axis=0)
}

get_partial_correlation_from_precision = function(Theta,selfEdges=F)
get_partial_correlation_from_precision = function(Theta,selfEdges=FALSE)
{
# by default, does not return self edges (diagonal is set to zero)
ggm = -cov2cor(Theta)
Expand Down Expand Up @@ -358,7 +358,8 @@ estimate_p_values_dragon = function(r, n, p1, p2, lambdas, kappa="estimate",seed
#' @param layer1 : first layer of omics data; rows: samples (order must match layer2), columns: variables
#' @param layer2 : second layer of omics data; rows: samples (order must match layer1), columns: variables.
#' @param pval : calculate p-values for network edges. Not yet implemented in R; available in netZooPy.
#' @param gradient : method for estimating parameters of p-value distribution, applies only if p-val == T. default = "finite_difference"; other option = "exact"
#' @param gradient : method for estimating parameters of p-value distribution, applies only if p-val == TRUE. default = "finite_difference"; other option = "exact"
#' @param verbose : verbosity level (TRUE/FALSE)
#' @return A list of model results. cov : the shrunken covariance matrix
#' \itemize{
#' \item{\code{cov}}{ the shrunken covariance matrix}
Expand All @@ -370,7 +371,7 @@ estimate_p_values_dragon = function(r, n, p1, p2, lambdas, kappa="estimate",seed
#' }
#'
#' @export
dragon = function(layer1,layer2,pval = F,gradient = "finite_difference", verbose = F)
dragon = function(layer1,layer2,pval = FALSE,gradient = "finite_difference", verbose = FALSE)
{
if(verbose)
print("[netZooR::dragon] Estimating penalty parameters...")
Expand Down
24 changes: 16 additions & 8 deletions R/LIONESS.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ lionessPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu"
# create an instance named "lioness_obj" of Lioness Class.
# when save_single_network = TRUE
if(save_single_network==TRUE){
py_run_string(paste("lioness_obj = Lioness(panda_obj", " , " , "computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, " , ", "save_dir='", save_dir, "' , " , "save_fmt='" , save_fmt, "' )",sep = "" ))
}else{
py_run_string(paste("lioness_obj = Lioness(panda_obj", " , " , "computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, ")",sep = "" ))
py_run_string(paste("lioness_obj = Lioness(panda_obj,computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, " , ", "save_dir='", save_dir, "' , " , "save_fmt='" , save_fmt, "' , " , "save_single = True )",sep = "" ))
}else if(save_single_network==FALSE){
py_run_string(paste("lioness_obj = Lioness(panda_obj,computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, " , ", "save_single = False )",sep = "" ))
}

# retrieve the "total_lioness_network" attribute of instance "lionesss_obj"
Expand All @@ -161,13 +161,16 @@ lionessPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu"
#' transcription factor 2 (column 2) and a score (column 3) for the interaction.
#' @param network.inference.method String specifying choice of network inference method. Default is "panda".
#' Options include "pearson".
#' @param ncores int specifying the number of cores to be used. Default is 1.
#' (Note: constructing panda networks can be memory-intensive, and the number of cores should take into consideration available memory.)
#' @param ... additional arguments for panda analysis
#' @keywords keywords
#' @importFrom matrixStats rowSds
#' @importFrom matrixStats colSds
#' @importFrom Biobase assayData
#' @importFrom reshape melt.array
#' @importFrom pandaR panda
#' @importFrom parallel mclapply
#' @export
#' @return A list of length N, containing objects of class "panda"
#' corresponding to each of the N samples in the expression data set.\cr
Expand All @@ -180,25 +183,30 @@ lionessPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu"
#' @references
#' Kuijjer, M.L., Tung, M., Yuan, G., Quackenbush, J. and Glass, K., 2015.
#' Estimating sample-specific regulatory networks. arXiv preprint arXiv:1505.06440.
lioness = function(expr, motif = NULL, ppi = NULL, network.inference.method = "panda", ...){
#' Kuijjer, M.L., Hsieh, PH., Quackenbush, J. et al. lionessR: single sample network inference in R. BMC Cancer 19, 1003 (2019). https://doi.org/10.1186/s12885-019-6235-7
lioness = function(expr, motif = NULL, ppi = NULL, network.inference.method = "panda", ncores = 1, ...){
N <- ncol(expr)
if(ncores < 1){
print('Setting number of cores to 1.')
ncores <- 1
}
if(network.inference.method == "panda")
{
fullnet <- panda(motif, expr, ppi, ...)
return(lapply(seq_len(N), function(i) {
return(mclapply(seq_len(N), function(i) {
print(paste("Computing network for sample ", i))
N * fullnet@regNet - (N - 1) * panda(motif, expr[, -i],
ppi, ...)@regNet
}))
}, mc.cores = ncores))
}
if(network.inference.method == "pearson")
{
fullnet <- cor(t(expr))

return(lapply(seq_len(N), function(i) {
return(mclapply(seq_len(N), function(i) {
print(paste("Computing network for sample ", i))
N * fullnet - (N - 1) * cor(t(expr[,-i]))
}))
}, mc.cores = ncores))
}
if(!(network.inference.method %in% c("panda","pearson")))
{
Expand Down
2 changes: 1 addition & 1 deletion R/PANDA.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @param keep_expression_matrix 'TRUE' keeps the input expression matrix as an attribute in the result Panda object.'FALSE' deletes the expression matrix attribute in the Panda object. The default value is 'FALSE'.
#' @param modeProcess 'legacy' refers to the processing mode in netZooPy<=0.5, 'union': takes the union of all TFs and genes across priors and fills the missing genes in the priors with zeros; 'intersection': intersects the input genes and TFs across priors and removes the missing TFs/genes. Default values is 'union'.
#' @param remove_missing Only when modeProcess='legacy': remove_missing='TRUE' removes all unmatched TF and genes; remove_missing='FALSE' keeps all tf and genes. The default value is 'FALSE'.
#'
#' @param with_header Boolean to read gene expression file with a header for sample names
#' @return When save_memory=FALSE(default), this function will return a list of three items:
#' Use \code{$panda} to access the standard output of PANDA as data frame, which consists of four columns:
#' "TF", "Gene", "Motif" using 0 or 1 to indicate if this edge belongs to prior motif dataset, and "Score".
Expand Down
Loading

0 comments on commit 81cb072

Please sign in to comment.