[BioC] EdgeR design question?
Gordon K Smyth
smyth at wehi.EDU.AU
Mon Jan 13 00:24:24 CET 2014
Dear Joseph,
You have not fitted the right model. You need
~ Genotype + Genotype:Age
instead of
~ Age + Age:Genotype
You can follow the section 3.3.2 in the edgeR User's Guide.
Best wishes
Gordon
> Date: Sat, 11 Jan 2014 12:36:07 -0800 (PST)
> From: joseph <jdsandjd at yahoo.com>
> To: "bioconductor at r-project.org" <bioconductor at r-project.org>
> Subject: [BioC] EdgeR design question?
>
> Hi
> I am using edgeR to analyse an RNA-seq experiment with two factors, age (Young, Old) and genotype (Wt, Mutant).
>> targets
> Age Genotype
> Sample1 Young Wt
> Sample2 Young Wt
> Sample3 Young Wt
> Sample4 Young Mutant
> Sample5 Young Mutant
> Sample6 Young Mutant
> Sample7 Old Wt
> Sample8 Old Wt
> Sample9 Old Wt
> Sample10 Old Mutant
> Sample11 Old Mutant
> Sample12 Old Mutant
>
> I know from previous experiments that the age effect is different between Wt and Mutant genotypes.
> I would like to find:
> 1. genes that change with age in Wt.
> 2. genes that change with age in Mutant.
> 3. genes that change with age differently between the genotypes (interaction).
>
> Can the following approach answer these questions?
>
> targets$Age <- relevel(targets$Age, ref="Young")
> targets$Genotype <- relevel(targets$Genotype, ref="Wt")
> design1 <- model.matrix(~Age + Age:Genotype, data=targets)
>> design1
> (Intercept) AgeOld AgeYoung:GenotypeMutant AgeOld:GenotypeMutant
> Sample1 1 0 0 0
> Sample2 1 0 0 0
> Sample3 1 0 0 0
> Sample4 1 0 1 0
> Sample5 1 0 1 0
> Sample6 1 0 1 0
> Sample7 1 1 0 0
> Sample8 1 1 0 0
> Sample9 1 1 0 0
> Sample10 1 1 0 1
> Sample11 1 1 0 1
> Sample12 1 1 0 1
> attr(,"assign")
> [1] 0 1 2 2
> attr(,"contrasts")
> attr(,"contrasts")$Age
> [1] "contr.treatment"
> attr(,"contrasts")$Genotype
> [1] "contr.treatment"
>
>
> I think coef=4 in design1 represents the genes that change with age in Mutant; but I don't know what coefficient represents the genes that change with age in Wt.
>
> design2 <- model.matrix(~Age*Genotype, data=targets)
>> design2
> (Intercept) AgeOld GenotypeMutant AgeOld:GenotypeMutant
> Sample1 1 0 0 0
> Sample2 1 0 0 0
> Sample3 1 0 0 0
> Sample4 1 0 1 0
> Sample5 1 0 1 0
> Sample6 1 0 1 0
> Sample7 1 1 0 0
> Sample8 1 1 0 0
> Sample9 1 1 0 0
> Sample10 1 1 1 1
> Sample11 1 1 1 1
> Sample12 1 1 1 1
> attr(,"assign")
> [1] 0 1 2 3
> attr(,"contrasts")
> attr(,"contrasts")$Age
> [1] "contr.treatment"
> attr(,"contrasts")$Genotype
> [1] "contr.treatment"
>
> coef=4 in design2 represents the interaction of age and genotype.
>
> Thank you for your help
> Joseph
>
>
>> sessionInfo()
> R version 3.0.2 Patched (2013-10-28 r64119)
> Platform: x86_64-apple-darwin10.8.0 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] edgeR_3.4.2 limma_3.18.7
>
> loaded via a namespace (and not attached):
> [1] tools_3.0.2
______________________________________________________________________
The information in this email is confidential and intend...{{dropped:5}}
More information about the Bioconductor
mailing list