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:
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:
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:
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 .
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)
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")
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.
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 .