-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
901 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ vignettes/figure | |
*.Rproj | ||
vignettes/R_cache | ||
vignettes/R_figure | ||
old_scripts | ||
old_scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ language: r | |
cache: packages | ||
|
||
# R versions to be tested on | ||
r: | ||
r: | ||
- bioc-release | ||
- bioc-devel | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,44 @@ | ||
Package: scone | ||
Version: 0.0.5 | ||
Version: 0.0.6 | ||
Title: Single Cell Overview of Normalized Expression data | ||
Description: scone is a package to compare and rank the performance of different normalization schemes in real single-cell RNA-seq datasets. | ||
Authors@R: c(person("Michael", "Cole", email = "mbeloc@gmail.com", | ||
role = c("aut", "cre", "cph")), | ||
person("Davide", "Risso", email = "risso.davide@gmail.com", | ||
role = c("aut"))) | ||
Author: Michael Cole [aut, cre, cph], Davide Risso [aut] | ||
role = c("aut", "cph"))) | ||
Author: Michael Cole [aut, cre, cph], Davide Risso [aut, cph] | ||
Maintainer: Michael Cole <mbeloc@gmail.com> | ||
Date: 2016-05-12 | ||
Date: 2016-07-22 | ||
License: Artistic-2.0 | ||
Depends: | ||
R (>= 3.3) | ||
Imports: | ||
aroma.light, | ||
BiocParallel, | ||
class, | ||
cluster, | ||
DESeq, | ||
EDASeq, | ||
MASS, | ||
RUVSeq, | ||
aroma.light, | ||
class, | ||
diptest, | ||
EDASeq, | ||
edgeR, | ||
fpc, | ||
gplots, | ||
grDevices, | ||
limma, | ||
MASS, | ||
matrixStats, | ||
mixtools, | ||
grDevices | ||
grDevices, | ||
boot, | ||
shiny, | ||
miniUI, | ||
rhdf5, | ||
RUVSeq | ||
Suggests: | ||
knitr, | ||
rmarkdown, | ||
testthat | ||
VignetteBuilder: knitr | ||
LazyLoad: yes | ||
BugReports: https://github.com/epurdom/clusterExperiment/issues | ||
BugReports: https://github.com/YosefLab/scone/issues | ||
RoxygenNote: 5.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#' Interactive biplot | ||
#' | ||
#' This is a wrapper around \code{\link{biplot_colored}}, which creates a shiny | ||
#' gadget to allow the user to select specific points in the graph. | ||
#' | ||
#' @details Since this is based on the shiny gadget feature, it will not work in | ||
#' static documents, such as vignettes or markdown / knitr documents. | ||
#' See \code{biplot_colored} for more details on the internals. | ||
#' | ||
#' @param data a data.frame containing the data to be plotted. | ||
#' @param scores a numeric vector used to color the points. | ||
#' | ||
#' @importFrom miniUI gadgetTitleBar miniContentPanel miniPage gadgetTitleBar | ||
#' @importFrom shiny plotOutput renderPlot observeEvent brushedPoints runGadget verbatimTextOutput stopApp renderText | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' mat <- matrix(rnorm(1000), ncol=10) | ||
#' colnames(mat) <- paste("X", 1:ncol(mat), sep="") | ||
#' | ||
#' biplot_interactive(mat, mat[,1]) | ||
#' } | ||
biplot_interactive <- function(data, scores, ...) { | ||
|
||
data <- as.data.frame(data) | ||
scores <- as.numeric(scores) | ||
|
||
ui <- miniPage( | ||
gadgetTitleBar("Drag to select points"), | ||
miniContentPanel( | ||
# The brush="brush" argument means we can listen for | ||
# brush events on the plot using input$brush. | ||
plotOutput("plot1", height = "80%", brush = "plot_brush"), | ||
verbatimTextOutput("info") | ||
) | ||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
# Compute PCA | ||
pc_obj <- prcomp(data, center = TRUE, scale = FALSE) | ||
bp_obj <- biplot_colored(pc_obj, y = scores) | ||
|
||
# Render the plot | ||
output$plot1 <- renderPlot({ | ||
# Biplot | ||
biplot_colored(pc_obj, y = scores, ...) | ||
}) | ||
|
||
data_out <- cbind(data, bp_obj) | ||
|
||
output$info <- renderText({ | ||
xy_range_str <- function(e) { | ||
if(is.null(e)) return("NULL\n") | ||
idx <- which(bp_obj[,1] >= e$xmin & bp_obj[,1] <= e$xmax & | ||
bp_obj[,2] >= e$ymin & bp_obj[,2] <= e$ymax) | ||
paste0(rownames(data)[idx], collapse = "\n") | ||
} | ||
xy_range_str(input$plot_brush) | ||
}) | ||
|
||
# Handle the Done button being pressed. | ||
observeEvent(input$done, { | ||
# Return the brushed points. See ?shiny::brushedPoints. | ||
stopApp(brushedPoints(data_out, input$plot_brush, xvar="PC1", yvar="PC2")) | ||
}) | ||
} | ||
|
||
runGadget(ui, server) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.