diff --git a/DESCRIPTION b/DESCRIPTION index 2d3668f..115ec2b 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,7 +25,7 @@ Description: The bioinformatic evaluation of gene co-expression often begins wit License: GPL-2 LazyData: true VignetteBuilder: knitr -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Encoding: UTF-8 Depends: methods, diff --git a/R/3-shared-updateCutoffs.R b/R/3-shared-updateCutoffs.R index 32f94a7..e6520f4 100644 --- a/R/3-shared-updateCutoffs.R +++ b/R/3-shared-updateCutoffs.R @@ -356,7 +356,7 @@ getPermutedTheta <- #' #' @param values A numeric vector. #' @param cutoff A numeric value. -#' @direct A logical value. If \code{TRUE}, direct relationship is considered. +#' @param direct A logical value. If \code{TRUE}, direct relationship is considered. #' @return The number of values greater or less than the threshold. countValuesBeyondThreshold <- function(values, cutoff, direct){ if (direct){ diff --git a/README.Rmd b/README.Rmd index b0fa610..67637c6 100755 --- a/README.Rmd +++ b/README.Rmd @@ -40,20 +40,22 @@ There are a few proportionality statistics available. Select one with the 'metri ```{r, eval = FALSE} pr <- propr( counts, # rows as samples, like it should be - metric = "rho", # or "phi", "phs", "cor", "vlr" - ivar = "clr", # or can use "iqlr" instead + metric = "rho", # or "phi", "phs", "vlr" + ivar = "clr", # or can use another gene as reference, by giving the name or index alpha = NA, # use to handle zeros - p = 100 # used for updateCutoffs + p = 100 # used for permutation tests ) ``` -You can determine the "signficance" of proportionality using a built-in permutation procedure. It tells estimates the false discovery rate (FDR) for any cutoff. This method can take a while to run, but is parallelizable. +You can determine the "signficance" of proportionality using a built-in permutation procedure. It estimates the false discovery rate (FDR) for any cutoff. This method can take a while to run, but is parallelizable. ```{r, eval = FALSE} pr <- updateCutoffs( pr, - cutoff = seq(0, 1, .05), # cutoffs at which to estimate FDR - ncores = 1 # parallelize here + number_of_cutoffs = 100, # number of cutoffs to estimate FDR + custom_cutoffs = NULL, # or specify custom cutoffs + tails = 1, # 1 or 2-tailed test + ncores = 4 # parallelize here ) ``` @@ -67,7 +69,8 @@ There are many ways to calculate partial correlations, with or without shrinkage pr <- propr( counts, # rows as samples, like it should be metric = "pcor.bshrink", # partial correlation without shrinkage "pcor" is also available - p = 100 # used for updateCutoffs + ivar = "clr", # "clr" is recommended + p = 100 # used for permutation tests ) ``` @@ -76,9 +79,11 @@ You can also determine the "significance" of logratio partial correlations with ```{r, eval = FALSE} pr <- updateCutoffs( pr, - cutoff = seq(0, 1, .05), # cutoffs at which to estimate FDR - ncores = 1 # parallelize here - ) + number_of_cutoffs = 100, # number of cutoffs to estimate FDR + custom_cutoffs = NULL, # or specify custom cutoffs + tails = 1, # 1 or 2-tailed test + ncores = 4 # parallelize here + ) ``` @@ -91,7 +96,7 @@ pd <- propd( counts, group, # a vector of 2 or more groups alpha = NA, # whether to handle zeros - p = 100, # used for updateCutoffs + p = 100, # used for permutation tests weighted = TRUE # whether to weight log-ratios ) ``` @@ -128,6 +133,15 @@ Both functions return S4 objects. This package includes several helper functions Use `getResults` to pipe to `ggplot2` for visualization. +We also provide accesory functions to get the significant pairs. +```{r, eval = FALSE} +?getSignificantResultsFDR +?getSignificantResultsFstat +?getAdjacencyFDR +?getAdjacencyFstat +?getCutoffFDR +?getCutoffFstat +``` ## Ratio Methods diff --git a/README.md b/README.md index 838c4a0..7b8d28a 100755 --- a/README.md +++ b/README.md @@ -85,23 +85,24 @@ the ‘metric’ argument. ``` r pr <- propr( counts, # rows as samples, like it should be - metric = "rho", # or "phi", "phs", "cor", "vlr" - ivar = "clr", # or can use "iqlr" instead + metric = "rho", # or "phi", "phs", "vlr" + ivar = "clr", # or can use another gene as reference, by giving the name or index alpha = NA, # use to handle zeros - p = 100 # used for updateCutoffs + p = 100 # used for permutation tests ) ``` You can determine the “signficance” of proportionality using a built-in -permutation procedure. It tells estimates the false discovery rate (FDR) -for any cutoff. This method can take a while to run, but is -parallelizable. +permutation procedure. It estimates the false discovery rate (FDR) for +any cutoff. This method can take a while to run, but is parallelizable. ``` r pr <- updateCutoffs( pr, - cutoff = seq(0, 1, .05), # cutoffs at which to estimate FDR - ncores = 1 # parallelize here + number_of_cutoffs = 100, # number of cutoffs to estimate FDR + custom_cutoffs = NULL, # or specify custom cutoffs + tails = 1, # 1 or 2-tailed test + ncores = 4 # parallelize here ) ``` @@ -117,7 +118,8 @@ by compositional bias is “pcor.bshrink”. pr <- propr( counts, # rows as samples, like it should be metric = "pcor.bshrink", # partial correlation without shrinkage "pcor" is also available - p = 100 # used for updateCutoffs + ivar = "clr", # "clr" is recommended + p = 100 # used for permutation tests ) ``` @@ -127,9 +129,11 @@ correlations with the built-in permutation approach. ``` r pr <- updateCutoffs( pr, - cutoff = seq(0, 1, .05), # cutoffs at which to estimate FDR - ncores = 1 # parallelize here - ) + number_of_cutoffs = 100, # number of cutoffs to estimate FDR + custom_cutoffs = NULL, # or specify custom cutoffs + tails = 1, # 1 or 2-tailed test + ncores = 4 # parallelize here + ) ``` ## Differential Proportionality @@ -142,7 +146,7 @@ pd <- propd( counts, group, # a vector of 2 or more groups alpha = NA, # whether to handle zeros - p = 100, # used for updateCutoffs + p = 100, # used for permutation tests weighted = TRUE # whether to weight log-ratios ) ``` @@ -182,6 +186,17 @@ functions that work for both the `propr` and `propd` output. Use `getResults` to pipe to `ggplot2` for visualization. +We also provide accesory functions to get the significant pairs. + +``` r +?getSignificantResultsFDR +?getSignificantResultsFstat +?getAdjacencyFDR +?getAdjacencyFstat +?getCutoffFDR +?getCutoffFstat +``` + ## Ratio Methods COMING SOON!! diff --git a/man/countValuesBeyondThreshold.Rd b/man/countValuesBeyondThreshold.Rd index 8cd9af0..e06bb8d 100644 --- a/man/countValuesBeyondThreshold.Rd +++ b/man/countValuesBeyondThreshold.Rd @@ -10,6 +10,8 @@ countValuesBeyondThreshold(values, cutoff, direct) \item{values}{A numeric vector.} \item{cutoff}{A numeric value.} + +\item{direct}{A logical value. If \code{TRUE}, direct relationship is considered.} } \value{ The number of values greater or less than the threshold.