Trying to merge 4 of my functions into 1 but running into problems.
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.
• 1,446 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello hakimelakhrass!
We believe that this post does not fit the main topic of this site.
Not a bioinformatics question. Please ask stackoverflow.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!