subset_musica_by_annotation: Creates a new musica object subsetted to only one value of a...

View source: R/main_class.R

subset_musica_by_annotationR Documentation

Creates a new musica object subsetted to only one value of a sample annotation

Description

Creates a new musica object subsetted to only one value of a sample annotation

Usage

subset_musica_by_annotation(musica, annot_col, annot_names)

Arguments

musica

A musica object.

annot_col

Annotation class to use for subsetting

annot_names

Annotational value to subset to

Value

Returns a new musica object with sample annotations, count tables, and variants subsetted to only contains samples of the specified annotation type

Examples

data(musica_sbs96)
annot <- read.table(system.file("extdata", "sample_annotations.txt", 
package = "musicatk"), sep = "\t", header=TRUE)

samp_annot(musica_sbs96, "Tumor_Subtypes") <- annot$Tumor_Subtypes

musica_sbs96 <- subset_musica_by_annotation(musica_sbs96, "Tumor_Subtypes", 
"Lung")

campbio/musicatk documentation built on July 14, 2024, 8:28 a.m.