Entering edit mode
8.7 years ago
dec986
▴
370
Hello,
I have data that looks like this:
transcript - Gene Symbol - Female Control 1 - Female Control 2 - Female Control 3 - Female low 1 - Female low 2 - Female low 3 - Female High 1 - Female High 2 - Female High 3 - Male Control 1 - Male Control 2 Male Control 3 - Male low 1 - Male low 2 - Male low 3 - Male high 1 - Male high 2 - Male high 3
condition <- factor(c(rep("Female Control",3),rep("Female Low",3),rep("Female High",3),rep("Male Control",3),rep("Male Low",3),rep("Male High",3)))
I make the comparisons in DESeq2 by this command, which works
write.table(file="DESeq2/male_control_vs_low_transcripts.tsv",sep="\t",quote=FALSE,results(dds, contrast=c("condition","Male Control","Male Low"),cooksCutoff=FALSE))
However, this fails:
write.table(file="DESeq2/female_vs_male_transcripts.tsv",sep="\t",quote=FALSE,results(dds,cooksCutoff=FALSE, contrast=c("condition","Female","Male")))
Why does the 1st command work but the 2nd command fail? How can I fix this?
The error given:
Error in rowSums(cts.sub == 0) :
'x' must be an array of at least two dimensions
Calls: write.table ... cleanContrast -> contrastAllZeroCharacter -> rowSums
Execution halted
doesn't help me at all.
Thanks very much,
-Dave
Hi Devon,
Thanks very much for your help! Unfortunately I am having a very hard time setting up the comparisons in DESeq2. I'm missing some important piece of information somewhere.
How can I do a 2-level comparison, like "male control" vs. "female control"? I don't see how to do this from examples and the manual.
-Dave
If you want to do comparisons like that then it's typically easiest to make groups like you already did and then use contrasts in a vector form for things like "male" vs. "female". For example, in your original design, the contrast for "male" vs. female is something like
c(0,-1,-1,-1,1,1,1)/3
.Thanks very much for your help, unfortunately I am still getting errors.
My script is so far:
but this gives an error:
and this object (
dds
) shows:But I can't figure out how I can set up the male vs. female comparison based on this, doesn't the comparison have to sum to 0?
My best guess is
but I don't see how this focuses on control.
Maybe the error is in
?
Thanks for any help. I am totally lost on this.
-Dave
Yeah, like I said, that'll only work in your original paramaterization, not the more traditional factorial design.