How to extract plots from ConsensusClusterPlus package
2
1
Entering edit mode
4.6 years ago
manali.rupji ▴ 30

Hello All,

Is there a way to extract the plots separately from the ConsensusClusterPlus package? For example, using the example data from the package, I can print the last three plots as below,

library(ALL)
data(ALL)
d=exprs(ALL)

d = sweep(d,1, apply(d,1,median,na.rm=T))

library(ConsensusClusterPlus)

par(mfrow=c(1,3))
title=tempdir()
results = ConsensusClusterPlus(d,maxK=6,reps=50,pItem=0.8,pFeature=1,
title=title,clusterAlg="hc",distance="pearson",seed=1262118388.71279)


But, I wish to extract the consensus heatmap (say plot #2 which represents the optimal number of clusters) from the results and display separately.

Any help in this regard would be very helpful.

ConsensusClusterPlus plots • 4.3k views
0
Entering edit mode

Hey,

Why do not use plot="pdf" in ConsensusClusterPlus function, so you will get 6 individual plots for each number of cluster, later you can take interest of yours.

results = ConsensusClusterPlus(d,maxK=6,reps=50,pItem=0.8,pFeature=1,
title=title,clusterAlg="hc",distance="pearson",seed=1262118388.71279, plot="pdf")

0
Entering edit mode

Hi there, I'm trying the ConsensusClusterPlus package, but I can't view the plots that it generates. Can you help? Thanks!

0
Entering edit mode
13 months ago

Hi, if it helps to draw them inside RStudio without exporting directly, setting plot=NULL helped in my case. This draws a handful of plots and you can navigate by using the back-arrow in the top-left of RStudios "Plots"-area.

Here is the source that hinted me to plot=NULL: https://montilab.github.io/BS831/articles/docs/Clustering.html

0
Entering edit mode
10 months ago
aUser ▴ 20

Hi, the generated plots are in temp directory that you set using title [title = tempdir()]. You can change this value to any directory and get the results/plots in that dir.