Question: Order of genes not the same as lost in pheatmap
0
gravatar for jpaveley1
3 months ago by
jpaveley10
jpaveley10 wrote:

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 • 150 views
ADD COMMENTlink written 3 months ago by jpaveley10

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 REPLYlink modified 3 months ago • written 3 months ago by Papyrus370
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 862 users visited in the last hour