Records which individuals have been genotyped on a named SNP chip by
writing or updating a BOOLEAN column has_<chip_name> in ind_meta.
Pipe a tidybreed_table (from get_table() and optionally dplyr::filter()) as
the first argument to restrict which animals are marked.
The operation is additive: animals already marked TRUE remain TRUE.
Only new animals are flipped. This mirrors real life — once an animal is
genotyped it stays genotyped.
Usage
add_genotypes(tbl, chip_name, col_name = paste0("has_", chip_name))Arguments
- tbl
A
tidybreed_tableobject fromget_table()(optionally piped throughdplyr::filter()). The table must contain anid_indcolumn when a filter is applied.- chip_name
Character. Name of an existing SNP chip (must have an
is_<chip_name>column ingenome_meta, created bydefine_chip()).- col_name
Character. Name of the BOOLEAN column to write in
ind_meta. Default:paste0("has_", chip_name).
Examples
if (FALSE) { # \dontrun{
# Genotype all females in generation 1 on the 50k chip
pop <- pop |>
get_table("ind_meta") |>
dplyr::filter(sex == "F", gen == 1L) |>
add_genotypes("50k")
# Also genotype all generation 2 animals (additive — gen 1 females stay TRUE)
pop <- pop |>
get_table("ind_meta") |>
dplyr::filter(gen == 2L) |>
add_genotypes("50k")
} # }
