Skip to content

Commit 42e721a

Browse files
committed
Pass R CMD check on my machine
1 parent 6dfaa34 commit 42e721a

14 files changed

+3348
-2209
lines changed

DESCRIPTION

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
Package: Voyager
22
Type: Package
33
Title: From geospatial to spatial omics
4-
Version: 1.5.0
4+
Version: 1.5.1
55
Authors@R:
66
c(person("Lambda", "Moses", email = "[email protected]",
77
role = c("aut", "cre"),
88
comment = c(ORCID = "0000-0002-7092-9427")),
9+
person("Alik", "Huseynov",
10+
comment = c(ORCID = "0000-0002-1438-4389"),
11+
role = "aut"),
912
person("Kayla", "Jackson", email = "[email protected]",
1013
role = c("aut"),
1114
comment = c(ORCID = "0000-0001-6483-0108")),

NAMESPACE

+7
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ importFrom(RSpectra,eigs_sym)
7878
importFrom(S4Vectors,"metadata<-")
7979
importFrom(S4Vectors,DataFrame)
8080
importFrom(S4Vectors,Rle)
81+
importFrom(S4Vectors,combineCols)
8182
importFrom(S4Vectors,make_zero_col_DFrame)
8283
importFrom(S4Vectors,metadata)
8384
importFrom(SingleCellExperiment,"int_colData<-")
@@ -106,10 +107,13 @@ importFrom(SpatialFeatureExperiment,colFeatureData)
106107
importFrom(SpatialFeatureExperiment,colGeometry)
107108
importFrom(SpatialFeatureExperiment,colGraph)
108109
importFrom(SpatialFeatureExperiment,colGraphs)
110+
importFrom(SpatialFeatureExperiment,cropImg)
109111
importFrom(SpatialFeatureExperiment,df2sf)
110112
importFrom(SpatialFeatureExperiment,ext)
111113
importFrom(SpatialFeatureExperiment,geometryFeatureData)
114+
importFrom(SpatialFeatureExperiment,getParams)
112115
importFrom(SpatialFeatureExperiment,getPixelSize)
116+
importFrom(SpatialFeatureExperiment,imageIDs)
113117
importFrom(SpatialFeatureExperiment,imgSource)
114118
importFrom(SpatialFeatureExperiment,isFull)
115119
importFrom(SpatialFeatureExperiment,localResult)
@@ -120,6 +124,8 @@ importFrom(SpatialFeatureExperiment,rowGeometry)
120124
importFrom(SpatialFeatureExperiment,sampleIDs)
121125
importFrom(SpatialFeatureExperiment,spatialGraph)
122126
importFrom(SpatialFeatureExperiment,spatialGraphs)
127+
importFrom(SpatialFeatureExperiment,toSpatRasterImage)
128+
importFrom(SpatialFeatureExperiment,translateImg)
123129
importFrom(SummarizedExperiment,"colData<-")
124130
importFrom(SummarizedExperiment,"rowData<-")
125131
importFrom(SummarizedExperiment,assay)
@@ -212,6 +218,7 @@ importFrom(sf,st_drop_geometry)
212218
importFrom(sf,st_geometry)
213219
importFrom(sf,st_geometry_type)
214220
importFrom(sf,st_intersection)
221+
importFrom(sf,st_sfc)
215222
importFrom(spdep,card)
216223
importFrom(spdep,include.self)
217224
importFrom(spdep,listw2mat)

NEWS.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# Version 1.5.1
1+
# Version 1.6.0 (04/29/2023)
22
* Option to plot polygon geometry without fill in plotGeometry
33
* Option to show axes in both light and dark themes
4+
* Plot images of classes BioFormatsImage and ExtImage
5+
* Colorize image plot with different channels
6+
* Assign different grayscale images to channels
7+
* Added plotImage to only plot image without plotting geometry
48

59
# Version 1.3.1 (05/15/2023)
610
* Removed functions and arguments deprecated in 1.2.0

R/featureData.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
fd
9393
}
9494

95-
#' @importFrom S4Vectors metadata metadata<-
95+
#' @importFrom S4Vectors metadata metadata<- combineCols
9696
.initialize_fd_dimData <- function(x, MARGIN) {
9797
fd_name <- "featureData"
9898
dimData <- switch(MARGIN, rowData, colData)
@@ -103,7 +103,7 @@
103103
# Remove rows that correspond to columns that have been deleted and add
104104
# new ones
105105
fd <- metadata(dimData(x))[[fd_name]]
106-
fd <- fd[intersect(rownames(fd), colnames(dimData(x))),]
106+
fd <- fd[intersect(rownames(fd), colnames(dimData(x))),, drop = FALSE]
107107
empty <- .initDF(dimData(x))
108108
fd <- combineCols(empty, fd)
109109
metadata(dimData(x))[[fd_name]] <- fd

R/plot.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ getDivergeRange <- function(values, diverge_center = 0) {
465465
}
466466

467467
#' @importFrom SpatialFeatureExperiment isFull imgSource getPixelSize ext
468-
#' aggBboxes
468+
#' aggBboxes cropImg imageIDs translateImg toSpatRasterImage getParams
469469
#' @importFrom sf st_area
470470
#' @importFrom terra RGB<- rast
471471
.find_res <- function(bfi, maxcell) {
@@ -498,7 +498,7 @@ getDivergeRange <- function(values, diverge_center = 0) {
498498
.get_n_channels <- function(img) {
499499
d <- dim(img)
500500
if (length(d) == 2L) return(1L)
501-
d[[3]]
501+
as.integer(d[[3]])
502502
}
503503
# What I want: option to assign individual grayscale images to different channels
504504
# Option to select one or more channels from a multi-channel image
@@ -507,7 +507,7 @@ getDivergeRange <- function(values, diverge_center = 0) {
507507
# BioFormatsImage
508508
# choose highest resolution with fewer than maxcell when multiple res are present
509509
# Convert to spi
510-
# EBImage: convert to spi so can use custom color map in terra::as.raster
510+
# ExtImage: convert to spi so can use custom color map in terra::as.raster
511511
# Combine different image classes: all use spi
512512
# For testing, need to use xenium v2 example data, everything is connected
513513
# All convert to spi, find the one with the lowest resolution, then
@@ -622,7 +622,7 @@ getDivergeRange <- function(values, diverge_center = 0) {
622622
tot_area <- ext(x) |> st_bbox() |> st_as_sfc() |> st_area()
623623
bb_area <- bbox |> st_bbox() |> st_as_sfc() |> st_area()
624624
bb_prop <- bb_area/tot_area
625-
if (!inMemory(x)) {
625+
if (!terra::inMemory(x)) {
626626
# Shouldn't need to write the cropped part to disk just for a plot
627627
tot_size <- file.info(imgSource(x))$size
628628
mem_free <- Sys.meminfo()$freeram |> as.numeric()
@@ -646,7 +646,7 @@ getDivergeRange <- function(values, diverge_center = 0) {
646646
if (is(img, "BioFormatsImage")) {
647647
res_use <- .find_res(img, maxcell)
648648
spi <- toSpatRasterImage(img, resolution = res_use, save_geotiff = FALSE)
649-
} else if (is(img, "EBImage")) {
649+
} else if (is(img, "ExtImage")) {
650650
spi <- toSpatRasterImage(img, save_geotiff = FALSE)
651651
} else spi <- img
652652
spi |> resample_spat(maxcell)
@@ -1071,7 +1071,7 @@ plotSpatialFeature <- function(sfe, features, colGeometryName = 1L,
10711071
#' @importFrom SpatialExperiment spatialCoords
10721072
#' @importFrom SpatialFeatureExperiment spatialGraphs spatialGraph
10731073
#' @importFrom spdep card
1074-
#' @importFrom sf st_coordinates st_centroid st_geometry
1074+
#' @importFrom sf st_coordinates st_centroid st_geometry st_sfc
10751075
#' @return A ggplot2 object.
10761076
#' @export
10771077
#' @concept Spatial plotting

man/plotColDataFreqpoly.Rd

+12-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plotColDataHistogram.Rd

+39-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)