diff --git a/R/dRegulation.R b/R/dRegulation.R index 4449891..22649fe 100644 --- a/R/dRegulation.R +++ b/R/dRegulation.R @@ -4,7 +4,6 @@ #' @title Evaluates gene differential regulation based on manifold alignment distances. #' @description Using the output of the non-linear manifold alignment, this function computes the Euclidean distance between the coordinates for the same gene in both conditions. Calculated distances are then transformed using Box-Cox power transformation, and standardized to ensure normality. P-values are assigned following the chi-square distribution over the fold-change of the squared distance computed with respect to the expectation. #' @param manifoldOutput A matrix. The output of the non-linear manifold alignment, a labeled matrix with two times the number of shared genes as rows (X_ genes followed by Y_ genes in the same order) and \code{d} number of columns. -#' @param minFC A decimal value. Defines the cut-off threshold of fold-change to limit the testing to genes that show, at least \code{minFC} deviation. #' @return A data frame with 5 columns as follows: \itemize{ #' \item \code{gene} A character vector with the gene id identified from the \code{manifoldAlignment} output. #' \item \code{distance} A numeric vector of the Euclidean distance computed between the coordinates of the same gene in both conditions. @@ -67,7 +66,7 @@ #' qqline(dcOutput$Z) #' } -dRegulation <- function(manifoldOutput, minFC = 1.5){ +dRegulation <- function(manifoldOutput){ geneList <- rownames(manifoldOutput) geneList <- geneList[grepl('^X_', geneList)] @@ -119,7 +118,6 @@ dRegulation <- function(manifoldOutput, minFC = 1.5){ p.value = pValues, p.adj = pAdjusted ) - dOut <- dOut[FC > minFC,] dOut <- dOut[order(dOut$p.value),] dOut <- as.data.frame.array(dOut) return(dOut) diff --git a/R/scTenifoldNet.R b/R/scTenifoldNet.R index 23bc266..0c00ff9 100644 --- a/R/scTenifoldNet.R +++ b/R/scTenifoldNet.R @@ -18,7 +18,6 @@ #' @param td_maxIter An integer value. Defines the maximum number of iterations if error stay above \code{td_maxError}. #' @param td_maxError A decimal value between 0 and 1. Defines the relative Frobenius norm error tolerance. #' @param ma_nDim An integer value. Defines the number of dimensions of the low-dimensional feature space to be returned from the non-linear manifold alignment. -#' @param dc_minFC A decimal value. Defines the cut-off threshold of fold-change to limit the testing to genes that show, at least \code{dc_minFC} deviation. #' @return A list with 3 slots as follows: #' \itemize{ #' \item{tensorNetworks:} The generated weight-averaged denoised gene regulatory networks using CANDECOMP/PARAFAC (CP) Tensor Decomposition. @@ -66,7 +65,7 @@ scTenifoldNet <- function(X, Y, qc_minLibSize = 1000, qc_removeOutlierCells = TRUE, qc_minPCT = 0.05, qc_maxMTratio = 0.1, nc_nNet = 10, nc_nCells = 500, nc_nComp = 3, nc_symmetric = FALSE, nc_scaleScores = TRUE, - nc_q = 0.05, td_K = 3, td_maxIter = 1e3, td_maxError = 1e-5, ma_nDim = 30, dc_minFC = 1.5){ + nc_q = 0.05, td_K = 3, td_maxIter = 1e3, td_maxError = 1e-5, ma_nDim = 30){ # Single-cell Quality Control X <- scQC(X, minLibSize = qc_minLibSize, removeOutlierCells = qc_removeOutlierCells, minPCT = qc_minPCT, maxMTratio = qc_maxMTratio) Y <- scQC(Y, minLibSize = qc_minLibSize, removeOutlierCells = qc_removeOutlierCells, minPCT = qc_minPCT, maxMTratio = qc_maxMTratio) @@ -113,7 +112,7 @@ scTenifoldNet <- function(X, Y, qc_minLibSize = 1000, qc_removeOutlierCells = TR # write.csv(mA, outFile) # Differential regulation testing - dR <- dRegulation(manifoldOutput = mA, minFC = dc_minFC) + dR <- dRegulation(manifoldOutput = mA) # write.csv(dC, paste0('dCoex_',id,'_',M,'tensor_',A,'alignment.csv')) # } # } diff --git a/man/dRegulation.Rd b/man/dRegulation.Rd index a960889..605d5e6 100644 --- a/man/dRegulation.Rd +++ b/man/dRegulation.Rd @@ -4,12 +4,10 @@ \alias{dRegulation} \title{Evaluates gene differential regulation based on manifold alignment distances.} \usage{ -dRegulation(manifoldOutput, minFC = 1.5) +dRegulation(manifoldOutput) } \arguments{ \item{manifoldOutput}{A matrix. The output of the non-linear manifold alignment, a labeled matrix with two times the number of shared genes as rows (X_ genes followed by Y_ genes in the same order) and \code{d} number of columns.} - -\item{minFC}{A decimal value. Defines the cut-off threshold of fold-change to limit the testing to genes that show, at least \code{minFC} deviation.} } \value{ A data frame with 5 columns as follows: \itemize{ diff --git a/man/scTenifoldNet.Rd b/man/scTenifoldNet.Rd index ad43de5..8db688d 100644 --- a/man/scTenifoldNet.Rd +++ b/man/scTenifoldNet.Rd @@ -8,7 +8,7 @@ scTenifoldNet(X, Y, qc_minLibSize = 1000, qc_removeOutlierCells = TRUE, qc_minPCT = 0.05, qc_maxMTratio = 0.1, nc_nNet = 10, nc_nCells = 500, nc_nComp = 3, nc_symmetric = FALSE, nc_scaleScores = TRUE, nc_q = 0.05, td_K = 3, td_maxIter = 1000, - td_maxError = 1e-05, ma_nDim = 30, dc_minFC = 1.5) + td_maxError = 1e-05, ma_nDim = 30) } \arguments{ \item{X}{Raw counts matrix with cells as columns and genes (symbols) as rows.} @@ -42,8 +42,6 @@ scTenifoldNet(X, Y, qc_minLibSize = 1000, qc_removeOutlierCells = TRUE, \item{td_maxError}{A decimal value between 0 and 1. Defines the relative Frobenius norm error tolerance.} \item{ma_nDim}{An integer value. Defines the number of dimensions of the low-dimensional feature space to be returned from the non-linear manifold alignment.} - -\item{dc_minFC}{A decimal value. Defines the cut-off threshold of fold-change to limit the testing to genes that show, at least \code{dc_minFC} deviation.} } \value{ A list with 3 slots as follows: