Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to turn off clustering when using the R pheatmap package?

I have created a matrix and now I would like to use pheatmap to draw a heatmap while preserving the order of the matrix rows. I would like to turn clustering off. Currently, pheatamp is clustering the rows when I run the following script:

    tissuedata<-read.table('OrderedByGeneCounts.csv', header=TRUE, sep=',')
    tissuedata2<-data.matrix(tissuedata)
    tissuedata3<-log10(tissuedata2)
    is.na(tissuedata3) <- do.call(cbind,lapply(tissuedata3, is.infinite))
    tissuedata3[is.na(tissuedata3)] <- 0
    tissue_exons<-scan(file="OrderedExonsList.txt", what="character", strip.white=TRUE)
    rownames(tissuedata3)<-tissue_exons

    pdf(file="pheatmapENSG00000026025.pdf", paper="a4", height=15)

    pheatmap(tissuedata3,
    color = colorRampPalette(rev(c("#D73027", "#FC8D59", "#FEE090", "#FFFFBF", "#E0F3F8", "#91BFDB", "#4575B4")))(100),
    cellwidth = 25, cellheight = 3.8,
    treeheight_row = 0,
    treeheight_column=0,
    kmeans_k = NA,
    show_rownames = T, show_colnames = T,
    fontsize=4,
    scale="none",
    legend=FALSE,
    )

    dev.off()
like image 840
user2639056 Avatar asked Oct 20 '25 15:10

user2639056


1 Answers

pheatmap(..., cluster_rows=FALSE, cluster_cols=FALSE) in general, as per @blmoore

like image 154
smci Avatar answered Oct 23 '25 04:10

smci



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!