diff --git a/DESCRIPTION b/DESCRIPTION index 636e0c37..65880d41 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: netZooR Type: Package Title: Unified methods for the inference and analysis of gene regulatory networks -Version: 1.5.4 -Date: 2023-09-25 +Version: 1.5.6 +Date: 2024-02-02 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", diff --git a/R/PUMA.R b/R/PUMA.R index a30d4b99..6831027d 100644 --- a/R/PUMA.R +++ b/R/PUMA.R @@ -89,7 +89,11 @@ puma <- function(motif,expr=NULL,ppi=NULL,alpha=0.1,mir_file,hamming=0.001, expr <- expr[order(rownames(expr)),] }else if(mode=='union'){ gene.names=unique(union(rownames(expr),unique(motif[,2]))) - tf.names =unique(union(unique(ppi[,1]),unique(motif[,1]))) + if(is.null(ppi)){ + tf.names = unique(motif[,1]) + }else{ + tf.names =unique(union(unique(ppi[,1]),unique(motif[,1]))) + } num.TFs <- length(tf.names) num.genes <- length(gene.names) # gene expression matrix @@ -117,7 +121,11 @@ puma <- function(motif,expr=NULL,ppi=NULL,alpha=0.1,mir_file,hamming=0.001, regulatoryNetwork[Idx]=motif[,3] }else if(mode=='intersection'){ gene.names=unique(intersect(rownames(expr),unique(motif[,2]))) - tf.names =unique(intersect(unique(ppi[,1]),unique(motif[,1]))) + if(is.null(ppi)){ + tf.names =unique(motif[,1]) + }else{ + tf.names =unique(intersect(unique(ppi[,1]),unique(motif[,1]))) + } num.TFs <- length(tf.names) num.genes <- length(gene.names) # gene expression matrix @@ -241,6 +249,7 @@ puma <- function(motif,expr=NULL,ppi=NULL,alpha=0.1,mir_file,hamming=0.001, if(!is.null(mir_file)){ mirIndex = match(mir_file,tf.names) + mirIndex <- mirIndex[!is.na(mirIndex)] tfCoopNetwork[mirIndex,] = 0 tfCoopNetwork[,mirIndex] = 0 seqs = seq(1, num.TFs*num.TFs, num.TFs+1) diff --git a/man/TIGER.Rd b/man/TIGER.Rd deleted file mode 100644 index 3665a2cb..00000000 --- a/man/TIGER.Rd +++ /dev/null @@ -1,82 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/TIGER.R -\name{tiger} -\alias{tiger} -\title{TIGER main function} -\usage{ -tiger( - expr, - prior, - method = "VB", - TFexpressed = TRUE, - signed = TRUE, - baseline = TRUE, - psis_loo = FALSE, - seed = 123, - out_path = NULL, - out_size = 300, - a_sigma = 1, - b_sigma = 1, - a_alpha = 1, - b_alpha = 1, - sigmaZ = 10, - sigmaB = 1, - tol = 0.005 -) -} -\arguments{ -\item{expr}{A normalized log-transformed gene expressison matrix. Rows are genes -and columns are sampeles (cells).} - -\item{prior}{A prior regulatory network in adjacency matrix format. Rows are TFs -and columns target genes.} - -\item{method}{Method used for Bayesian inference. "VB" or "MCMC". Defaults to "VB".} - -\item{TFexpressed}{TF mRNA needs to be expressed or not. Defaults to TRUE.} - -\item{signed}{Prior network is signed or not. Defaults to TRUE.} - -\item{baseline}{Include baseline or not. Defaults to TRUE.} - -\item{psis_loo}{Use pareto smoothed importance sampling leave-one-out cross -validation to check model fitting or not. Defaults to FALSE.} - -\item{seed}{Seed for reproducible results. Defaults to 123.} - -\item{out_path}{(Optional) output path for CmdStanVB or CmdStanMCMC object. Defaults to NULL.} - -\item{out_size}{Posterior sampling size. Default = 300.} - -\item{a_sigma}{Hyperparameter of error term. Default = 1.} - -\item{b_sigma}{Hyperparameter of error term. Default = 1.} - -\item{a_alpha}{Hyperparameter of edge weight W. Default = 1.} - -\item{b_alpha}{Hyperparameter of edge weight W. Default = 1.} - -\item{sigmaZ}{Standard deviation of TF activity Z. Default = 10.} - -\item{sigmaB}{Standard deviation of baseline term. Default = 1.} - -\item{tol}{Convergence tolerance on ELBO.. Default = 0.005.} -} -\value{ -A TIGER list object. -* W is the estimated regulatory network, but different from prior network, -rows are genes and columns are TFs. -* Z is the estimated TF activities, rows are TFs and columns are samples. -* TF.name, TG.name, and sample.name are the used TFs, target genes and samples. -* If psis_loo is TRUE, loocv is a table of psis_loo result for model checking. -* If psis_loo is TRUE, elpd_loo is the Bayesian LOO estimate of the expected log pointwise predictive -density, which can be used for Bayesian stacking to handle multi-modality later. -} -\description{ -TIGER main function -} -\examples{ -data(TIGER_expr) -data(TIGER_prior) -tiger(TIGER_expr,TIGER_prior) -} diff --git a/man/cobra.Rd b/man/cobra.Rd index d3952aba..b88fcf9a 100644 --- a/man/cobra.Rd +++ b/man/cobra.Rd @@ -4,14 +4,14 @@ \alias{cobra} \title{Run COBRA in R} \usage{ -cobra(X, expressionData, standardize = T) +cobra(X, expressionData, method = "pearson") } \arguments{ \item{X}{: design matrix of size (n, q), n = number of samples, q = number of covariates} \item{expressionData}{: gene expression as a matrix of size (g, n), g = number of genes} -\item{standardize}{: boolean flag to standardize the gene expression as a pre-processing step +\item{method}{: if pearson, the decomposition of the co-expression matrix is compouted. If pcorsh, COBRA decomposes the regularized partial co-expression Outputs:} } diff --git a/man/prior.pp.Rd b/man/prior.pp.Rd deleted file mode 100644 index 04719523..00000000 --- a/man/prior.pp.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/TIGER.R -\name{prior.pp} -\alias{prior.pp} -\title{Filter low confident edge signs in the prior network using GeneNet} -\usage{ -prior.pp(prior, expr) -} -\arguments{ -\item{prior}{A prior network (adjacency matrix) with rows as TFs and columns as genes.} - -\item{expr}{A normalized log-transformed gene expression matrix.} -} -\value{ -A filtered prior network (adjacency matrix). -} -\description{ -Filter low confident edge signs in the prior network using GeneNet -}