Question: (Closed) Trying to merge 4 of my functions into 1 but running into problems.
0
gravatar for hakimelakhrass
5.0 years ago by
hakimelakhrass80 wrote:

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.

microarrays limma bioconductor • 1000 views
ADD COMMENTlink modified 2.5 years ago by Ram32k • written 5.0 years ago by hakimelakhrass80

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!

ADD REPLYlink modified 2.5 years ago • written 5.0 years ago by Ram32k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2381 users visited in the last hour
_