add_sample_annotations: Adds sample annotation to bagel object with available samples

Description Usage Arguments Value Examples

View source: R/main_class.R

Description

Adds sample annotation to bagel object with available samples

Usage

1
2
3
4
5
6
add_sample_annotations(
  bay,
  annotations,
  sample_column = "Sample_ID",
  columns_to_add = colnames(annotations)
)

Arguments

bay

Bagel object we input sample into

annotations

table of sample-level annotations to add

sample_column

name of sample name column

columns_to_add

which annotation columns to add, defaults to all

Value

Sets sample_annotations slot no return

Examples

1
2
3
4
5
6
7
bay <- readRDS(system.file("testdata", "bagel_sbs96.rds", package = "BAGEL"))
init_sample_annotations(bay)
sample_annotations <- read.table(system.file("testdata",
"sample_annotations.txt", package = "BAGEL"), sep = "\t", header=TRUE)
add_sample_annotations(bay = bay, annotations = sample_annotations,
sample_column = "Sample_Names", columns_to_add = "Tumor_Subtypes")
bay

campbio/BAGEL documentation built on Oct. 6, 2020, 3:59 a.m.