-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from HelenaLC/shape_table
'table's support for 'plotShape's; fixes related to moving 'instance/region_key' to 'int_colData'
- Loading branch information
Showing
13 changed files
with
219 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# convenience functions until this is fixed/exported by 'SpatialData' | ||
|
||
#' @importFrom methods is | ||
#' @importFrom SingleCellExperiment int_metadata | ||
.spatialdata_attrs <- \(x) { | ||
if (is(x, "SingleCellExperiment")) { | ||
int_metadata(x)$spatialdata_attrs | ||
} else if (is(x, "SpatialDataElement")) { | ||
meta(x)$spatialdata_attrs | ||
} else if (is(x, "Zattrs")) { | ||
x$spatialdata_attrs | ||
} else stop("invalid 'x'") | ||
} | ||
|
||
.instance_key <- \(x) .spatialdata_attrs(x)$instance_key | ||
.region_key <- \(x) .spatialdata_attrs(x)$region_key | ||
.region <- \(x) .spatialdata_attrs(x)$region | ||
|
||
#' @importFrom SingleCellExperiment int_colData | ||
.instance_ids <- \(x) int_colData(x)[[.instance_key(x)]] | ||
|
||
#' @importFrom grDevices col2rgb | ||
.str_is_col <- \(x) !inherits(tryCatch(error=\(e) e, col2rgb(x)), "error") | ||
|
||
#' @importFrom ggplot2 | ||
#' coord_equal theme_bw theme | ||
#' element_blank element_text element_line | ||
.theme <- list( | ||
coord_equal(), theme_bw(), theme( | ||
panel.grid=element_blank(), | ||
legend.key=element_blank(), | ||
legend.background=element_blank(), | ||
plot.title=element_text(hjust=0.5), | ||
axis.text=element_text(color="grey"), | ||
axis.ticks=element_line(color="grey")) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
changes in version 0.99.1 | ||
|
||
- various fixes related to moving 'instance/region_key' to 'int_colData' | ||
- added examples of 'mask'ing in the vignette | ||
|
||
changes in version 0.99.0 | ||
|
||
- initialization of 'SpatialData.plot' package |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.