lmFit: Error in dimnames(fit$cov.coefficients)
1
0
Entering edit mode
Mete Civelek ▴ 180
@mete-civelek-4566
Last seen 9.6 years ago
Dear All, I am getting an error when trying to do an analysis with the lmFit function in the limma package. I can't get a handle at what the problem might be. I will appreciate any insights you can provide. Thank you Mete library(limma) memory.size(max = TRUE) MData<-read.delim("MData.txt", header=T, row.names=1) traits<-read.delim("MPheno.txt", header=T) #gene expression in rows, samples in columns dim(MData) #43145 rows, 1396 samples #samples in rows dim(traits) #301 traits and 1396 samples ind<-match(names(MData), traits$MOMID) traits<-traits[ind,] for(j in 136:ncol(traits)){ form1 <- as.formula(paste(" ~ ", paste(names(traits)[c(j,2:19)],collapse="+"))) design<-model.matrix(form1, data=traits) #Determine the samples with NAs in traits i <- !is.na(traits[,j]) rownames(design)<-colnames(METSIMData[,i]) fit<-lmFit(METSIMData[,i],design) Error in dimnames(fit$cov.coefficients) <- list(coef.names[est], coef.names[est]) : attempt to set an attribute on NULL > sessionInfo() R version 3.0.1 (2013-05-16) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] parallel splines stats graphics grDevices utils datasets methods base other attached packages: [1] limma_3.16.8 scatterplot3d_0.3-33 WGCNA_1.27-1 doParallel_1.0.3 iterators_1.0.6 foreach_1.4.1 MASS_7.3-29 [8] reshape_0.8.4 plyr_1.8 cluster_1.14.4 Hmisc_3.12-2 Formula_1.1-1 survival_2.37-4 flashClust_1.01-2 [15] dynamicTreeCut_1.60 impute_1.34.0 loaded via a namespace (and not attached): [1] codetools_0.2-8 grid_3.0.1 lattice_0.20-23 rpart_4.1-3 tools_3.0.1 ________________________________ IMPORTANT WARNING: This email (and any attachments) is o...{{dropped:9}}
limma limma • 1.7k views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 45 minutes ago
WEHI, Melbourne, Australia
Dear Mete, I have not seen this error before. The error is occuring after all the calculations are completed, immediately before lmFit returns its result. I don't follow your code. I would expect the subsetting METSIMData[,i] to cause a problem because you are changing the number of columns of data but do not appear to be changing the number of rows of the design matrix to match. However this sort of mismatch would cause a different error message to that which is reported. You might start by upgrading to the current release of Bioconductor (limma 3.18.3). Also have a close look at the design matrix you are entering to lmFit. Best wishes Gordon > Date: Mon, 18 Nov 2013 02:20:47 -0800 > From: Mete Civelek <mcivelek at="" mednet.ucla.edu=""> > To: <bioconductor at="" r-project.org=""> > Subject: [BioC] lmFit: Error in dimnames(fit$cov.coefficients) > > Dear All, > > I am getting an error when trying to do an analysis with the lmFit function > in the limma package. I can't get a handle at what the problem might be. I > will appreciate any insights you can provide. Thank you > > Mete > > library(limma) > memory.size(max = TRUE) > MData<-read.delim("MData.txt", header=T, row.names=1) > traits<-read.delim("MPheno.txt", header=T) > #gene expression in rows, samples in columns > dim(MData) > #43145 rows, 1396 samples > #samples in rows > dim(traits) > #301 traits and 1396 samples > ind<-match(names(MData), traits$MOMID) > traits<-traits[ind,] > > for(j in 136:ncol(traits)){ > form1 <- as.formula(paste(" ~ ", > paste(names(traits)[c(j,2:19)],collapse="+"))) > design<-model.matrix(form1, data=traits) > #Determine the samples with NAs in traits > i <- !is.na(traits[,j]) > rownames(design)<-colnames(METSIMData[,i]) > fit<-lmFit(METSIMData[,i],design) > Error in dimnames(fit$cov.coefficients) <- list(coef.names[est], > coef.names[est]) : > attempt to set an attribute on NULL > >> sessionInfo() > R version 3.0.1 (2013-05-16) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United > States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C > > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] parallel splines stats graphics grDevices utils datasets > methods base > > other attached packages: > [1] limma_3.16.8 scatterplot3d_0.3-33 WGCNA_1.27-1 > doParallel_1.0.3 iterators_1.0.6 foreach_1.4.1 MASS_7.3-29 > > [8] reshape_0.8.4 plyr_1.8 cluster_1.14.4 > Hmisc_3.12-2 Formula_1.1-1 survival_2.37-4 > flashClust_1.01-2 > [15] dynamicTreeCut_1.60 impute_1.34.0 > > loaded via a namespace (and not attached): > [1] codetools_0.2-8 grid_3.0.1 lattice_0.20-23 rpart_4.1-3 > tools_3.0.1 ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
ADD COMMENT
0
Entering edit mode
Dear Gordon, Thank you for the quick response. The reason I am not updating the design matrix is because it is already removing the NA's in the continuous variable predictor. I am doing the METSIMData[,i] to remove the individuals with the missing phenotypes so as to match the individuals in the design matrix. I have checked the dimensions and they agree. I have searched for this error on the Bioconductor list and couldn't find it. I will update to the latest limma and retry. Thanks Mete -----Original Message----- From: Gordon K Smyth [mailto:smyth@wehi.EDU.AU] Sent: Monday, November 18, 2013 2:49 PM To: Mete Civelek Cc: Bioconductor mailing list Subject: lmFit: Error in dimnames(fit$cov.coefficients) Dear Mete, I have not seen this error before. The error is occuring after all the calculations are completed, immediately before lmFit returns its result. I don't follow your code. I would expect the subsetting METSIMData[,i] to cause a problem because you are changing the number of columns of data but do not appear to be changing the number of rows of the design matrix to match. However this sort of mismatch would cause a different error message to that which is reported. You might start by upgrading to the current release of Bioconductor (limma 3.18.3). Also have a close look at the design matrix you are entering to lmFit. Best wishes Gordon > Date: Mon, 18 Nov 2013 02:20:47 -0800 > From: Mete Civelek <mcivelek at="" mednet.ucla.edu=""> > To: <bioconductor at="" r-project.org=""> > Subject: [BioC] lmFit: Error in dimnames(fit$cov.coefficients) > > Dear All, > > I am getting an error when trying to do an analysis with the lmFit > function in the limma package. I can't get a handle at what the > problem might be. I will appreciate any insights you can provide. > Thank you > > Mete > > library(limma) > memory.size(max = TRUE) > MData<-read.delim("MData.txt", header=T, row.names=1) > traits<-read.delim("MPheno.txt", header=T) #gene expression in rows, > samples in columns > dim(MData) > #43145 rows, 1396 samples > #samples in rows > dim(traits) > #301 traits and 1396 samples > ind<-match(names(MData), traits$MOMID) traits<-traits[ind,] > > for(j in 136:ncol(traits)){ > form1 <- as.formula(paste(" ~ ", > paste(names(traits)[c(j,2:19)],collapse="+"))) > design<-model.matrix(form1, data=traits) #Determine the samples with > NAs in traits i <- !is.na(traits[,j]) > rownames(design)<-colnames(METSIMData[,i]) > fit<-lmFit(METSIMData[,i],design) > Error in dimnames(fit$cov.coefficients) <- list(coef.names[est], > coef.names[est]) : > attempt to set an attribute on NULL > >> sessionInfo() > R version 3.0.1 (2013-05-16) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United > States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C > > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] parallel splines stats graphics grDevices utils datasets > methods base > > other attached packages: > [1] limma_3.16.8 scatterplot3d_0.3-33 WGCNA_1.27-1 > doParallel_1.0.3 iterators_1.0.6 foreach_1.4.1 MASS_7.3-29 > > [8] reshape_0.8.4 plyr_1.8 cluster_1.14.4 > Hmisc_3.12-2 Formula_1.1-1 survival_2.37-4 > flashClust_1.01-2 > [15] dynamicTreeCut_1.60 impute_1.34.0 > > loaded via a namespace (and not attached): > [1] codetools_0.2-8 grid_3.0.1 lattice_0.20-23 rpart_4.1-3 > tools_3.0.1 ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:18}}
ADD REPLY
0
Entering edit mode
Dear Gordon, Upgrading to the current release of limma solved the problem. I do not get error messages now. Thank you very much for your help. Mete -----Original Message----- From: Gordon K Smyth [mailto:smyth@wehi.EDU.AU] Sent: Monday, November 18, 2013 2:49 PM To: Mete Civelek Cc: Bioconductor mailing list Subject: lmFit: Error in dimnames(fit$cov.coefficients) Dear Mete, I have not seen this error before. The error is occuring after all the calculations are completed, immediately before lmFit returns its result. I don't follow your code. I would expect the subsetting METSIMData[,i] to cause a problem because you are changing the number of columns of data but do not appear to be changing the number of rows of the design matrix to match. However this sort of mismatch would cause a different error message to that which is reported. You might start by upgrading to the current release of Bioconductor (limma 3.18.3). Also have a close look at the design matrix you are entering to lmFit. Best wishes Gordon > Date: Mon, 18 Nov 2013 02:20:47 -0800 > From: Mete Civelek <mcivelek at="" mednet.ucla.edu=""> > To: <bioconductor at="" r-project.org=""> > Subject: [BioC] lmFit: Error in dimnames(fit$cov.coefficients) > > Dear All, > > I am getting an error when trying to do an analysis with the lmFit > function in the limma package. I can't get a handle at what the > problem might be. I will appreciate any insights you can provide. > Thank you > > Mete > > library(limma) > memory.size(max = TRUE) > MData<-read.delim("MData.txt", header=T, row.names=1) > traits<-read.delim("MPheno.txt", header=T) #gene expression in rows, > samples in columns > dim(MData) > #43145 rows, 1396 samples > #samples in rows > dim(traits) > #301 traits and 1396 samples > ind<-match(names(MData), traits$MOMID) traits<-traits[ind,] > > for(j in 136:ncol(traits)){ > form1 <- as.formula(paste(" ~ ", > paste(names(traits)[c(j,2:19)],collapse="+"))) > design<-model.matrix(form1, data=traits) #Determine the samples with > NAs in traits i <- !is.na(traits[,j]) > rownames(design)<-colnames(METSIMData[,i]) > fit<-lmFit(METSIMData[,i],design) > Error in dimnames(fit$cov.coefficients) <- list(coef.names[est], > coef.names[est]) : > attempt to set an attribute on NULL > >> sessionInfo() > R version 3.0.1 (2013-05-16) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United > States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C > > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] parallel splines stats graphics grDevices utils datasets > methods base > > other attached packages: > [1] limma_3.16.8 scatterplot3d_0.3-33 WGCNA_1.27-1 > doParallel_1.0.3 iterators_1.0.6 foreach_1.4.1 MASS_7.3-29 > > [8] reshape_0.8.4 plyr_1.8 cluster_1.14.4 > Hmisc_3.12-2 Formula_1.1-1 survival_2.37-4 > flashClust_1.01-2 > [15] dynamicTreeCut_1.60 impute_1.34.0 > > loaded via a namespace (and not attached): > [1] codetools_0.2-8 grid_3.0.1 lattice_0.20-23 rpart_4.1-3 > tools_3.0.1 ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:18}}
ADD REPLY

Login before adding your answer.

Traffic: 952 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6