samp_annot | R Documentation |
Sample annotations can be used to store information about
each sample such as tumor type or treatment status. These are used in
downstream plotting functions such as plot_exposures
or
plot_umap
to group or color samples by a particular annotation.
samp_annot(object)
## S4 method for signature 'musica'
samp_annot(object)
## S4 method for signature 'musica_result'
samp_annot(object)
samp_annot(object, name) <- value
## S4 replacement method for signature 'musica,character,vector'
samp_annot(object, name) <- value
## S4 replacement method for signature 'musica_result,character,vector'
samp_annot(object, name) <- value
object |
A |
name |
The name of the new annotation to add. |
value |
A vector containing the new sample annotations. Needs to be the same length as the number of samples in the object. |
A new object with the sample annotations added to the table in the
sample_annotations
slot.
See sample_names
to get a vector of sample names in
the musica
or musica_result
object.
data(res_annot)
samp_annot(res_annot)
# Add new annotation
samp_annot(res_annot, "New_Annotation") <- rep(c("A", "B"), c(3, 4))
samp_annot(res_annot)
data(musica)
samp_annot(musica, "example") <- rep("ex", 7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.