Great, thanks for updating!

Djie

2012/2/15 Jeff Leek <jtleek@gmail.com>

> Djie,
>
> Thanks for pointing this out. It appears that as the software is designed
> you do need to order the categorical variables first in the mod argument.
> We will put out a new version of sva that addresses this issue and improves
> the speed of the fsva functions within the week.
>
> Thanks so much for your help!
>
> Jeff
>
> On Tue, Feb 14, 2012 at 5:37 PM, Djie Tjwan Thung <djie.thung@gmail.com>wrote:
>
>> Dear list and authors of SVA / ComBat,
>>
>> I might have stumbled upon a little bug in the ComBat function:
>>
>> ComBat(dat, batch, mod, numCovs=NULL, par.prior=TRUE,prior.plots=FALSE)
>>
>> mod should contain a model matrix for variables for outcome of interest
>> and
>> other covariates besides batch, including numerical covariates.
>> However it seems that all numerical covariates should be in the last
>> columns of the model matrix and all categorical covariates in the first
>> columns of the model matrix.
>> For example:
>>
>> mod <- model.matrix(~as.factor(pheno$gender) + pheno$age) #using this mod
>> variable as argument to ComBat works
>> modSwitch <- model.matrix(~pheno$age + as.factor(pheno$gender)) #using
>> this
>> modSwitch variable as argument to ComBat doesn't work:
>>
>> Error in solve.default(t(design) %*% design) :
>>  system is computationally singular: reciprocal condition number =
>> 4.60793e-21
>>
>> I've had a look into the package source files and I think the design.mat
>> function contains the problem, regarding this code:
>> #In this code ncov is number of categorical covariates and mod[,-tmp] is a
>> matrix without batch column and without intercept
>>    if(ncov>0){
>>        for (j in 1:ncov){
>>            tmp1 <- as.factor(as.matrix(mod[,-tmp])[,j])
>>            design <- build.design(tmp1,des=design)
>>            }
>>        }
>>
>> So I guess by looping from 1 till the number of categorical covariates,
>> you
>> assume these categorical variables should be at the beginning of the model
>> matrix.
>> Could someone verify this? I'd be willing to give some example data when
>> needed.
>> Maybe the documentation for the ComBat function could be updated by
>> clearly
>> stating this or the function could be improved?
>>
>> Regards,
>> Djie Thung
>> Bioinformatics Intern - Dept. of Human Genetics UMC Utrecht
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>

	[[alternative HTML version deleted]]

