add_key | R Documentation |
This function adds spe$key
to a
SpatialExperiment-class object
which is unique across all spots.
add_key(spe, overwrite = TRUE)
spe |
A SpatialExperiment-class object. |
overwrite |
A |
A
SpatialExperiment-class object
with key
added to the colData(spe)
that is unique across all spots.
if (enough_ram()) {
## Obtain the necessary data
if (!exists("spe")) spe <- fetch_data("spe")
## This object already has a 'key'
head(spe$key)
## We can clean it
spe$key_original <- spe$key
spe$key <- NULL
## and then add it back
spe <- add_key(spe)
head(spe$key)
## Note that the original 'key' order was 'sample_id'_'barcode' and we'
## have since changed it to 'barcode'_'sample_id'.
## Below we restore the original 'key'
spe$key <- spe$key_original
spe$key_original <- NULL
head(spe$key)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.