I was able to generate a heatmap showing clusters of differentially expressed genes with pheatmap. Now, I am trying to figure out what genes are in specific clusters as well as zoom in on certain areas for figure presentation. I've tried heatmaply to no avail, it just freezes Rstudio and never generates anything. I've read about plotly online but am not seeing how to set it up other than plot_ly(data frame). Looked on the help page (link below) but am not seeing where I am able to insert my matrix. I am able to generate the same plots seen on the webpage with the same code though.
https://plotly.com/r/heatmaps/
When I try:
plot_ly(mydataframe)
all I get is a blank graph
plotly output graph
and the following text in the console:
No trace type specified:
Based on info supplied, a 'scatter' trace seems appropriate.
Read more about this trace type -> https://plotly.com/r/reference/#scatter
No scatter mode specifed:
Setting the mode to markers
Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Warning message:
No trace type specified and no positional attributes specified
Ideally, I would have my samples across the top or bottom of the heatmap (columns of mydataframe) and genes on the left or right of the heatmap (row names of mydataframe) and I would be able to zoom in on clusters of genes.
Any help is appreciated! If you know of any online resources that describe how to use plotly in more detail or another interactive heatmap package (have tried plot_ly and heatmaply), I would appreciate that as well.
Related
Im' trying to replicate the top 3D scatter plot on this website,
Unfortunately, this website doesn't contain any code, and doesn't specify clearly which package is used, and a google search yielded no useful results. I would like to replicate this plot with my own data, and get it in a format that's useful in a publication. Any suggestions?
I am new to R and I have been using chromoMap library in R to visualize annotation plots and visualizing the feature-associated data. It's a great library and produces great charts. However, I was not able to find any option for changing the x-axis label from length (bp) to anything else. Because of this, I am not able to use any of the produced charts. It sounds like a small issue, but it totally affects the usability of this great package. I followed this tutorial link and produced the below chart. In my chart and all the samples, the x-axis label is fixed and this is my problem and I am looking for a way to just change it.
library(chromoMap)
chr_file_1 = "chr_file_without_centromere.txt"
anno_file_1 = "annotation_pos.txt"
chromoMap(chr_file_1,anno_file_1)
I am wondering if anybody has the same experience ?? This package produces output as a htmlwidget object and therefore I could not change the x-axis lable. Is there any way to modify a htmlwidget object? or Any way to change this bp to something else??
Apologies, this is probably the simplest question. I'm having trouble making a scatterplot in R Studio. I am trying to see if amphipod counts are correlated to oxygen content. Whenever I plot this using:
plot(Amphipod~Oxygen...ml.l.)
I get a graph with boxes around certain points and I have no idea why. Only 5 points and I can't see anything different about those.
I am trying to build an interactive plot. It has properties between a scatterplot and a network - I have a list of nodes and edges (network), but I also would like to constrain the nodes, sometimes on the x-axis sometimes on both x- and y- axis (scatterplot). Finally, I have a text label associated with each node that I would like to display (instead of a dot). I was able to create this using ggplot2.
However, some data sets are too large for this to work without the text labels from each node overlapping. Hence, I would now like to add an interactive feature so that the plot consists of dots representing each node, but that upon UI (such as hovering over a dot), the text label belonging to that dot will be revealed.
I would like to achieve this using R.
I tried animint (https://github.com/tdhock/animint) but it seems to mostly allow interaction between two plots, and here I would like to keep it all in one plot.
I also tried htmlwidgets (http://www.htmlwidgets.org/). I looked at two of their packages: I tried using metricsgraphics (mjs_plot), as it has a show_rollover_text option and mouseover option. However, this package does not allow combination of geoms, and so I could not have both dots (nodes) and lines (edges) represented. I also tried network3D package, but that seems to automatically position nodes so that they are distanced far away from each other, and does not seem to provide options to fix each node on a given x and y location.
I am just looking for advice on any other packages I should maybe consider to solve this problem and/or if I may be missing a feature from a package I already tried that could solve this problem. Thank you.
Maybe identify() will be useful for you. But it works only for base plotting system.
x <- rnorm(300)
y <- rnorm(300)
labs <- seq(300)
plot(x,y)
identify(x,y, labels = labs, plot=TRUE)
identify pic
I'm doing a density compare in R using the sm package (sm.density.compare). Is there anyway I can get a mathematical description of the graph or at least a table with number of points rather than a plot back? I would like to plot the resulting graphs in a different application, but need the data to do so.
Thanks a lot for the help,
culicidae