Skip to content

Commit

Permalink
added launch.browser option
Browse files Browse the repository at this point in the history
  • Loading branch information
pfgherardini committed Aug 15, 2018
1 parent 14a4a9c commit a427ee5
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: premessa
Type: Package
Title: R package for pre-processing of flow and mass cytometry data
Version: 0.2.1
Version: 0.2.2
Author: "Pier Federico Gherardini <pfgherardini@parkerici.org> [aut, cre]"
Description: This package includes panel editing/renaming for FCS files, bead-based normalization and debarcoding.
Imports: shiny (>= 0.14), flowCore, reshape, ggplot2, hexbin, gridExtra, rhandsontable, jsonlite
Expand Down
6 changes: 6 additions & 0 deletions R/normalize_cytof.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ normalize_folder <- function(wd, output.dir.name, beads.gates, beads.type, basel
beads.data <- m[beads.events,]

norm.res <- correct_data_channels(m, beads.data, baseline.data, beads.cols.names)

# Do some cleanup to save memory
fcs <- flowCore::read.FCS(file.path(wd, f.name), which.lines = 1) # We only need the keywords
m <- NULL
gc()

m.normed <- norm.res$m.normed
m.normed <- cbind(m.normed,
beadDist = get_mahalanobis_distance_from_beads(m.normed, beads.events, beads.cols.names))
Expand Down
28 changes: 21 additions & 7 deletions R/shiny_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,38 @@ get_initial_beads_gates <- function(fcs) {
#' the working directory for the software.
#' To stop the software simply hit the "ESC" key in your R session.
#'
#' @param launch.browser Whether to open the GUI in a separate browser window
#' (recommended)
#' @param ... Additional arguments to be passed to \code{shiny::runApp}
#' @export
normalizer_GUI <- function(...) {
shiny::runApp(appDir = file.path(system.file(package = "premessa"), "normalizer_shinyGUI"), ...)
normalizer_GUI <- function(launch.browser = TRUE, ...) {
shiny::runApp(appDir = file.path(system.file(package = "premessa"), "normalizer_shinyGUI"),
launch.browser = launch.browser, ...)
}

#' Starts the debarcoder GUI
#'
#' To stop the software simply hit the "ESC" key in your R session.
#'
#' @param ... Additional arguments to be passed to \code{shiny::runApp}
#' @inheritParams normalizer_GUI
#' @export
debarcoder_GUI <- function(...) {
shiny::runApp(appDir = file.path(system.file(package = "premessa"), "debarcoder_shinyGUI"), ...)
debarcoder_GUI <- function(launch.browser = TRUE, ...) {
shiny::runApp(appDir = file.path(system.file(package = "premessa"), "debarcoder_shinyGUI"),
launch.browser = launch.browser, ...)
}

#' Starts the panel editor GUI
#'
#' Upon starting, a file selection window will appear from your R session. You should use
#' this window to navigate to the directory containing the data you want to analyze,
#' and select any file in that directory. The directory itself will then become
#' the working directory for the software.
#' To stop the software simply hit the "ESC" key in your R session.
#'
#' @inheritParams normalizer_GUI
#' @export
paneleditor_GUI <- function(...) {
shiny::runApp(appDir = file.path(system.file(package = "premessa"), "paneleditor_shinyGUI"), ...)
paneleditor_GUI <- function(launch.browser = TRUE, ...) {
shiny::runApp(appDir = file.path(system.file(package = "premessa"), "paneleditor_shinyGUI"),
launch.browser = launch.browser, ...)
}

5 changes: 4 additions & 1 deletion man/debarcoder_GUI.Rd

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

5 changes: 4 additions & 1 deletion man/normalizer_GUI.Rd

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

21 changes: 21 additions & 0 deletions man/paneleditor_GUI.Rd

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

0 comments on commit a427ee5

Please sign in to comment.