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

GiottoVisuals 0.2.6 #87

Merged
merged 57 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8804b9e
update bioc version for bioc github check
josschavezf Jun 12, 2024
cf584c3
Merge branch 'drieslab:dev' into dev
josschavezf Jul 11, 2024
88a9c12
Update roxygen version
josschavezf Jul 11, 2024
bd05107
Merge branch 'dev' of https://github.com/josschavezf/GiottoVisuals in…
josschavezf Jul 30, 2024
dd673af
chore: update docs
jiajic Jul 31, 2024
55badc7
refactor: save option setting
jiajic Aug 15, 2024
1be673b
chore: move code around
jiajic Aug 15, 2024
befbf25
refactor: plot_output_handler
jiajic Aug 15, 2024
f1ce709
Merge branch 'dev' of https://github.com/josschavezf/GiottoVisuals in…
josschavezf Aug 16, 2024
7240c42
run devtools::document
josschavezf Aug 16, 2024
5323a76
Merge pull request #81 from josschavezf/dev
josschavezf Aug 16, 2024
30bb76a
chore: formatting
jiajic Aug 22, 2024
094a5f2
chore: add plot save testing
jiajic Aug 22, 2024
6cd0c66
refactor: plot output and saving
jiajic Sep 5, 2024
ee912aa
chore: docs
jiajic Sep 5, 2024
68de741
chore: change param name
jiajic Sep 5, 2024
9a832fe
Merge pull request #85 from jiajic/refactor_plot_output
jiajic Sep 5, 2024
4d4f155
fix: verbose detection
jiajic Sep 5, 2024
a0417a6
enh: update aux_save.R
jiajic Sep 5, 2024
6082427
chore: update deps
jiajic Sep 5, 2024
fcaf820
chore: docs
jiajic Sep 5, 2024
60faa99
chore: code reorganization
jiajic Sep 5, 2024
dde597d
chore: styler
jiajic Sep 5, 2024
6525006
chore: docs
jiajic Sep 5, 2024
81a5493
chore: fix name collision
jiajic Sep 5, 2024
206e1f2
change param name
jiajic Sep 6, 2024
dacff9f
re-export cowplot plot grid
jiajic Sep 6, 2024
dcf1fa8
fix: coord_fix_ratio passing
jiajic Sep 6, 2024
9eae1c9
chore: remove `reshape2` dependency
jiajic Sep 11, 2024
0d44b71
chore: update accessors used
jiajic Sep 12, 2024
1a8878d
Update gg_annotation_raster.R
jiajic Sep 12, 2024
ea002e2
chore: comments
jiajic Sep 26, 2024
e503439
change: poly color back to grey
jiajic Sep 26, 2024
d9aa800
enh: .gg_theme
jiajic Sep 26, 2024
a20b015
feat: theme_dark
jiajic Sep 26, 2024
f14a7e1
feat: `dotPlot()`
jiajic Sep 26, 2024
9247ce5
Merge pull request #86 from jiajic/dplot
jiajic Sep 26, 2024
e138b12
chore: update news
jiajic Sep 26, 2024
3be02c4
chore: docs
jiajic Sep 26, 2024
41be022
enh: `dotPlot()`
jiajic Sep 27, 2024
4d906f4
chore: docs
jiajic Sep 27, 2024
3d4ea18
Update NEWS.md
jiajic Sep 27, 2024
1216dd2
chore: update naming to avoid overlapping
jiajic Oct 4, 2024
547c829
chore: swap to scales usage
jiajic Oct 8, 2024
d1ee531
chore: remove commented ref to `combineSpatialCellFeatureInfo()`
jiajic Oct 15, 2024
4056400
!feat: drop RColorBrewer dep
jiajic Oct 25, 2024
4c86f4b
chore: remove unused Matrix pkg from suggests
jiajic Oct 25, 2024
6692e91
chore: cleanup code
jiajic Oct 25, 2024
acc3c8d
chore: remove colorbrewer from pkg imports
jiajic Oct 25, 2024
556955a
feat: gg_aes and gg_param utilities
jiajic Oct 25, 2024
8d9edc4
chore: docs
jiajic Oct 27, 2024
58ac019
chore: cleanup deps
jiajic Oct 27, 2024
61f2603
chore: fix docs and examples
jiajic Oct 27, 2024
1343525
chore: update news
jiajic Oct 27, 2024
6cf841a
chore: bump version for dev
jiajic Oct 27, 2024
8faa952
chore: fix scoping issue in examples
jiajic Oct 27, 2024
eeddaf5
fix merge conflict
jiajic Oct 27, 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
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 @@
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")

Check notice

Code scanning / lintr

Indentation should be 4 spaces but is 8 spaces. Note

Indentation should be 4 spaces but is 8 spaces.

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

Check notice

Code scanning / lintr

Indentation should be 2 spaces but is 4 spaces. Note

Indentation should be 2 spaces but is 4 spaces.

## print plot ##
if (show_plot) {
Expand All @@ -67,18 +57,14 @@
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(

Check notice

Code scanning / lintr

Indentation should be 4 spaces but is 8 spaces. Note

Indentation should be 4 spaces but is 8 spaces.
gobject = gobject,

Check notice

Code scanning / lintr

Indentation should be 6 spaces but is 12 spaces. Note

Indentation should be 6 spaces but is 12 spaces.
plot_object = plot_object,
default_save_name = default_save_name
)

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

Check notice

Code scanning / lintr

Indentation should be 4 spaces but is 8 spaces. Note

Indentation should be 4 spaces but is 8 spaces.
}

## return plot ##
Expand All @@ -103,9 +89,9 @@
# 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_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 @@
# save_param)
# )
# }
#
#
# ## return plot ##
# if(return_plot) {
# invisible(return(plot_object))
Expand Down
Loading
Loading