Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade gating #27

Merged
merged 35 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
db05471
Improve gating function backend
william-hutchison May 23, 2024
0c9cc88
Adapt programmatic gating to new format
william-hutchison May 23, 2024
7296ee4
Improve gating interface
william-hutchison May 24, 2024
a4235c1
Improve gating interface
william-hutchison May 30, 2024
e019d9a
Update documentation
william-hutchison Jun 6, 2024
0c6f618
Version up
william-hutchison Jun 6, 2024
12e6000
Improve gating interface
william-hutchison Jun 21, 2024
11ba304
Remove gating with custom plot feature
william-hutchison Jun 21, 2024
6025ecc
Update documentation
william-hutchison Jun 21, 2024
4ac0b38
Add unit test
william-hutchison Jun 21, 2024
43f1094
Deprecate superseded gating functions
william-hutchison Jun 21, 2024
b92590d
Version up
william-hutchison Jun 21, 2024
b80a368
Remove unneeded files
william-hutchison Jun 21, 2024
b98fe92
Update vignette
william-hutchison Jun 21, 2024
8d37a97
Version up
william-hutchison Jun 21, 2024
e769d3f
Change gate output to vector of strings
william-hutchison Jun 24, 2024
21f9fe8
Update depreciation messages
william-hutchison Jun 24, 2024
c5f6f09
Version up
william-hutchison Jun 24, 2024
d492d92
Unify interactive and programmatic functions
william-hutchison Jul 4, 2024
574bbc5
Version up
william-hutchison Jul 4, 2024
c818fc3
Update documentation
william-hutchison Jul 4, 2024
29a9010
Version up
william-hutchison Jul 4, 2024
27f0fb5
Add check for valid input paramaters
william-hutchison Jul 4, 2024
6bfb63a
Remove deprecated guides argument
william-hutchison Jul 4, 2024
5462036
Set Shiny app to launch in RStudio Viewer pane if available
william-hutchison Jul 4, 2024
7c6e4b2
Update documentation
william-hutchison Jul 5, 2024
2d05700
Version up
william-hutchison Jul 5, 2024
1dc025e
Enable numeric vector input to alpha and size parameters
william-hutchison Jul 5, 2024
a8bf221
Version up
william-hutchison Jul 5, 2024
7d26a8b
Replace empty strings in output with NAs
william-hutchison Jul 5, 2024
439581e
Version up
william-hutchison Jul 5, 2024
9151622
Update numeric vector input to alpha and size parameters
william-hutchison Jul 5, 2024
ec37604
Version up
william-hutchison Jul 5, 2024
82c1048
Update README
william-hutchison Jul 5, 2024
e093d61
Version up
william-hutchison Jul 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

24 changes: 14 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
Package: tidygate
Type: Package
Title: Add Gate Information to Your Tibble
Version: 0.5.3
Title: Interactively gate points
Version: 1.0.1
Authors@R:
c(person(given = "Stefano",
family = "Mangiola",
role = c("aut", "cre"),
email = "mangiolastefano@gmail.com"),
person(given = "Wajid",
family = "Jawaid",
role = "ctb"))
role = "ctb"),
person(given = "William",
family = "Hutchison",
role = "aut")
)
Maintainer: Stefano Mangiola <mangiolastefano@gmail.com>
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 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),
dplyr
Imports:
utils,
graphics,
lifecycle,
scales,
magrittr,
tibble,
dplyr,
purrr,
rlang,
tidyr,
Expand Down
28 changes: 20 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,28 @@ S3method(gate_int,numeric)
export(fhs)
export(gate)
export(gate_chr)
export(gate_custom)
export(gate_int)
export(gate_simple)
export(gate_interactive)
export(gate_programmatic)
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,7 +48,6 @@ importFrom(plotly,plotlyOutput)
importFrom(plotly,renderPlotly)
importFrom(purrr,imap)
importFrom(purrr,map)
importFrom(purrr,map_lgl)
importFrom(purrr,pluck)
importFrom(purrr,reduce)
importFrom(purrr,when)
Expand All @@ -57,13 +62,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(stringr,str_split)
importFrom(tibble,tibble)
importFrom(utils,head)
importFrom(viridis,viridis)
10 changes: 10 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@
#'
#'
"gate_list"

#' Demo brush data
#'
#' @keywords data
"demo_brush_data"

#' Demo select data
#'
#' @keywords data
"demo_select_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: wj241@cam.ac.uk
## Date: 14 November 2016
# Author: Wajid Jawaid
# Email: wj241@cam.ac.uk
# 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()")

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
Loading