Off topic:Trying to merge 4 of my functions into 1 but running into problems.
0
0
Entering edit mode
8.2 years ago

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.

limma microarrays bioconductor • 1.3k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2071 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