list, mapping information, see details and examples
haplotype
logical, should values in a map be treated as
haplotypes or genotypes, see details
factor
logical, should output be a factor or a character
levels
character, optional vector of level names if factor is
produced (factor=TRUE); the default is to use the sort order
of the group names in map
verbose
logical, print genotype names that match entries in
the map - mainly used for debugging
Details
Examples show how map can be constructed. This are the main
points to be aware of:
names of list components are used as new group names
list components hold genotype names per each group
genotype names can be specified directly i.e. "A/B" or
abbreviated such as "A/*" or even "*/*", where "*" matches any
possible allele, but read also further on
all genotype names that are not specified can be captured
with ".else" (note the dot!)
genotype names that were not specified (and ".else" was not
used) are changed to NA
map is inspected before grouping of genotypes is being
done. The following steps are done during inspection:
".else" must be at the end (if not, it is moved) to match
everything that has not yet been defined
any specifications like "A/*", "*/A", or "*/*" are extended to
all possible genotypes based on alleles in argument alleles -
in case of haplotype=FALSE, "A/*" and "*/A" match the same
genotypes
since use of "*" and ".else" can cause duplicates along the
whole map, duplicates are removed sequentially (first occurrence
is kept)
Using ".else" or "*/*" at the end of the map produces the same result,
due to removing duplicates sequentially.
Value
A factor or character vector with genotypes grouped