How to make a barplot with error bars of counts from one gene between 2 conditions from DESeq2 data
Entering edit mode
5.3 years ago
mmrcksn ▴ 50

I'm very new to R, so this seemingly simple task is proving difficult for me. I want to make a barplot of the counts for one specific gene between two conditions from my gene expression dataset. Here's what I have so far:

Generating the DESeq dataset:

dds <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory, design= ~ condition) dds <- DESeq(dds)

Using "Gen1" as my example gene, making a bar plot:

mygene<- plotCounts(dds, gene="Gen1", intgroup="condition", returnData=TRUE) ggplot(mygene, aes(x=condition, y=count)) + geom_bar(mapping = NULL, data = NULL, stat = "identity", position = "stack") + ylab("Normalized Count") + xlab("Treatment") + ggtitle("Gen1")

Here's what it looks like

I know I need to add geom_errorbar() and specify ymin and ymax but I'm having trouble even calculating standard error the way my data is organized. I'm wondering what to do / how to organize it better for this. I have 24,063 genes and 2 conditions (a group of 11 samples and a group of 9 samples).

RNA-Seq R graph deseq ggplot • 3.0k views
Entering edit mode

Have you read this manual?


Login before adding your answer.

Traffic: 1373 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6