Question: How to make a barplot with error bars of counts from one gene between 2 conditions from DESeq2 data
1
gravatar for mmrcksn
2.8 years ago by
mmrcksn50
mmrcksn50 wrote:

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).

deseq graph rna-seq ggplot R • 1.5k views
ADD COMMENTlink modified 2.8 years ago • written 2.8 years ago by mmrcksn50
1

Have you read this manual?

ADD REPLYlink written 2.8 years ago by iraun3.5k
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 2.3.0
Traffic: 2061 users visited in the last hour