| add_juxtaview {mistyR} | R Documentation |
The juxtaview captures the expression of all markers within the immediate neighborhood of a spatial unit.
add_juxtaview( current.views, positions, neighbor.thr = 15, cached = FALSE, verbose = TRUE )
current.views |
the current view composition. |
positions |
a |
neighbor.thr |
a threshold value used to indicate the largest distance between two spatial units that can be considered as neighboring. |
cached |
a |
verbose |
a |
The neighborhood of each spatial unit is estimated by constructing a graph by
2D Delaunay triangulation following by removal of edges with length larger than
neighbor.thr. For each spatial unit the juxtaview contains the sum of
expressions across its estimated neighbors for each marker.
A mistyR view composition with added juxtaview.
create_initial_view() for
starting a view composition with an intraview only.
Other view composition functions:
add_paraview(),
add_views(),
create_initial_view(),
create_view(),
remove_views()
# Create a view composition of an intraview and a juxtaview.
library(dplyr)
# get the expression data
data("synthetic")
expr <- synthetic[[1]] %>% select(-c(row, col, type))
# get the coordinates for each cell
pos <- synthetic[[1]] %>% select(row, col)
# compose
misty.views <- create_initial_view(expr) %>% add_juxtaview(pos, neighbor.thr = 1.5)
# preview
str(misty.views[["juxtaview.1.5"]])