dib-lab / elvers

(formerly eelpond) an automated RNA-Seq workflow system
https://dib-lab.github.io/elvers/
Other
28 stars 3 forks source link

How to run DESeq2 with 3 treatments? #152

Open matthewabirk opened 5 years ago

matthewabirk commented 5 years ago

I can't figure out how to configure my yaml to allow DESeq2 to test 3 treatments.

When I try

deseq2:
  contrasts:
    salinity:
    - 250mM
    - 2M
    - 4M
  gene_trans_map: true
  pca:
    labels:
    - condition

Then, I get an error in /automounts/workspace/workspace/mbirk/artemia/artemia_out_all/logs/deseq2/artemia_input.csalinity.deseq2.log:

Error in checkContrast(contrast, resNames) : 
  'contrast', as a character vector of length 3, should have the form:
contrast = c('factorName','numeratorLevel','denominatorLevel'),
see the manual page of ?results for more information
Calls: results -> checkContrast
Execution halted

I also tried:

deseq2:
  contrasts:
    250mM-v-2M:
    - 250mM
    - 2M
    2M-v-4M:
    - 2M
    - 4M
    250mM-v-4M:
    - 250mM
    - 4M
  gene_trans_map: true
  pca:
    labels:
    - condition

But then the only output is the last set of contrasts. What's the proper way to format the yaml for this?

bluegenes commented 5 years ago

Hi @matthewabirk:

I have not yet enabled more complex designs within elvers. I'd recommend you grab the .deseq2.rds (R data) file from the deseq2 output directory, and work with deseq2 directly in R.

You can see elvers/elvers/rules/deseq2/deseq2-init-tx2gene.R or elvers/elvers/rules/deseq2/deseq2-init-txOut.R for how this dataset is being generated from the salmon counts.

https://support.bioconductor.org/p/102445/ might also be helpful.

matthewabirk commented 5 years ago

Thanks! Just a note: the last two lines of deseq2.R are currently:

write.table(as.data.frame(res), file=snakemake@output[["table"]])
write.table(as.data.frame(res), file=snakemake@output[["sigTable"]])

Shouldn't the 2nd line be?

write.table(as.data.frame(sigRes), file=snakemake@output[["sigTable"]])
bluegenes commented 5 years ago

fixed - thanks!