Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Oli_RNAseq
    Junior Member
    • Dec 2013
    • 1

    #1

    cummeRbund csHeatmap columns in user-defined order

    Hello to all!
    This is my first post on RNAseq and let me start by thanking you for existing, I was able to get many answers here
    I am using the R package cummeRbund (from Bioconductor) to visualize RNA-seq data, I created a cuffGeneSet instance called "DEG_genes" that contains 662 genes that are significantly differentially expressed between males and females. My goal is to create a heatmap using csHeatmap() in which the male and female samples (replicates) are separated but with a specific user-defined order within the sex category.
    I used:

    Code:
    > DEG<-diffData(genes(cuff))   # take differentially expressed genes
        > DEG_significant<-subset(DEG,significant=='yes') # retain only significant changes
        > DEG_sign_IDs <- DEG_significant$gene_id # retrieve IDs
        > DEG_genes<-getGenes(cuff,DEG_sign_IDs) # get CuffGeneSet instance
    
        > DEG_genes
        CuffGeneSet instance for  662  genes
     
        Slots:
        	 annotation
        	 fpkm
        	 repFpkm
        	 diff
        	 count
        	 isoforms	 CuffFeatureSet instance of size 930 
        	 TSS		 CuffFeatureSet instance of size 785 
        	 CDS		 CuffFeatureSet instance of size 230 
        	 promoters		 CuffFeatureSet instance of size 662 
        	 splicing		 CuffFeatureSet instance of size 785 
        	 relCDS		 CuffFeatureSet instance of size 662 
    
        > summary(DEG_genes)
             Length       Class        Mode 
                662 CuffGeneSet          S4 
        > hmap<-csHeatmap(DEG_genes,clustering='none',labRow=F,replicates=T)
    This gives me ALMOST what I want: the heatmap shows Females on the left and Males on the right but they are alphabetically ordered (Female_0,Female_1,Female_10,Female_11,Female_12...Female_19,Female_2,Female_20,Female_21..,Female_29 on the left and similarly for males Male_0,Male_1,Male_10...Male_19,Male_2,Male_20...etc on the right) and I want them to be in a specific order (clusterReps). I created a test vector with replicate names on a specific order (Males on the left with 0 and 6 echanged and females on the right) as follows:
    Code:
    clusterReps<-c("Male_6","Male_1","Male_2","Male_3","Male_4","Male_5","Male_0","Male_7","Male_8","Male_9","Male_10","Male_11","Male_12","Male_13","Male_14","Male_15","Male_16","Male_17","Male_18","Male_19","Male_20","Male_21","Male_22","Male_23","Male_24","Male_25","Male_26","Male_27","Male_28","Male_29","Male_30","Male_31","Male_32","Male_33","Female_0","Female_1","Female_2","Female_3","Female_4","Female_5","Female_6","Female_7","Female_8","Female_9","Female_10","Female_11","Female_12","Female_13","Female_14","Female_15","Female_16","Female_17","Female_18","Female_19","Female_20","Female_21","Female_22","Female_23","Female_24","Female_25","Female_26","Female_27","Female_28")
    I would like the data to be exactly the same except the order of the columns that must follow the order of the "clusterReps" vector. Knowing that the heatmap is a ggplot, I looked everywhere for a solution the last 2 days but with no success (despite a closely ressembling problem with heatmap.2() instead of csHeatmap() on stackoverflow, I tried to get a replicate fpkm matrix and use heatmap.2 but could only use heatmap_2 and some options were not accepted).
    Using:
    Code:
     > hmap<-hmap+scale_x_discrete(limits=clusterReps)
        Scale for 'x' is already present. Adding another scale for 'x', which will replace the existing scale.
    only changes the x-axis labels but not the actual data (the heatmap remains identical).
    Is there a similar function that rearranges the columns and not just labels? There must be a way to do this but I haven't found it yet.
    Thanks in advance for your help, I'm not familiar with handling ggplot objects, and in particular heatmaps from cummeRbund.
    I am afraid I can't give more information for the moment, please let me know if you want me to execute a command and report the output if it can help you help me .

Latest Articles

Collapse

  • SEQadmin2
    Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
    by SEQadmin2



    CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

    Despite this, “CRISPR helped turn genome editing from a specialized technique into
    ...
    07-31-2026, 11:01 AM
  • SEQadmin2
    Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
    by SEQadmin2


    Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

    The systematic characterization of the human proteome has
    ...
    07-20-2026, 11:48 AM
  • SEQadmin2
    Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
    by SEQadmin2



    Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
    ...
    07-09-2026, 11:10 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, Today, 10:13 AM
0 responses
10 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 07-31-2026, 02:55 AM
0 responses
23 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 07-24-2026, 12:17 PM
0 responses
19 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 07-23-2026, 11:41 AM
0 responses
17 views
0 reactions
Last Post SEQadmin2  
Working...