-1

I am trying to make a count plot from RNA-seq data for individual genes. I am only interested in the comparisons between each treatment and the control group and my data are paired, so I'm trying to show this. I have managed to make the graph on the left (Counts of single gene) by using the plotCounts function of DEseq2 and then modify the graph a bit. The code is the following:

data <- plotCounts(dds, gene="GB41122", intgroup=c("Treatment", "Home", "Behaviour"), returnData=TRUE)
data <- ggplot(data, aes(x=Treatment, y=count, shape = Behaviour, color=Home, group=Home)) +
  scale_y_log10() + 
  geom_point() + geom_line()

How could this be modified so that the graph looks like the one to the right?

Also, how can I reorder the treatment levels so that I have ctr to the left, then CO1 and CO2 to the right?

Thank you! Andrea

1 Answers1

0

I don't know how change the lines, but to reordrer the treatment levels, try adding this to your code:

+ scale_x_discrete(limits=c("Ctr", "CO1", "CO2"))

B_slash_
  • 309
  • 2
  • 17