Help with Limma
1
0
Entering edit mode
@venu-pullabhatla-5550
Last seen 7.4 years ago
Dear Limma users After finishing the analysis successfully with replicates, I am now trying to analyze the same without replicates. After following a suggestion that I can use Limma without applying the fit2 <- eBayes(fit2) step (for without replicates), I tried to do the same for just one of the patients as a test, but it failed because of the following error. Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : attempt to set an attribute on NULL Calls: topTable ... toptable -> as.matrix -> as.matrix.default -> array Execution halted I get this error when applying topTable function to get the list of DE genes. I have searched a lot for getting possible answers, but only ended in vain. I came across this post in many forums, but with no working solution. Can anyone please rectify my mistake in the script. I used the same script successfully for analyzing with replicates except applying the fit2 <- eBayes(fit2) step because of lack of replicates. Here is the script I am using library(limma) library(annotate) library(hgug4845a.db) targets <- readTargets("targets_individual_test", sep="\t") data <- read.maimages(targets, path=".", source="agilent.median", green.only=TRUE) bgdata <- backgroundCorrect(data, method="normexp", offset=16) normdata <- normalizeBetweenArrays(bgdata, method="quantile") normdata_avg <- avereps(normdata, ID=normdata$genes$ProbeName) condition <- factor(targets$Condition, levels = unique(targets$Condition)) design <- model.matrix(~0 + condition) colnames(design) <- levels(condition) fit <- lmFit(normdata_avg, design) fit$genes$Symbol <- getSYMBOL(fit$genes$ProbeName,"hgug4845a.db") contrast.matrix <- makeContrasts("Healthy-State1", "Healthy-State2", "Healthy-State3", levels=design) fit2 <- contrasts.fit(fit, contrast.matrix) ######## FINE UNTIL THIS STEP ########################### output <- topTable(fit2, coef="Healthy-State1", genelist=fit$genes, number=Inf) ###### I GET THE ERROR AFTER RUNNING THE ABOVE COMMAND ####### Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : attempt to set an attribute on NULL Calls: topTable ... toptable -> as.matrix -> as.matrix.default -> array Execution halted ################################################# write.table(output, file="output.txt", sep="\t", quote=FALSE) Many million thanks for the continued help and support. Best wishes Venu
limma limma • 873 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 9 hours ago
United States
Hi Venu, On 10/12/2012 5:06 AM, Venu Pullabhatla wrote: > Dear Limma users > > After finishing the analysis successfully with replicates, I am now > trying to analyze the same without replicates. After following a > suggestion that I can use Limma without applying the fit2 <- > eBayes(fit2) step (for without replicates), I tried to do the same for > just one of the patients as a test, but it failed because of the > following error. > > Error in array(x, c(length(x), 1L), if (!is.null(names(x))) > list(names(x), : > attempt to set an attribute on NULL > Calls: topTable ... toptable -> as.matrix -> as.matrix.default -> array > Execution halted > > I get this error when applying topTable function to get the list of DE > genes. I have searched a lot for getting possible answers, but only > ended in vain. I came across this post in many forums, but with no > working solution. Can anyone please rectify my mistake in the script. > > I used the same script successfully for analyzing with replicates > except applying the fit2 <- eBayes(fit2) step because of lack of > replicates. I think you might be confused. You cannot analyze data using limma if you have no replicates, and omitting the eBayes() step won't change things. In addition, I am not sure why you would want to analyze without replicates if you in fact have replicates. This makes no sense to me - why choose an ineffective analysis when you have a more robust alternative in hand? Best, Jim > > Here is the script I am using > > > library(limma) > library(annotate) > library(hgug4845a.db) > > targets <- readTargets("targets_individual_test", sep="\t") > data <- read.maimages(targets, path=".", source="agilent.median", > green.only=TRUE) > bgdata <- backgroundCorrect(data, method="normexp", offset=16) > normdata <- normalizeBetweenArrays(bgdata, method="quantile") > normdata_avg <- avereps(normdata, ID=normdata$genes$ProbeName) > > condition <- factor(targets$Condition, levels = > unique(targets$Condition)) > design <- model.matrix(~0 + condition) > colnames(design) <- levels(condition) > > fit <- lmFit(normdata_avg, design) > fit$genes$Symbol <- getSYMBOL(fit$genes$ProbeName,"hgug4845a.db") > > contrast.matrix <- makeContrasts("Healthy-State1", "Healthy-State2", > "Healthy-State3", levels=design) > fit2 <- contrasts.fit(fit, contrast.matrix) > > ######## FINE UNTIL THIS STEP ########################### > > output <- topTable(fit2, coef="Healthy-State1", genelist=fit$genes, > number=Inf) > > ###### I GET THE ERROR AFTER RUNNING THE ABOVE COMMAND ####### > > Error in array(x, c(length(x), 1L), if (!is.null(names(x))) > list(names(x), : > attempt to set an attribute on NULL > Calls: topTable ... toptable -> as.matrix -> as.matrix.default -> array > Execution halted > > ################################################# > > write.table(output, file="output.txt", sep="\t", quote=FALSE) > > Many million thanks for the continued help and support. > > Best wishes > > Venu > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician University of Washington Environmental and Occupational Health Sciences 4225 Roosevelt Way NE, # 100 Seattle WA 98105-6099
ADD COMMENT

Login before adding your answer.

Traffic: 860 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