Skip to content

Commit

Permalink
scone_1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcole committed Oct 19, 2017
1 parent 9b3474b commit af3da30
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: scone
Version: 1.1.2-9001
Version: 1.1.3
Title: Single Cell Overview of Normalized Expression data
Description: SCONE is an R package for comparing and ranking the performance of
different normalization schemes for single-cell RNA-seq and other
Expand Down
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ importFrom(grDevices,pdf)
importFrom(graphics,abline)
importFrom(graphics,arrows)
importFrom(graphics,barplot)
importFrom(graphics,boxplot)
importFrom(graphics,hist)
importFrom(graphics,legend)
importFrom(graphics,lines)
Expand Down Expand Up @@ -91,6 +92,7 @@ importFrom(stats,dist)
importFrom(stats,dnbinom)
importFrom(stats,fitted.values)
importFrom(stats,glm)
importFrom(stats,lm)
importFrom(stats,mad)
importFrom(stats,median)
importFrom(stats,model.matrix)
Expand All @@ -101,7 +103,10 @@ importFrom(stats,prcomp)
importFrom(stats,quantile)
importFrom(stats,quasibinomial)
importFrom(stats,sd)
importFrom(stats,setNames)
importFrom(stats,var)
importFrom(utils,capture.output)
importFrom(utils,head)
importFrom(utils,sessionInfo)
importFrom(utils,write.csv)
importFrom(utils,write.table)
3 changes: 2 additions & 1 deletion R/SCONE_DEFAULTS.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ TMM_FN = function(ei) {
return(eo)
}

#' Relative log-expression (RLE; DESeq) scaling normalization wrapper function
#' Relative log-expression (RLE; DESeq) scaling normalization wrapper
#' function
#' @importFrom edgeR calcNormFactors
#' @details SCONE scaling wrapper for \code{\link[edgeR]{calcNormFactors}}).
#' @export
Expand Down
19 changes: 11 additions & 8 deletions R/sconeReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#'
#' @importFrom RColorBrewer brewer.pal
#' @importFrom rARPACK svds
#' @importFrom graphics boxplot
#' @importFrom utils write.csv
#' @importFrom stats setNames var
#' @export
#'
#' @return An object that represents the SCONE report app.
Expand Down Expand Up @@ -66,15 +69,15 @@ sconeReport = function(x, methods,
stop("reshape2 package needed for sconeReport()")
}

if (!require("plotly", quietly = TRUE)) {
if (!requireNamespace("plotly", quietly = TRUE)) {
stop("plotly package needed for sconeReport()")
}

if (!require("visNetwork", quietly = TRUE)) {
if (!requireNamespace("visNetwork", quietly = TRUE)) {
stop("visNetwork package needed for sconeReport()")
}

if (!require("ggplot2", quietly = TRUE)) {
if (!requireNamespace("ggplot2", quietly = TRUE)) {
stop("ggplot2 package needed for sconeReport()")
}

Expand Down Expand Up @@ -223,18 +226,18 @@ sconeReport = function(x, methods,
),
shiny::tabPanel("PCA",
shiny::br(),
shiny::p(paste0("This panel shows principal ",
shiny::p(paste0("This panel shows principal ",
"component analysis ",
"(PCA) results",
" on different subsets ",
"of genes.")),
shiny::br(),
shiny::h6("Variance Explained (All Genes)"),
shiny::h6("Variance Explained (All Genes)"),
shiny::p(paste0("Use this plot",
" to decide on the ",
"dimensionality of the reduced",
" spaced used for evaluation.")),
shiny::plotOutput("plot_scree",width = "650px",
shiny::plotOutput("plot_scree",width = "650px",
height = "400px"),
shiny::br(),
shiny::h6("2D (All Genes)"),
Expand Down Expand Up @@ -264,7 +267,7 @@ sconeReport = function(x, methods,
),
shiny::tabPanel("QC",
shiny::br(),
shiny::p(paste0("This panel shows the absolute",
shiny::p(paste0("This panel shows the absolute",
" correlations between",
" Principal",
" Components (PCs) of",
Expand Down Expand Up @@ -326,7 +329,7 @@ sconeReport = function(x, methods,
),
shiny::tabPanel("Control Genes",
shiny::br(),
shiny::p(paste0("Heatmap of control genes, ",
shiny::p(paste0("Heatmap of control genes, ",
"colored by all",
" three categories.")),
shiny::br(),
Expand Down
10 changes: 7 additions & 3 deletions R/scone_eval.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#' @importFrom cluster silhouette
#' @importFrom rARPACK svds
#' @importFrom matrixStats rowMedians colMedians colIQRs
#' @importFrom stats lm
#'
#' @export
#'
Expand Down Expand Up @@ -269,23 +270,26 @@ score_matrix <- function(expr,
# Max cor with quality factors.
if (!is.null(qc_factors)) {
EXP_QC_COR <-
EXP_QC_COR + cond_w * (1 - sum(unlist(apply(proj[is_cond,], 2, function(y) {
EXP_QC_COR + cond_w * (1 - sum(unlist(apply(proj[is_cond,], 2,
function(y) {
lm(y ~ qc_factors[is_cond,])$residual
})) ^ 2) / sum(scale(proj[is_cond,], scale = FALSE) ^ 2))
}

# Max cor with UV factors.
if (!is.null(uv_factors)) {
EXP_UV_COR <-
EXP_UV_COR + cond_w * (1 - sum(unlist(apply(proj[is_cond,], 2, function(y) {
EXP_UV_COR + cond_w * (1 - sum(unlist(apply(proj[is_cond,], 2,
function(y) {
lm(y ~ uv_factors[is_cond,])$residual
})) ^ 2) / sum(scale(proj[is_cond,], scale = FALSE) ^ 2))
}

# Max cor with WV factors.
if (!is.null(wv_factors)) {
EXP_WV_COR <-
EXP_WV_COR + cond_w * (1 - sum(unlist(apply(proj[is_cond,], 2, function(y) {
EXP_WV_COR + cond_w * (1 - sum(unlist(apply(proj[is_cond,], 2,
function(y) {
lm(y ~ wv_factors[is_cond,])$residual
})) ^ 2) / sum(scale(proj[is_cond,], scale = FALSE) ^ 2))
}
Expand Down
4 changes: 2 additions & 2 deletions R/ziber.R
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ impute_null <- function(expression,impute_args) {
#' \item{p_nodrop}{ 1 - the probability P(drop|Y), useful as weights in
#' weighted PCA} \item{expected_state}{ the expected
#' value E[Z] (1 = "on")} \item{loglik}{ the log-likelihood}
#' \item{convergence}{for all genes, 0 if the algorithm converged and 1 if maxiter was
#' reached} }
#' \item{convergence}{for all genes, 0 if the algorithm converged and
#' 1 if maxiter was reached} }
#'
#' @examples
#' mat <- matrix(rpois(1000, lambda = 3), ncol=10)
Expand Down
7 changes: 7 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Changes in version 1.1.3 (2018-10-19)
========================

* Modified COR scores to reflect R^2 for regression on UV/WV/QC rather than max correlation.
* Bug fix for shiny report.
* Updated vignette.

Changes in version 1.1.2 (2017-7-3)
========================

Expand Down
6 changes: 4 additions & 2 deletions man/DESEQ_FN.Rd

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

4 changes: 2 additions & 2 deletions man/fast_estimate_ziber.Rd

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

0 comments on commit af3da30

Please sign in to comment.