Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:49:51+00:00 2026-06-12T02:49:51+00:00

I am trying to cluster a protein dna interaction dataset, and draw a heatmap

  • 0

I am trying to cluster a protein dna interaction dataset, and draw a heatmap using heatmap.2 from the R package gplots. Here is the complete process that I am following to generate these graphs:
Generate a distance matrix using some correlation in my case pearson.

library(RColorBrewer);
library(gplots);
args <- commandArgs(TRUE);
matrix_a <- read.table(args[1], sep='\t', header=T, row.names=1);
mtscaled <- as.matrix(scale(matrix_a))
pdf("result.pdf", pointsize = 15, width = 18, height = 18)
result <- heatmap.2(mtscaled, Colv=T,Rowv=T, scale='none',symm = T, col = brewer.pal(9,"Reds"))
dev.off() 

I am able to acomplish this with the normal heatmap function by doing the following:

result <- heatmap(mtscaled, Colv=T,Rowv=T, scale='none',symm = T)

However when I use the same settings for Heatmap.2 the clusters don’t line up as well on the diagonal. I have attached 2 images the first image uses heatmap and the second image uses heatmap.2. I have used the Reds color from the package RColorBrewer to help better show what I am taking about. I would normally just use the default heatmap function, but I need the color variation that heatmap.2 provides.

Here is a list to the dataset used to generate the heatmaps, after it has been turned into a distance matrix:
DataSet

Heatmap drawn from heatmap

Heatmap drawn from Heatmap.2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:49:52+00:00Added an answer on June 12, 2026 at 2:49 am

    It’s as if two of the arguments are conflicting. Colv=T says to order the columns by cluster, and symm=T says to order the columns the same as the rows. Of course, both constraints could be satisfied since the data is symmetrical, but instead Colv=T wins and you get two independent cluster orderings that happen to be different.

    If you give up on having redundant copy of the dendrogram, the following gives the heatmap you want, at least:

    result <- heatmap.2(mtscaled, Rowv=T, scale='none', dendrogram="row", symm = T, col = brewer.pal(9,"Reds"))
    

    symmetrical heatmap

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to cluster a protein dna interaction dataset, and draw a heatmap
I am trying to take my dataset which is made up of protein dna
I'm trying to cluster some data I have from the KDD 1999 cup dataset
I'm trying to cluster a really large dataset - 3030764x162 into 4000 clusters using
I've been trying to cluster some larger dataset. consisting of 50000 measurement vectors with
I'm trying to run a scikit-learn K-means example from scikit-learn official site: http://scikit-learn.org/dev/auto_examples/cluster/plot_cluster_iris.html#example-cluster-plot-cluster-iris-py I
Having and issue with an ejabberd cluster. While trying ping the first node from
I am trying to setup all projects from Apache Hadoop stack in one cluster.
I'm struggling trying to cluster 50 markers using the markerclusterer v3 with Google maps
I have a coherence 3.7 cluster. I am trying to connect to it using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.