Skip to content
Prev 5494 / 21307 Next

[Bioc-devel] A question on IRanges package

On 04/03/2014 06:17 PM, Yuan Luo wrote:
(I'm only the messenger) .local is a nested function created when a method adds 
arguments to the generic. After

     setGeneric("foo", function(x, ...) standardGeneric("foo"))
     setMethod("foo", "A", function(x, ...) x)
     setMethod("foo", "B", function(x, y, ...) { x })

compare

     > selectMethod("foo", "A")
     Method Definition:

     function (x, ...)
     x

     Signatures:
             x
     target  "A"
     defined "A"
     > selectMethod("foo", "B")
     Method Definition:

     function (x, ...)
     {
         .local <- function (x, y, ...)
         {
             x
         }
         .local(x, ...)
     }

     Signatures:
             x
     target  "B"
     defined "B"

so .local appears on the call stack (after the generic and method, so for 
findOverlaps(IRanges(), IRanges(), type="o") we have in part

3: .local(query, subject, maxgap, minoverlap, type, select, ...)
2: findOverlaps(IRanges(), IRanges(), type = "o")
1: findOverlaps(IRanges(), IRanges(), type = "o")

corresponding, in reverse order, to the generic, the method, and the nested 
function).