Entering edit mode
8.1 years ago
hakimelakhrass
▴
80
Hello All,
Once again I am seeking the help of this forum. I am making an R package that streamlines my microarray analysis. It is driving me mad. I have 4 main functions at work, I try to combine them into one. Individually they work but together I get the following error.
Error in topTable(normfit, number = 1e+05, adjust = "BH", lfc = 1) :
fit must be an MArrayLM object
The problem which I think is happening, since each function uses an input of what comes before it , the 3rd function does not complete running before the last one starts.
function (mydir, group, design, contrast)
{
lonoan(mydir)
filterc(normData)
normfit(normData, group, design, contrast)
results(normfit)
}
The error comes from my results function.
function (normfit)
{
probeset.list <- topTable(normfit, number = 1e+05, adjust = "BH",
lfc = 1)
Symbol <- getSYMBOL(rownames(probeset.list), "hugene20sttranscriptcluster.db")
results <- cbind(probeset.list, Symbol)
assign("results", results, envir = .GlobalEnv)
}
At the end of the run the normfit variable is in the global environment and if I run the function again it works. This is driving me mad. Any solutions? Thanks.