replace cat with message in glmTreat when lfc = 0
1
0
Entering edit mode
oliverd • 0
@949ecd58
Last seen 13 days ago
United States

This is an enhancement request to replace cat in glmTreat to message or warning.

Currently the code looks like this:


if (lfc == 0) {
        fun <- ifelse(isLRT, "glmLRT", "glmQLFTest")
        cat(paste0("Zero log2-FC threshold detected. Switch to ", 
            fun, "() instead."), "\n")
        return(do.call(fun, args = list(glmfit, coef, contrast)))
    }

I understand that it is important to make the user aware that something fundamental to the analysis is changing by default, but there is no way to capture this type of printing when you're fully aware of what is happening and don't want to see the messages (e.g. code testing).

edgeR glmTreat • 117 views
ADD COMMENT
0
Entering edit mode

but there is no way to capture this type of printing when you're fully aware of what is happening and don't want to see the messages (e.g. code testing).

captured <- capture.output({

   a <- 1
   n <- 3
   g <- glmTreat()
   something <- 123

})

Will assign all variables as usual, and capture cat to captured.

ADD REPLY
0
Entering edit mode
@gordon-smyth
Last seen 20 hours ago
WEHI, Melbourne, Australia

Yes, I agree that the message should be a message rather than cat output, and the message is perhaps not needed at all, because anyone would expect anyway that a glmTreat analysis with lfc=0 to be the same as an ordinary analysis. I will fix.

Note that we have added new fc and lfc arguments to the devel version of glmQLFit, to give threshold functionalty without the need for a separate glmTreat function. The glmQLFit version handles the lfc=0 special case silently. I am inclined to make glmTreat silent as well.

ADD COMMENT

Login before adding your answer.

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