Skip to content

Commit

Permalink
Merge branch 'dev' into dev2
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed Sep 27, 2024
2 parents e349633 + 3d4ea18 commit 32dbe2b
Show file tree
Hide file tree
Showing 63 changed files with 10,136 additions and 9,158 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
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
11 changes: 6 additions & 5 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.5
Authors@R: c(
person("Ruben", "Dries", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7650-7754")),
Expand Down Expand Up @@ -32,14 +32,13 @@ Imports:
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 Down Expand Up @@ -91,14 +90,16 @@ Collate:
'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
7 changes: 6 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(print,giotto_plot_save_param)
export("sankeyLabel<-")
export(FSV_show)
export(addGiottoImageToSpatPlot)
Expand All @@ -14,6 +15,7 @@ export(dimGenePlot3D)
export(dimPlot)
export(dimPlot2D)
export(dimPlot3D)
export(dotPlot)
export(expand_feature_info)
export(geom_label_repel)
export(geom_text_repel)
Expand All @@ -23,6 +25,7 @@ export(getRainbowColors)
export(get_continuous_colors)
export(gg_simple_scatter)
export(giottoSankeyPlan)
export(gpsparam)
export(mixHSV)
export(mixRGB)
export(pal_names)
Expand All @@ -39,6 +42,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 +93,7 @@ export(spatPlot)
export(spatPlot2D)
export(spatPlot3D)
export(subsetSankeySet)
export(theme_dark)
export(violinPlot)
exportClasses(giottoSankeyPlan)
exportMethods("+")
Expand All @@ -108,6 +113,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 +124,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
12 changes: 11 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@

# GiottoVisuals 0.2.4
# 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)

## enhancements
- `giottoLargeImage` `max_window` and `colors` slot info is now followed during ggplot plotting
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 32dbe2b

Please sign in to comment.