Skip to content

Commit

Permalink
Merge pull request #87 from drieslab/dev
Browse files Browse the repository at this point in the history
GiottoVisuals 0.2.6
  • Loading branch information
jiajic authored Oct 27, 2024
2 parents 1d2d7f5 + eeddaf5 commit a37b74d
Show file tree
Hide file tree
Showing 72 changed files with 10,485 additions and 9,177 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^docs$
^pkgdown$
^\.github$
testout
16 changes: 8 additions & 8 deletions .github/workflows/check-bioc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: '4.3', bioc: '3.18', cont: "bioconductor/bioconductor_docker:RELEASE_3_18", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
- { os: macOS-latest, r: '4.3', bioc: '3.18'}
- { os: windows-latest, r: '4.3', bioc: '3.18'}
- { os: ubuntu-latest, r: '4.4', bioc: '3.19', cont: "bioconductor/bioconductor_docker:RELEASE_3_19", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
- { os: macOS-latest, r: '4.4', bioc: '3.19'}
- { os: windows-latest, r: '4.4', bioc: '3.19'}
## Check https://github.com/r-lib/actions/tree/master/examples
## for examples using the http-user-agent
env:
Expand Down Expand Up @@ -105,16 +105,16 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_18-r-4.3-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_18-r-4.3-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-

- name: Cache R packages on Linux
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
uses: actions/cache@v4
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_18-r-4.3-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_18-r-4.3-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-

# - name: Install Linux system dependencies
# if: runner.os == 'Linux'
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-biocversion-RELEASE_3_18-r-4.3-results
name: ${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-results
path: check


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/covr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: code coverage

on:
push:
branches: [ "dev2" ]
branches: [ "dev" ]
pull_request:
types: closed
branches: [ "main" ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
name: Dev Workflow - Test and check
on:
push:
branches: [ "dev2" ]
branches: [ "dev" ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lintr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ name: lintr

on:
push:
branches: [ "dev2" ]
branches: [ "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "dev2" ]
branches: [ "dev" ]
schedule:
- cron: '16 20 * * 2'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ inst/doc
.vscode/*
.Rprofile
docs
testout
19 changes: 9 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: GiottoVisuals
Title: Visuals for the Giotto spatial biology analysis ecosystem
Version: 0.2.4
Version: 0.2.6
Authors@R: c(
person("Ruben", "Dries", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7650-7754")),
Expand All @@ -23,23 +23,19 @@ BugReports: https://github.com/drieslab/Giotto/issues
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Depends:
base (>= 4.1.0),
utils (>= 4.1.0),
R (>= 4.1.0),
R (>= 4.4.1)
Imports:
checkmate,
colorRamp2,
cowplot (>= 0.9.4),
data.table,
ggplot2 (>= 3.1.1),
GiottoUtils (>= 0.1.8),
GiottoClass (>= 0.3.1),
GiottoUtils (>= 0.1.12),
GiottoClass (>= 0.3.6),
ggrepel,
igraph (>= 1.2.4.1),
methods,
plotly,
RColorBrewer (>= 1.1-2),
reshape2,
scales (>= 1.0.0),
scattermore,
stats,
Expand All @@ -53,14 +49,14 @@ Suggests:
ggsci,
GiottoData,
htmlwidgets,
Matrix,
networkD3,
NineteenEightyR,
nord,
palr,
palettetown,
png,
rcartocolor,
RColorBrewer (>= 1.1-2),
remotes,
scatterpie,
tiff,
Expand All @@ -86,19 +82,22 @@ Collate:
'generics.R'
'gg_annotation_raster.R'
'gg_info_layers.R'
'gg_param.R'
'gg_settings.R'
'globals.R'
'gstop.R'
'mixcolor.R'
'plot_dendrogram.R'
'plot_dotplot.R'
'plot_heatmap.R'
'plot_sankey.R'
'plot_scatter.R'
'plot_violin.R'
'spatialDE_visuals.R'
'suite_reexports.R'
'vis_spatial.R'
'vis_spatial_gg.R'
'vis_spatial_in_situ.R'
'vis_spatial_plotly.R'
'viz_spatial_network.R'
'zzz.R'
biocViews: Software, Technology, Spatial
Expand Down
10 changes: 8 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by roxygen2: do not edit by hand

S3method(print,giotto_plot_save_param)
export("sankeyLabel<-")
export(FSV_show)
export(addGiottoImageToSpatPlot)
export(all_plots_save_function)
export(colorRamp2)
export(combine_aes)
export(create_cluster_dendrogram)
export(dimCellPlot)
export(dimCellPlot2D)
Expand All @@ -14,15 +16,18 @@ export(dimGenePlot3D)
export(dimPlot)
export(dimPlot2D)
export(dimPlot3D)
export(dotPlot)
export(expand_feature_info)
export(geom_label_repel)
export(geom_text_repel)
export(getColors)
export(getDistinctColors)
export(getRainbowColors)
export(get_continuous_colors)
export(gg_param)
export(gg_simple_scatter)
export(giottoSankeyPlan)
export(gpsparam)
export(mixHSV)
export(mixRGB)
export(pal_names)
Expand All @@ -39,6 +44,7 @@ export(plotTSNE_3D)
export(plotUMAP)
export(plotUMAP_2D)
export(plotUMAP_3D)
export(plot_grid)
export(plot_output_handler)
export(plotly_axis_scale_2D)
export(plotly_axis_scale_3D)
Expand Down Expand Up @@ -89,6 +95,7 @@ export(spatPlot)
export(spatPlot2D)
export(spatPlot3D)
export(subsetSankeySet)
export(theme_dark2)
export(violinPlot)
exportClasses(giottoSankeyPlan)
exportMethods("+")
Expand All @@ -98,7 +105,6 @@ exportMethods(sankeyPlot)
exportMethods(sankeyRelate)
import(GiottoClass)
import(GiottoUtils)
import(RColorBrewer)
import(cowplot)
import(ggplot2)
import(ggrepel)
Expand All @@ -108,6 +114,7 @@ importClassesFrom(data.table,data.table)
importFrom(GiottoUtils,getDistinctColors)
importFrom(GiottoUtils,getRainbowColors)
importFrom(colorRamp2,colorRamp2)
importFrom(cowplot,plot_grid)
importFrom(data.table,dcast)
importFrom(data.table,dcast.data.table)
importFrom(ggrepel,geom_label_repel)
Expand All @@ -118,7 +125,6 @@ importFrom(methods,setGeneric)
importFrom(methods,setMethod)
importFrom(methods,slot)
importFrom(plotly,add_segments)
importFrom(reshape2,melt)
importFrom(scales,rescale_mid)
importFrom(stats,cov)
importFrom(stats,var)
Expand Down
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# GiottoVisuals 0.2.6 (2024/10/27)

## new
- `combine_aes()` for combining ggplot2 mappings in a last item wins manner. Allows more than 2 aes to be combined at the same time and provides an optional informative warning
- `gg_params()` for combining and sorting ggplot2 mappings, toplevel params, and data into an arg list for plotting.


# GiottoVisuals 0.2.5 (2024/09/27)

## new
- `gpsparam()` for generating an object containing plot saving parameters
- `cowplot::plot_grid()` re-exported
- `dotPlot()` visualization

## bug fixes
- fix `coord_fix_ratio` passing in `spatFeatPlot2D()` [#972](https://github.com/drieslab/Giotto/issues/972) by kaizen89

# GiottoVisuals 0.2.4 (2024/07/26)

Expand Down
52 changes: 19 additions & 33 deletions R/aux_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#' @examples
#' g <- GiottoData::loadGiottoMini("vizgen")
#' g_spatplot <- spatPlot2D(g, return_plot = TRUE)
#'
#'
#' plot_output_handler(g, plot_object = g_spatplot, save_plot = FALSE)
#'
#'
#' @export
plot_output_handler <- function(
gobject,
Expand All @@ -41,22 +41,12 @@ plot_output_handler <- function(
checkmate::assert_class(gobject, "giotto")

## output settings detection ##
# IF setting is NULL then the appropriate setting from gobject instructions
# will be checked and used.
# IF setting is NOT NULL then the provided value will be used directly.
show_plot <- ifelse(is.null(show_plot),
readGiottoInstructions(gobject, param = "show_plot"),
show_plot
)
save_plot <- ifelse(is.null(save_plot),
readGiottoInstructions(gobject, param = "save_plot"),
save_plot
)
return_plot <- ifelse(is.null(return_plot),
readGiottoInstructions(gobject, param = "return_plot"),
return_plot
)
show_plot <- show_plot %null% instructions(gobject, param = "show_plot")
save_plot <- save_plot %null% instructions(gobject, param = "save_plot")
return_plot <- return_plot %null%
instructions(gobject, param = "return_plot")

## handle outputs --------------------------------------------------- ##

## print plot ##
if (show_plot) {
Expand All @@ -67,18 +57,14 @@ plot_output_handler <- function(
if (save_plot) {
checkmate::assert_character(default_save_name)
checkmate::assert_list(save_param)

do.call(
"all_plots_save_function",
c(
list(
gobject = gobject,
plot_object = plot_object,
default_save_name = default_save_name
),
save_param
)

data_param <- list(
gobject = gobject,
plot_object = plot_object,
default_save_name = default_save_name
)

do.call("all_plots_save_function", args = c(data_param, save_param))
}

## return plot ##
Expand All @@ -103,9 +89,9 @@ plot_output_handler <- function(
# checkmate::assert_class(gobject, 'giotto')
# checkmate::assert_character(default_save_name)
# checkmate::assert_list(save_param)
#
#
# instr = instructions(gobject)
#
#
# ## output settings detection ##
# # IF setting is NA then the appropriate setting from gobject instructions
# # will be checked and used.
Expand All @@ -121,12 +107,12 @@ plot_output_handler <- function(

# plot_output_handler_do = function(gplot_out) {
# checkmate::assert_class(gplot_out, 'giottoPlotOutput')
#
#
# ## print plot ##
# if(gplot_out$show_plot) {
# print(gplot_out$plot_object)
# }
#
#
# ## save plot ##
# if(gplot_out$save_plot) {
# do.call('all_plots_save_function',
Expand All @@ -136,7 +122,7 @@ plot_output_handler <- function(
# save_param)
# )
# }
#
#
# ## return plot ##
# if(return_plot) {
# invisible(return(plot_object))
Expand Down
Loading

0 comments on commit a37b74d

Please sign in to comment.