Saturday, November 16, 2013

Exploring S4 Objects in R


Looking what is inside of a particular method.
Method - spectra
Class - MSnExp
If method is exported (check NAMESPACE) then this will work.
getMethod("spectra","MSnExp")
Method Definition:
function (object) 
{
    sl <- as.list(assayData(object))
    fnames <- featureNames(object)
    return(sl[fnames])
}

Signatures:
        object  
target  "MSnExp"
defined "MSnExp"

Showing slots for a given class
showClass("MSnExp")

showMethods(classes="MSnExp", where="package:MSnbase")
The link to check http://missingreadme.wordpress.com/2011/01/04/how-to-see-the-code-for-s4-methods-in-r/
Debugging
trace(show, tracer=browser, signature=c(x="eSet"), where=getNamespace("Biobase"))

No comments:

Post a Comment

Checking font availability on Mac   fc-list : family | grep "Fira Code"   or   system_profiler -json SPFontsDataType | grep \...