SPHMMethods: Methods for S4 class 'SPHM'

SPHMMethodsR Documentation

Methods for S4 class SPHM

Description

These are methods for getting or setting SPHM objects.

Usage

## S4 method for signature 'SPHM'
svg(x)

## S4 replacement method for signature 'SPHM'
svg(x) <- value

## S4 method for signature 'SPHM'
bulk(x)

## S4 replacement method for signature 'SPHM'
bulk(x) <- value

## S4 method for signature 'SPHM'
cell(x)

## S4 replacement method for signature 'SPHM'
cell(x) <- value

## S4 method for signature 'SPHM'
match(x)

## S4 replacement method for signature 'SPHM'
match(x) <- value

## S4 method for signature 'SPHM'
output(x)

## S4 replacement method for signature 'SPHM'
output(x) <- value

## S4 method for signature 'SPHM,ANY,ANY,ANY'
x[i]

## S4 replacement method for signature 'SPHM,ANY,ANY,ANY'
x[i] <- value

## S4 method for signature 'SPHM'
length(x)

## S4 method for signature 'SPHM'
name(x)

Arguments

x

An 'SPHM' object.

value

A value for replacement.

i

An integer specifying a slot of an SPHM object.

Value

An object of SVG, SummarizedExperiment, SingleCellExperiment, data.frame, numeric, or list.

Main methods

In the following code snippets, x is an SPHM object.

x[i], svg(x), bulk(x), cell(x), match(x), output(x)

Subsetting a slot of x.

x[i] <- value, svg(x) <- value, bulk(x) <- value, cell(x) <- value, match(x) <- value

Replacing a slot value in x.

name(x)

All slot names in x.

length(x)

Number of all slots in x.

Author(s)

Jianhai Zhang jzhan067@ucr.edu
Dr. Thomas Girke thomas.girke@ucr.edu

See Also

SPHM: creating SPHM objects.

Examples


# Import an aSVG image.
svg.hum.pa <- system.file("extdata/shinyApp/data", 'homo_sapiens.brain.svg', 
package="spatialHeatmap")
svg.hum <- read_svg(svg.hum.pa)
# aSVG features.
feature.hum <- attribute(svg.hum)[[1]]
set.seed(20)
unique(feature.hum$feature)[1:10] 

# Testing vector.
my_vec <- setNames(sample(1:100, 4), c('substantia.nigra', 'putamen', 'prefrontal.cortex', 
'notMapped')); my_vec   
# An SPHM object for storing bulk data and aSVG.
dat.quick <- SPHM(svg=svg.hum, bulk=my_vec) 
# Getters and setters for SPHM objects.
svg(dat.quick); svg(dat.quick) <- svg.hum
dat.quick['bulk']; dat.quick['bulk'] <- my_vec

jianhaizhang/spatialHeatmap documentation built on July 31, 2024, 2:59 a.m.