I am trying to run these below regression models using limma R package, but getting an issue due to out of memory even though I have mentioned more memory than this job script needed to run. First three models run successfully but then shows out of memory issue on SLURM HPC. Is there any other way to run these models using MPI or by using reduced memory?
#model matrix
var1<-model.matrix(~Analysis5 + sex + Age +CD8T +CD4T +NK + Bcell +Mono+smoking, data=targets2)
var2<-model.matrix(~Analysis5 + sex + Age +CD8T +CD4T +NK + Bcell +Mono+smoking + Batch+ Sentrix_Position, data=targets2)
var3 <-model.matrix(~Analysis5 + sex + Age +CD8T +CD4T +NK + Bcell +Mono+smoking + PC1 + PC2 + PC3, data=targets2)
var4 <-model.matrix(~Analysis5 + sex + Age +CD8T +CD4T +NK + Bcell +Mono+smoking + PC1 + PC2 + PC3+Glucose, data=targets2)
var5 <-model.matrix(~Analysis5 + sex + Age +CD8T +CD4T +NK + Bcell +Mono+smoking + PC1 + PC2 + PC3+eGFR, data=targets2)
var6 <-model.matrix(~Analysis5 + sex + Age +CD8T +CD4T +NK + Bcell +Mono+smoking + PC1 + PC2 + PC3+Chol, data=targets2)
##############
fit1<-lmFit(mval,var1)
fit1<-eBayes(fit1,trend=TRUE, robust=TRUE)
probe1<-topTable(fit1,adjust="BH",coef=2,num=Inf)
sig.probe1<-probe1[which(probe1$adj.P.Val<=0.05),]
write.table(sig.probe1,file="limma..model1.significant..output.txt",sep="\t",quote=TRUE)
write.table(probe1,file="limma..model1..output.txt",sep="\t",quote=TRUE)
#####################################
#model2
########
#model2
fit2<-lmFit(mval,var2)
fit2<-eBayes(fit2,trend=TRUE, robust=TRUE)
probe2<-topTable(fit2,adjust="BH",coef=2,num=Inf)
sig.probe2<-probe2[which(probe2$adj.P.Val<=0.05),]
write.table(sig.probe2,file="limma..model2.significant..output.txt",sep="\t",quote=TRUE)
write.table(probe2,file="limma..model2..output.txt",sep="\t",quote=TRUE)
###########################
fit3<-lmFit(mval,var3)
fit3<-eBayes(fit3,trend=TRUE, robust=TRUE)
probe3<-topTable(fit3,adjust="BH",coef=2,num=Inf)
sig.probe3<-probe3[which(probe3$adj.P.Val<=0.05),]
write.table(sig.probe3,file="limma..model3.significant..output.txt",sep="\t",quote=TRUE)
write.table(probe3,file="limma..model3..output.txt",sep="\t",quote=TRUE)
#######################################
fit4<-lmFit(mval,var4)
fit4<-eBayes(fit4,trend=TRUE, robust=TRUE)
probe4<-topTable(fit4,adjust="BH",coef=2,num=Inf)
sig.probe4<-probe4[which(probe4$adj.P.Val<=0.05),]
write.table(sig.probe4,file="limma..model4.significant..output.txt",sep="\t",quote=TRUE)
write.table(probe4,file="limma..model4..output.txt",sep="\t",quote=TRUE)
##########
fit5<-lmFit(mval,var5)
fit5<-eBayes(fit5,trend=TRUE, robust=TRUE)
probe5<-topTable(fit5,adjust="BH",coef=2,num=Inf)
sig.probe5<-probe5[which(probe5$adj.P.Val<=0.05),]
write.table(sig.probe5,file="limma..model5.significant..output.txt",sep="\t",quote=TRUE)
write.table(probe5,file="limma..model5..output.txt",sep="\t",quote=TRUE)
##########
fit6<-lmFit(mval,var6)
fit6<-eBayes(fit6,trend=TRUE, robust=TRUE)
probe6<-topTable(fit6,adjust="BH",coef=2,num=Inf)
sig.probe6<-probe6[which(probe6$adj.P.Val<=0.05),]
write.table(sig.probe6,file="limma..model6.significant..output.txt",sep="\t",quote=TRUE)
write.table(probe6,file="limma..model6..output.txt",sep="\t",quote=TRUE)
Many thanks,
These models sound using a lot of variables to me. Recently Gordon said "limma and voom work with any linear model. There can be any combination of continous covariates and categorical factors. The only requirement is that there should be enough samples to estimate all the model coefficients with some degrees of freedom left over to estimate the variance.". How many samples are there in this experiment?
Thanks, around 2000 samples and we are using two input files here; 1) sample phenotypes files (size= 442k) and methylation epic array data files (25G).