SVG-class | R Documentation |
The SVG class is designed to represent annotated SVG (aSVG) instances.
SVG(
coordinate = list(),
attribute = list(),
dimension = list(),
svg = list(),
raster = list(),
angle = list()
)
coordinate |
A named |
attribute |
A named |
dimension |
A named |
svg |
A named |
raster |
A named |
angle |
Applicable in the case of spatially resolved single-cell data. A named |
A SVG object.
Jianhai Zhang jzhan067@ucr.edu
Dr. Thomas Girke thomas.girke@ucr.edu
# The first raste image used as a template to create an aSVG.
raster.pa1 <- system.file('extdata/shinyApp/data/maize_leaf_shm1.png',
package='spatialHeatmap')
# The first aSVG created with the first template.
svg.pa1 <- system.file('extdata/shinyApp/data/maize_leaf_shm1.svg',
package='spatialHeatmap')
# The second raster image used as a template to create an aSVG.
raster.pa2 <- system.file('extdata/shinyApp/data/maize_leaf_shm2.png',
package='spatialHeatmap')
# The second aSVG created with the second template.
svg.pa2 <- system.file('extdata/shinyApp/data/maize_leaf_shm2.svg',
package='spatialHeatmap')
# Parse these two aSVGs without association with raster images.
svgs <- read_svg(svg.path=c(svg.pa1, svg.pa2), raster.path=NULL)
# Parse these two aSVGs. The raster image paths are provide so as to
# be associated with respective aSVGs, which will be used when
# superimposing raster images with SHM plots.
svgs <- read_svg(svg.path=c(svg.pa1, svg.pa2), raster.path=c(raster.pa1, raster.pa2))
# Two aSVG instances are stored in a "SVG" object of "svgs".
names(svgs)
# Access content of "svgs".
svgs[1, ] # The first aSVG instance
svgs[, 'coordinate'][1]; coordinate(svgs)[1] # The coordinates of the first aSVG instance
# Combine two "SVG" objects.
x <- svgs[1, ]; y <- svgs[2, ]; cmb(x, y)
# Extract slots from "svgs" and create a new "SVG" object.
lis <- list(cordn=coordinate(svgs), attrb=attribute(svgs), svg=svg_obj(svgs), raster=raster_pa(svgs))
new.svgs <- SVG(coordinate=lis$cordn, attribute=lis$attrb, svg=lis$svg, raster=lis$raster)
# Change aSVG instance names.
names(new.svgs) <- c('aSVG1', 'aSVG2')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.