Question: Using a truth table for ColumnData in DESeq2
gravatar for jrlarsen
6 months ago by
jrlarsen10 wrote:


I am doing differential expression analyses for the first time and using DESeq2. The tutorials are great, but I have a couple niche questions that I cannot find the precise answer to.

1) If I use a truth table for my ColumnData in DESeq2 where my rows are samples and my columns are events that occur or dont occur as follow:

     Event A  Event B Event C

S1     1             1            0

S2     1             0            1

S3     0             0            0

S4     1             0            1

Where 1 is the column event is occurring and 0 means the event is not occurring. Can DESeq2 recognize these as binary indicators of categorical data or will it assume it as a measure?

2) I would like to create a heatmap that increases from least difference to most difference, for the respective columns selected in ColumnData, from left to right and bottom to top. How do I do this appropriately for a count matrix?

Thank you, any help is appreciated, I just want to make sure I am proceeding correctly.

ADD COMMENTlink modified 6 months ago by Michael Love19k • written 6 months ago by jrlarsen10
gravatar for Michael Love
6 months ago by
Michael Love19k
United States
Michael Love19k wrote:

You should turn them into factors with levels 0 and 1. It won't make big difference to the model, but it will be easier on some helper functions that break things into groups, e.g. plotCounts()

See the vignette, we have examples of heatmaps. You would just make a subset of the data by the top genes, and then specify to the heatmap software not to reorder the rows of the heatmap.

ADD COMMENTlink written 6 months ago by Michael Love19k

1)Thank you so much Mike! I have never used factors, I know I can make columns into arrays and use factor() on those. Though I am not sure how to apply this to a data.frame() let alone one the has columns representing both quantitative and categorical data?

2) I just want to make sure this is the ordering by p-value? Lower the p-value the greater the difference?

Thank you so much for taking the time.

ADD REPLYlink written 6 months ago by jrlarsen10

If you want to use DE methods in R/Bioconductor, you should get to know factors!

These are a workhorse class for linear models and making comparisons in R. I'd suggest following some of these links:

Yes you would order by p-value. Yes, lower p-values mean that the null hypothesis should be rejected, where the null hypothesis is typically "no difference". You should also probably do some catch-up on basics of inference, p-values, adjusted p-values, FDR, etc. See the Inference section here, and further down, the multiple testing section:

ADD REPLYlink written 6 months ago by Michael Love19k

Thank you so much, I will definitely review. I appreciate you taking the time.

ADD REPLYlink written 6 months ago by jrlarsen10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 278 users visited in the last hour