Question: how to get a readable scale on a particular R plot
0
gravatar for vmicrobio
15 days ago by
vmicrobio250
vmicrobio250 wrote:

Hello,

I'm having difficulties to get a plot with a readable scale.

I have plotted transcriptomic data using R with package EMA. However 'genes names' (ordinate axis) are written too big and I can't see all gene names. I would like to have one gene name per compartment.

plot picture

Here is my code:

clustering.plot(tree= c.sample, tree.sup=c.gene, data=tpm.100,
                dendro=TRUE, dendro.sup=TRUE, names=TRUE, names.sup=TRUE, names.dist=TRUE, trim.heatmap=0.99)

clustering.plot(tree= c.sample, tree.sup=c.gene, data=tpm.100,
                legend=FALSE, legend.pos="bottomright",
                dendro=FALSE, dendro.sup=FALSE,names.sup=TRUE, names.dist=TRUE,trim.heatmap=0.99)

I have read EMA package documentation to play with different options without success.

I'm new with R, there should be some obvious things i'm missing

Thank you for your help

plot transcriptomic ema R • 133 views
ADD COMMENTlink modified 3 days ago • written 15 days ago by vmicrobio250

what is the size of tpm.100 ? can you try removing trim.heatmap function in the code?

ADD REPLYlink modified 15 days ago • written 15 days ago by cpad011213k

thank you for your comment. tmp.100 is a 15x87 table (including one line and one column of headers). Without trim.heatmap I get the same graph.

ADD REPLYlink written 14 days ago by vmicrobio250
0
gravatar for vmicrobio
3 days ago by
vmicrobio250
vmicrobio250 wrote:

It was recommanded to me to use pheatmap package (https://stackoverflow.com/questions/63225729/how-to-get-a-readable-scale-on-a-particular-r-plot)

Here is what I get:

install.packages("pheatmap")
library(pheatmap)

# load data and subset
data=read.table("/Users/vmicrobio/Desktop/tpm.100.txt",sep="\t",header=TRUE,row.names = 1 )
head(data)

# data.matrix()
data_subset <- as.matrix((data), threshold = 10, p=0.2)
tpm=data.frame(data_subset)
tpm.log <- log2(tpm[,]+1)

# normalization
cal_z_score <- function(x){
  (x - mean(x)) / sd(x)
}
tpm.log_norm <- t(apply(tpm.log, 1, cal_z_score))

# heatmap
pheatmap(tpm.log_norm, main="test norm", fontsize_row=6, filename="/Users/vmicrobio/Desktop/heatmap_test.pdf")

plot

ADD COMMENTlink written 3 days ago by vmicrobio250
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: 1376 users visited in the last hour