hbc / bcbioRNASeq

R package for bcbio RNA-seq analysis.
https://bioinformatics.sph.harvard.edu/bcbioRNASeq
GNU Affero General Public License v3.0
58 stars 21 forks source link

Add complex interaction in the template #191

Closed kokyriakidis closed 1 year ago

kokyriakidis commented 1 year ago

Hi @mjsteinbaugh !

I have a quick question:

Let's say I want to make the following interactions:

X3G-X0G
X3μG-X0μG
X0μG-X0G
Χ3μG-X3G

That's easy on the template.

What if I wanted to test the interaction of interactions? Does that make sense? How do I do that in the contrasts?

(X3μG-X0μG)-(Χ3G-X0G)
mjsteinbaugh commented 1 year ago

Hi @kokyriakidis , unfortunately more complex contrasts other than pairwise aren't supported by the R Markdown template, since we're trying to keep it simple for most users.

You can generate the starter DESeqDataSet with this command:

# Coerce bcbioRNASeq object to DESeqDataset.
dds <- as.DESeqDataSet(bcb)

Then follow the recommendations in the DESeq2 vignette.

kokyriakidis commented 1 year ago

In this part:

deseq <- DESeqAnalysis(
    data = dds,
    transform = dt,
    results = resListUnshrunken,
    lfcShrink = resListShrunken
)
saveData(deseq, dir = params[["data_dir"]])

I get an error:

Error in validObject(.Object) : 
invalid class "DESeqAnalysis" object: DESeqResults list must be named.
If supported, 'updateObject' may help resolve these issues.

I should change resListUnshrunken to resListUnshrunken[[1]] or something like that to select the contrast I want. Is there a easier way to automatically do it for all contrasts?

mjsteinbaugh commented 1 year ago

Just ensure that resListUnshrunken and resListShrunken are named, with matching names -- i.e. what is the name of the contrast you ran? This is a sanity check in the DESeqAnalysis object to ensure there is sufficient metadata for the current analysis.

mjsteinbaugh commented 1 year ago

Hi @kokyriakidis , I'm going to close this issue because it's outside the scope of the bcbioRNASeq package. Let me know if this would still be useful, and I can think about adding support for complex interactions in DESeqAnalysis.