Skip to content

Commit

Permalink
Merge pull request #27 from william-hutchison/upgrade-gating
Browse files Browse the repository at this point in the history
Upgrade gating
  • Loading branch information
stemangiola authored Jul 5, 2024
2 parents 36e4178 + e093d61 commit 2c90e8b
Show file tree
Hide file tree
Showing 46 changed files with 965 additions and 1,153 deletions.
18 changes: 0 additions & 18 deletions .Rbuildignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$

# Read me
README.Rmd
README_files*
README_cache*

^vignettes/introduction_cache$
^doc$
^Meta$
^codecov\.yml$
^dev$
^README_cache$
^README_files$
README.Rmd
^.git$
.coveralls.yml
.travis.yml
.github
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

41 changes: 0 additions & 41 deletions .gitignore

This file was deleted.

25 changes: 15 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
Package: tidygate
Type: Package
Title: Add Gate Information to Your Tibble
Version: 0.5.3
Title: Interactively gate points
Version: 1.0.9
Authors@R:
c(person(given = "Stefano",
family = "Mangiola",
role = c("aut", "cre"),
email = "[email protected]"),
person(given = "Wajid",
family = "Jawaid",
role = "ctb"))
role = "ctb"),
person(given = "William",
family = "Hutchison",
role = "aut")
)
Maintainer: Stefano Mangiola <[email protected]>
Description: It interactively or programmatically label points within custom gates on two dimensions <https://github.com/stemangiola/tidygate>.
The information is added to your tibble. It is based on the package 'gatepoints' from Wajid Jawaid (who is also author of this package). The code of 'gatepoints' was nto integrated in 'tidygate'.
The benefits are (i) in interactive mode you can draw your gates on extensive 'ggplot'-like scatter plots;
(ii) you can draw multiple gates; and (iii) you can save your gates and apply the programmatically.
Description:
tidygate allows you to interactively gate points on a scatter plot. Interactively drawn gates are
recorded and can be applied programmatically to reproduce results exactly. Programmatic gating is
based on the package gatepoints by Wajid Jawaid (who is also an author of this package).
License: GPL-3
Depends:
R (>= 3.6.0)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
Depends:
R (>= 3.6.0)
Imports:
utils,
graphics,
Expand All @@ -43,7 +47,8 @@ RdMacros: lifecycle
Suggests:
testthat,
markdown,
knitr
knitr,
readr
VignetteBuilder:
knitr
Biarch: true
Expand Down
33 changes: 23 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# Generated by roxygen2: do not edit by hand

S3method(gate,spec_tbl_df)
S3method(gate,tbl_df)
S3method(gate_chr,numeric)
S3method(gate_int,numeric)
export(fhs)
export(gate)
export(gate.spec_tbl_df)
export(gate.tbl_df)
export(gate_chr)
export(gate_custom)
export(gate_int)
export(gate_simple)
export(gate_old)
export(server)
export(ui)
import(dplyr)
import(tibble)
import(tidyr)
importFrom(RColorBrewer,brewer.pal)
importFrom(dplyr,group_by)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,pull)
importFrom(dplyr,summarise)
importFrom(ggplot2,aes)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggplot_build)
importFrom(ggplot2,guides)
importFrom(ggplot2,scale_alpha_manual)
importFrom(ggplot2,scale_colour_manual)
importFrom(ggplot2,scale_shape_manual)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_bw)
importFrom(grDevices,colorRampPalette)
importFrom(graphics,axis)
Expand All @@ -42,13 +47,14 @@ importFrom(plotly,plotlyOutput)
importFrom(plotly,renderPlotly)
importFrom(purrr,imap)
importFrom(purrr,map)
importFrom(purrr,map_lgl)
importFrom(purrr,map_chr)
importFrom(purrr,pluck)
importFrom(purrr,reduce)
importFrom(purrr,when)
importFrom(rlang,":=")
importFrom(rlang,enquo)
importFrom(rlang,env)
importFrom(rlang,eval_tidy)
importFrom(rlang,quo_is_null)
importFrom(rlang,quo_is_symbol)
importFrom(rlang,quo_is_symbolic)
Expand All @@ -57,13 +63,20 @@ importFrom(rlang,quo_squash)
importFrom(scales,alpha)
importFrom(scales,rescale)
importFrom(shiny,actionButton)
importFrom(shiny,br)
importFrom(shiny,column)
importFrom(shiny,fluidPage)
importFrom(shiny,observe)
importFrom(shiny,fluidRow)
importFrom(shiny,h2)
importFrom(shiny,h5)
importFrom(shiny,observeEvent)
importFrom(shiny,renderPrint)
importFrom(shiny,runApp)
importFrom(shiny,shinyApp)
importFrom(shiny,stopApp)
importFrom(shiny,verbatimTextOutput)
importFrom(stringr,str_pad)
importFrom(tibble,as_tibble)
importFrom(tibble,tibble)
importFrom(utils,globalVariables)
importFrom(utils,head)
importFrom(viridis,viridis)
5 changes: 5 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
#'
#'
"gate_list"

#' Demo gate data
#'
#' @keywords data
"demo_gate_data"
17 changes: 10 additions & 7 deletions R/fhs.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Author: Wajid Jawaid
## Email: [email protected]
## Date: 14 November 2016
# Author: Wajid Jawaid
# Email: [email protected]
# Date: 14 November 2016

##' Freehand select
##'
##' Freehand select function. First generate a 2D plot using R's plot function,
##' then select gate region by left clicking. Close polygon by right clicking.
#' Freehand select
#'
#' Freehand select function. First generate a 2D plot using R's plot function,
#' then select gate region by left clicking. Close polygon by right clicking.
##' The function will return the rownames of the enclosed points by the rownames
##' of th co-ordinates given in \code{data}.
##' @title Freehand select
Expand All @@ -19,6 +19,7 @@
##' names parameter is TRUE. If names is FALSE then a logical vector indicating whether points
##' are in the polygon is returned.
##' @author Wajid Jawaid
##' @importFrom lifecycle deprecate_warn
##' @export
##' @examples
##' \dontrun{
Expand All @@ -29,6 +30,8 @@
##' }
##' @importFrom graphics locator lines points
fhs <- function(data, mark = TRUE, names = TRUE, ...) {
lifecycle::deprecate_warn("1.0.0", "tidygate::fhs()", with = "tidygate::gate()")

cat("Mark region on plot.\n")
if (!(is.data.frame(data) || is.matrix(data))) stop("data must be a data frame or matrix")
if (is.null(rownames(data))) rownames(data) <- 1:nrow(data)
Expand Down
4 changes: 2 additions & 2 deletions R/functions_OLD.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pretty_plot = function(.data,
#'
#' @return A tibble with additional columns
#'
gate_interactive <-
gate_interactive_old <-
function(.data,
.element,
.dim1,
Expand Down Expand Up @@ -350,7 +350,7 @@ gate_interactive <-
#'
#' @return A tibble with additional columns
#'
gate_programmatic <-
gate_programmatic_old <-
function(.data,
.element,
.dim1,
Expand Down
Loading

0 comments on commit 2c90e8b

Please sign in to comment.