emblake
emblake

Reputation: 63

Remove columns from heatmap.2 figure?

Is it possible to remove sample columns within a heatmap that are not of interest without reanalyzing my data? For example, I plotted the following

heatmap

Using heatmap.2 to visualize the top 30 differentially expressed genes between 'IL2.OKT3' and 'IL2'. The heatmap displays the expression pattern across all samples and donors, however, I would only like to display the sample columns labeled 'IL2' and 'IL2.OKT3'. Any feedback is appreciated.

Upvotes: 0

Views: 1325

Answers (1)

Joe
Joe

Reputation: 8611

The only way I know of is to subset the data matrix you used to plot the heatmap. If your matrix is called m and you want to get rid of columns 15-20, replace heatmap.2(m,....) with

heatmap.2(m[, -(15:20)], .... )

And the columns will not be plotted.

Upvotes: 2

Related Questions