Reads the per-gene `<gene>_individuals.csv` written by [haplobreed_analysis()] and returns, for every individual in the HGSI result, whether they carry the pipeline's superior haplotype at that gene. Used to colour per-individual figures by carrier status.
Value
A list with `carrier` (logical, length `length(x$ids)`), `haplotype` (character, the assigned haplotype per individual), `superior_haplotype` (character), and `gene` and `trait`.
Examples
toy <- system.file("extdata", "hgsi_toy", package = "HaploBreedR")
td <- file.path(toy, "trait_YLD")
if (nzchar(toy) && dir.exists(td)) {
x <- structure(
list(ids = sprintf("L%03d", 1:150),
traits = "YLD",
trait_dirs = c(YLD = td)),
class = "hgsi_advanced")
res <- try(hbr_gene_carriers(
x, trait = "YLD", gene = "GENE04", trait_dir = td))
}
#> Error : Could not determine superior_haplotype for gene 'GENE04'. Pass it explicitly.
