Skip to contents

Expand lineage names from an alias to parent name up to a maximum step. Recombinant variants will not be expanded. NA_character values will be carried through.

Usage

expand_pangoro(pangoro, input = character(), max_level = NULL, simplify = TRUE)

Arguments

pangoro

Pangoro object.

input

Vector of lineage names to expand (character vector).

max_level

How far to expand the lineage name (default: maximum).

simplify

Boolean, pass to mapply

Details

Although several string splits occur, this function can expand 1e6 values in <2 minutes.

Examples

if (FALSE) {
my_pangoro <- pangoro()
expand_pangoro(my_pangoro, c('BA.1', 'BA.1.2.3', 'BL.2'))
expand_pangoro(my_pangoro, c('BA.1', 'BA.1.2.3', 'BL.2'), 1)
expand_pangoro(my_pangoro, c('BA.1', 'BA.1.2.3', 'BL.2'), 2)
expand_pangoro(my_pangoro, c('BA.1', 'BA.1.2.3', 'BL.2'), 200) # Only goes as far as it can
}