Box plots with logFC values
0
0
Entering edit mode
9 weeks ago
myfam128 • 0

Hi

I am trying to draw box plots to show change in expression value between two conditions using deseq2. boxplot using ggplot

d <- plotCounts(dds, gene="gene_id", intgroup="condition", returnData = TRUE)
ggplot(d, aes(x=condition, y=log2(count))) +  geom_boxplot()

Is this enough to show the differential expression of a gene between two conditions?

I would like to draw boxplots with logFC values on Y axis for a single gene in two conditions. Can please let me know how to do that?

boxplot logFC • 488 views
ADD COMMENT
0
Entering edit mode

How can you do a box plot of a single LogFC value?

ADD REPLY
0
Entering edit mode

As in you would like to display the logFC as an annotation; or you would like to transform it so that every datapoint is shown not in its absolute log2(count) value; but its relative value relative to the mean of condition 1: log2(count) - mean_condition1_log2count?

ADD REPLY
0
Entering edit mode

I have seen in many research papers logFC boxplots between two conditions

example enter image description here

Is this as you said above a relative value

ADD REPLY
0
Entering edit mode

In your post you're plotting the expression values of a gene, but in this figure they are plotting the log2FCs. Can you explain more what you want to show with your figure?

ADD REPLY
0
Entering edit mode

I am trying to show If a gene is up-regulated or down-regulated

ADD REPLY
0
Entering edit mode

I'm not familiar with the publication that figure is drawn from; but one way to define a per-sample logFC value is to measure the fold change relative to one of the group means. So...as i said above, just have something like cond1_mean = mean(log2(subset(data, gene=gene_id & condition=cond1)$expr)); ggplot(subset(data=gene_id)) + geom_boxplot(aes(x=condition, y=log2(expr)-cond1_mean))

ADD REPLY
0
Entering edit mode

Thank you I will try that

ADD REPLY

Login before adding your answer.

Traffic: 2369 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6