This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help with geom_dotplot() script

I'm rather new to R so any help would be much appreciated. Does someone know how to adjust the following script so that I can present a dot plot with these sort of deconvolution proportions? I can't seem to make it work.

Many thanks!

enter image description here

# read in the Subject*Counts (raw counts) matrix
deconv <- read.csv("dtangle_VL_dataset.csv",
                          sep= ",",
                          header = TRUE,
                          row.names=1,
                          stringsAsFactors = F)

geom_dotplot(data = deconv,
  position = "identity",
  binwidth = NULL,
  binaxis = "x",
  method = "dotdensity",
  binpositions = "bygroup",
  stackdir = "up",
  stackratio = 1,
  dotsize = 1,
  stackgroups = FALSE,
  origin = NULL,
  right = TRUE,
  width = 0.9,
  drop = FALSE,
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE
)
dotplot ggplot

are you sure that you want a ggplot dot plot and not something more like the Seurat dot plots seen at https://satijalab.org/seurat/reference/dotplot?

Else, is there an error that you are getting when running the above code? It will be helpful to know in order to troubleshoot.

would I be able to create a Seurat object with the table I've shown above? I obtained these numbers by feeding normalized counts into a deconvolution shiny app so the above table is all I have to work with.

I was not trying to suggest that you use the Seurat DotPlot function for making your plot. I only referenced Seurat as an example dot plot that seemed more like what you are looking for than what geom_dotplot gives you.

For a dot plot like Seurat DotPlot I use geom_point instead of geom_dotplot and set the point color and point size to a continuous value.

Also note, to use ggplot2 your table above will need to be reformatted from wide to long, see https://tidyr.tidyverse.org/reference/pivot_longer.html

You need to always put ggplot() first in order to construct the initial object that your geoms etc are placed on. So just put 'ggplot()+' before geom_dotplot

0 answers

No answers yet.

Log in to answer this question.