Question: Row and coloumn names do not display on x and Y axis in heatmaply.
0
gravatar for sharmatina189059
16 months ago by
United States
sharmatina18905940 wrote:

Row and coloumn names do not display on x and Y axis in heatmaply. Instead of row and colomn names it is showing digits.

data <- read.csv("/Users/apple/Documents/42_heatmap_new.csv", sep=",")
> rnames <- data[,1]
> mat_data <- data.matrix(data[,2:ncol(data)]) ## matrix started with second column
> heatmaply(mat_data, file="heatmaply_preformed.html", dendrogram = "none", plot_method= c("plotly"), margins = c(150,250,30,150), grid_gap = 0.1, show_grid = TRUE, xlab = "Antibiotics", ylab = "Clinical isolates", main="Heatmap for drug resistance profile of 42 complete genomes", cexCol = 0.9, cexRow = 1.0, lwid =c(4,1), lhei =c(2,2))
heatmap • 424 views
ADD COMMENTlink modified 16 months ago by WouterDeCoster42k • written 16 months ago by sharmatina18905940

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLYlink written 16 months ago by WouterDeCoster42k

code seems to have no problem. x and y axis (xlab and ylab) names are present in output as expected. I hope you have installed phantom js via R (install via webshot::install_phantomjs()). Then add following information to your code: file = c("heatmaply_plot.html", "heatmaply_plot.png"). This should create a png file in working directory. If it has xlab and ylab, then your displaying window has issue.

ADD REPLYlink modified 16 months ago • written 16 months ago by cpad011212k

But my code do not display all the anitbiotic names at the x axis and isolates names at y axis instead it is showing numbers like 1, 2, 3 , 4 and so on. What to do.

ADD REPLYlink written 16 months ago by sharmatina18905940
1
gravatar for cpad0112
16 months ago by
cpad011212k
India
cpad011212k wrote:

Well, title of your post is misleading. Add labRow =rnames, labCol = colnames(data[,-1] to your code at the end. First add only `labRow =rnames' to your code. See if it works. If it works, then add labcol. If it doesn't, please post example data.

ADD COMMENTlink written 16 months ago by cpad011212k

wow labRow =rnames works. but labCol = colnames(data[,-1] still does not work. Do not display coloumn names. Is there any other solution.

ADD REPLYlink written 16 months ago by sharmatina18905940

what is the output of names(data[,2:ncol(data)])?

ADD REPLYlink written 16 months ago by cpad011212k

Shwoing all antibiotics names like [1] "Amikacin" "Gentamicin"
[3] "Streptomycin" "Spectinomycin"

ADD REPLYlink written 16 months ago by sharmatina18905940

It works. Thank you so much...

ADD REPLYlink written 16 months ago by sharmatina18905940

The query has now been resolved. Thank you so much.

ADD REPLYlink written 16 months ago by sharmatina18905940

I have moved the reaction from cpad0112 to an answer so you can accept it.

ADD REPLYlink written 16 months ago by WouterDeCoster42k

colnames(data[,-1] ) should work. It is same as names(data[,2:ncol(data)])

ADD REPLYlink written 16 months ago by cpad011212k
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: 1966 users visited in the last hour