Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IsBeth
    Member
    • Nov 2013
    • 28

    #1

    pheatmap with predefined row order (?)

    Hello!

    I used the pheatmap function (package pheatmap), an excellent function to obtain a heatmap of my top20 genes. But rows have to be shown within the heatmap in a specific order.

    Now my ordered and rlog transformed dataframe looks something like this. It contains only 20 rows.

    head(ordered_df)
    control1 control2 treatment1 treatment2
    gene1 -1.7645217 -1.7195209 -1.6657764 1.8478388
    gene2 -1.8288594 -1.8174903 -1.8042068 1.8982069
    gene3 -1.6516937 -1.6204703 -1.6078509 1.5970406
    gene4 -1.3465805 -1.1734480 -1.4704845 1.2976865
    gene5 -1.4837454 -1.0958759 -1.3840635 1.3615838
    gene6 -1.0479161 -0.9808831 -1.0591158 0.9616953


    I obtained the pheatmap with the following command:

    pheatmap(ordered_df, annotation_col=annotcol)

    I thought that it would work to simply preorder the data frame before giving it to the pheatmap function, but the heatmap shows rows in an incorrect order. Is there a way within the function to achieve this? It seems to me that there must be something very simple to do this, but I cannot find it.
  • Zoltan
    Junior Member
    • Feb 2017
    • 1

    #2
    Please check here the answer of D.R. on another forum: https://www.biostars.org/p/108247/

    I tried to use
    res <- pheatmap(matrix)
    and than one may change value for
    res$tree_row$order <- list.of.your.order
    res$tree_col$order <- list.of.your.order
    or get the order from here,
    but finally could not produce a heatmap from the modified res
    D.R. has published a better solution

    Comment

    Latest Articles

    Collapse

    • SEQadmin2
      Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
      by SEQadmin2



      Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

      Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
      ...
      10-14-2026, 09:55 AM
    • SEQadmin2
      New Genomics Technologies Take Aim at Long-Standing Limits
      by SEQadmin2


      Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

      We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
      ...
      09-28-2026, 10:25 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, Yesterday, 11:13 AM
    0 responses
    19 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, Yesterday, 10:48 AM
    0 responses
    18 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-15-2026, 10:52 AM
    0 responses
    36 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-14-2026, 05:39 AM
    0 responses
    42 views
    0 reactions
    Last Post SEQadmin2  
    Working...