subset_musica_by_annotation {musicatk} | R 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")

[Package musicatk version 1.0.0 Index]