Question: Change order of conditions when plotting: plotCounts {DESeq2}
0
gravatar for ecg1g15
6 weeks ago by
ecg1g150
ecg1g150 wrote:

I have a df of 17 variables (my samples) with the condition location which I would like to plot based on a single gene "gene1" When plotting:

library(DeSeq2)
plotCounts(df, "genename", intgroup=c("location"))

By default, the function plots the "conditions" alphabetically on the graph eg: East-Mid-West. But I would like to order them so I can see them on the graph West-Mid-East.

Is there a way of doing this? Thanks,

IMAGEhere

deseq2 R plotcounts • 79 views
ADD COMMENTlink modified 6 weeks ago • written 6 weeks ago by ecg1g150
Answer: Change order of conditions when plotting: plotCounts {DESeq2}
0
gravatar for Michael Love
6 weeks ago by
Michael Love24k
United States
Michael Love24k wrote:

Take a look at the vignette:

http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#plot-counts

It gives some code for how to customize this simple plot.

ADD COMMENTlink written 6 weeks ago by Michael Love24k
Answer: Change order of conditions when plotting: plotCounts {DESeq2}
0
gravatar for ecg1g15
6 weeks ago by
ecg1g150
ecg1g150 wrote:

I have found that you can manually change the order like this:

ddsMat$location <- factor(ddsMat$location, levels=c("West", "Mid", "East"))
ADD COMMENTlink written 6 weeks ago by ecg1g150
Answer: Change order of conditions when plotting: plotCounts {DESeq2}
0
gravatar for ecg1g15
6 weeks ago by
ecg1g150
ecg1g150 wrote:

I have found that you can manually change the order like this:

ddsMat$location <- factor(ddsMat$location, levels=c("West", "Mid", "East"))
ADD COMMENTlink written 6 weeks ago by ecg1g150
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 16.09
Traffic: 231 users visited in the last hour