Skip to contents

Annotation tables are joined and matching columns merged.

Usage

combine_sources(
  source_list,
  matching_columns = NULL,
  keep_cols = NULL,
  tag_ids = FALSE,
  source_col = "annotation_source",
  exclude_cols = NULL,
  tag = "combined",
  ...
)

Arguments

source_list

(list) A list of annotation sources to be combined.

matching_columns

(character, NULL) A named vector of columns names to be created by merging columns from individual sources. e.g. c("hello"="world") will rename the "hello" column to "world" if found in any of the tables. The default is NULL.

keep_cols

(character, NULL) A list of column names to keep in the combined table (padded with NA) if detected in one of the input tables. Special case ".all" will keep all columns from all tables. The default is NULL.

tag_ids

(logical) Create a column of new identifiers for each annotation by merging the id from each source with the annotation tag. e.g.an annotation with id = "A1" for source tagged "XY" is given a new id "A1_XY" to prevent duplicate IDs from multiple sources. The default is FALSE.

source_col

(character) The column name that will be created to contain a tag to indicate which source the annotation originated from. The default is "annotation_source".

exclude_cols

(NULL, character) Column names to be excluded from the merged annotation table. Note this is applied after keep_cols. The default is NULL.

tag

(character) The tag given to the newly combined table. The default is "combined".

...

Additional slots and values passed to struct_class.

Value

A combine_sources object with the following output slots:

combined_table(annotation_source) The annotation tabel after combining the input tables.

Inheritance

A combine_sources object inherits the following struct classes:

combine_sources()model()struct_class()

Examples

M = combine_sources(
      source_list = list(),
      matching_columns = NULL,
      keep_cols = NULL,
      tag_ids = FALSE,
      source_col = "annotation_source",
      exclude_cols = NULL,
      tag = "combined")