This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to create a mutation frequency comparison plot?

I was wondering if there were any packages on could use to generate a plot similar to the one below (preferably in R). I have similar data with P-value and statistical testing already completed. Image source

enter image description here

r data-visualization plot

1 answer

You can make this with just ggplot. It would be two geom_point, a geom_linerange, and three geom_text layers.

For a rough code scaffold.

ggplot(aes(y=gene_name)) +
  geom_linerange(aes(xmin=min_value_column, xmax=max_value_column)) +
  geom_point(aes(x=triangle_point_column), shape=17, color="red") +
  geom_point(aes(x=circle_point_column)) +
  geom_text(aes(x=min_value_column, label=min_value_column), nudge_x=-1, nudge_y=1) +
  geom_text(aes(x=max_value_column, label=max_value_column), nudge_x=1, nudge_y=1) +
  geom_text(aes(x=(min_value_column + max_value_column) / 2, label=significance_astericks_column), nudge_y=1)

That's awesome thank you. Found out after a bit of researching that this is called a Cleveland Dot Plot if anyone else comes across this.

Log in to answer this question.