Order of genes not the same as lost in pheatmap
0
1
Entering edit mode
5.2 years ago
jpaveley1 ▴ 10

Hi folks,

I am trying to create a variety of heatmaps of DESeq2 DEGlists to answer different questions. I have been using pheatmap.

This is my code so far:

dds <- DESeqDataSetFromMatrix(countData = cts,colData = coldata,design = ~Genotype)
dds <- DESeq(dds)
GRBrainResults <- results(dds,alpha = 0.05)

This is to sort the dataset by lowest padj value first

ndx = order(GRBrainResults$padj, decreasing = FALSE)
GRBrainResultspadj <- GRBrainResultsSig[ndx,]
head(GRBrainResultspadj,5)


                       padj
                     <numeric>
ENSDARG00000028396 9.31612e-230
ENSDARG00000025428 2.31820e-176
ENSDARG00000059815  1.67438e-98
ENSDARG00000007693  3.58104e-80
ENSDARG00000087303  6.11981e-62


 rld = rlogTransformation(dds)

I would like to create a heatmap of the top 30 most significant genes. I have been using pheatmap. I can create a heatmap, but the list of genes is not in the same order. Is this because they are clustering? If so, can somebody help me remove the row clustering please. This is what I have been using:

mat = assay(rld)[ head(order(GRBrainResults$padj),30), ]
mat = mat - rowMeans(mat)
df = as.data.frame(colData(rld)[,c("Genotype")])
colnames(df) = "Genotype"
rownames(df) = colnames(mat)
pheatmap(mat, annotation_col=df)

I produce a heatmap but its not in order, I see they logically clustered so figured this is it.

Can somebody please help me remove the row clustering?

Cheers

RNA-Seq R Gene • 1.4k views
ADD COMMENT
0
Entering edit mode

The cluster_rows and cluster_cols arguments of the pheatmap function control this. In general, when looking to modify the behaviour of a function it is good practice to look at the documentation. (BTW I did not check the rest of your code)

ADD REPLY

Login before adding your answer.

Traffic: 6190 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6