Set the color mapping, tick, and tick labels of annotation legends.
Source:R/utilFuns.R
setAnnoLegend.RdSpecifically, it does the following:
for non-numerical variables in
annoDf,create the color mapping using colors ingetDistinctColors()because their default colors are not very distinct.for numerical variables, apply
setColMapAndLegend()
Usage
setAnnoLegend(
mat1,
annoDf,
annoColMapList = NULL,
annoParaList = list(),
on = 1:2,
rmLegendOutliers = T,
intAsDiscreteCutoff = 6
)Arguments
- annoDf
data.frame; annotation
- annoColMapList
list of color mappings for each annotation,
NULL; its value is passed tocolinComplexHeatmap::HeatmapAnnotation().names(annoColMapList)are amongcolnames(annoDf)- annoParaList
list of annotation parameters except
colinComplexHeatmap::HeatmapAnnotation(),list();- on
1:2; for row or column annotation
- rmLegendOutliers
logical,
TRUE; passed tosetColMapAndLegend()- intAsDiscreteCutoff
integer, 6; passed to
setColMapAndLegend()
Value
a list() of the following items:
ha: an object ofComplexHeatmap::HeatmapAnnotation()where the col and legend tick and labels are reset based onrmLegendOutliersnewDf: infinite values in numerical columns ofannoDf, if present, are set toNA