Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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

    • seqadmin
      Current Approaches to Protein Sequencing
      by seqadmin


      Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
      04-04-2024, 04:25 PM
    • seqadmin
      Strategies for Sequencing Challenging Samples
      by seqadmin


      Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
      03-22-2024, 06:39 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 04-11-2024, 12:08 PM
    0 responses
    24 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-10-2024, 10:19 PM
    0 responses
    25 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-10-2024, 09:21 AM
    0 responses
    21 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-04-2024, 09:00 AM
    0 responses
    52 views
    0 likes
    Last Post seqadmin  
    Working...
    X