Skip to content

plotHeatmap: add --plotColors argument for profile plot line colors#1427

Open
niekwit wants to merge 1 commit into
deeptools:masterfrom
niekwit:feature/plotheatmap-plotcolors
Open

plotHeatmap: add --plotColors argument for profile plot line colors#1427
niekwit wants to merge 1 commit into
deeptools:masterfrom
niekwit:feature/plotheatmap-plotcolors

Conversation

@niekwit
Copy link
Copy Markdown

@niekwit niekwit commented May 21, 2026

Allows users to set custom colors for the profile/summary plot lines when --whatToShow includes a plot. Colors are recycled if fewer are given than the number of lines. Accepts any matplotlib named color or hex value. Consistent with the existing --colorList approach.

Related to issue #1166.

Examples of how it works:

plotHeatmap -m matrix.gz \
	-out test1.png \
	--regionsLabel "Region1" "Region2" "Region3" "Region4" \
	--samplesLabel "WT" "KO" \
	--whatToShow "plot, heatmap and colorbar" \
	--perGroup \
	--heatmapHeight 10 \
	--heatmapWidth 5 \
	--colorMap viridis \
	--plotColors "#cccccc" "#dd3b3b"
test1

Falls back to standard colours, if --plotColors is not used:

plotHeatmap -m matrix.gz \
	-out test2.png \
	--regionsLabel "Region1" "Region2" "Region3" "Region4" \
	--samplesLabel "WT" "KO" \
	--whatToShow "plot, heatmap and colorbar" \
	--perGroup \
	--heatmapHeight 10 \
	--heatmapWidth 5 \
	--colorMap viridis
test2

Compatible with colour recycling:

plotHeatmap -m matrix.gz \
	-out test3.png \
	--regionsLabel "Region1" "Region2" "Region3" "Region4" \
	--samplesLabel "WT" "KO" \
	--whatToShow "plot, heatmap and colorbar" \
	--perGroup \
	--heatmapHeight 10 \
	--heatmapWidth 5 \
	--colorMap viridis \
	--plotColors "#cccccc"
test3

Error message when invalid colour values are used:

plotHeatmap -m matrix.gz \
	-out test4.png \
	--regionsLabel "Region1" "Region2" "Region3" "Region4" \
	--samplesLabel "WT" "KO" \
	--whatToShow "plot and heatmap" \
	--perGroup \
	--heatmapHeight 10 \
	--heatmapWidth 5 \
	--colorMap viridis \
	--plotColors notacolor alsonotacolor
usage: plotHeatmap -m matrix.gz
help: plotHeatmap -h / plotHeatmap --help
plotHeatmap: error: argument --plotColors: 'notacolor' is not a valid matplotlib color. Use a named color (e.g. 'red') or a hex value (e.g. '#ff0000').

Allows users to set custom colors for the profile/summary plot lines
when --whatToShow includes a plot. Colors are recycled if fewer are
given than the number of lines. Accepts any matplotlib named color
or hex value. Consistent with the existing --colorList approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant