How to show the definition of readFastq
2
0
Entering edit mode
Peng Yu ▴ 940
@peng-yu-3586
Last seen 10.3 years ago
I want to show the definition of readFastq. But showMethods doesn't show the function where I can find the body. Would you please let me know how to show the body of the function. > library(ShortRead) > showMethods('readFastq') Function: readFastq (package ShortRead) dirPath="SolexaPath" dirPath="character" -- Regards, Peng
• 1.3k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 5 months ago
United States
On 05/22/2010 02:30 PM, Peng Yu wrote: > I want to show the definition of readFastq. But showMethods doesn't > show the function where I can find the body. Would you please let me > know how to show the body of the function. > >> library(ShortRead) >> showMethods('readFastq') > Function: readFastq (package ShortRead) > dirPath="SolexaPath" > dirPath="character" Hi Peng -- Use showMethods(readFastq, includeDef=TRUE) perhaps add class="character" or use selectMethod; later you might find it useful to remember ::: as a way to see unexported functions. Martin -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 3 months ago
United States
getMethods(mname) will retrieve definitions for all methods named mname getMethod(mname, sig) will retrieve definition for specified signature for your query > getMethod("readFastq", "character") Method Definition: function (dirPath, pattern = character(0), ...) { .local <- function (dirPath, pattern = character(0), ..., qualityType = c("Auto", "FastqQuality", "SFastqQuality"), filter = srFilter(), withIds = TRUE) { if (!missing(filter)) .check_type_and_length(filter, "SRFilter", NA) tryCatch(qualityType <- match.arg(qualityType), error = function(err) { .throw(SRError("UserArgumentMismatch", conditionMessage(err))) }) src <- .file_names(dirPath, pattern) elts <- .Call(.read_solexa_fastq, src, withIds) qualityFunc <- switch(qualityType, Auto = { alf <- alphabetFrequency(elts[["quality"]], collapse = TRUE) if (min(which(alf != 0)) < 59) FastqQuality else SFastqQuality }, SFastqQuality = SFastqQuality, FastqQuality = FastqQuality) quality <- qualityFunc(elts[["quality"]]) srq <- if (withIds) ShortReadQ(elts[["sread"]], quality, elts[["id"]]) else ShortReadQ(elts[["sread"]], quality) if (!missing(filter)) srq <- srq[filter(srq)] srq } .local(dirPath, pattern, ...) } <environment: namespace:shortread=""> Signatures: dirPath target "character" defined "character" it might be easier just to obtain the source version of the package and read as text On Sat, May 22, 2010 at 5:30 PM, Peng Yu <pengyu.ut@gmail.com> wrote: > I want to show the definition of readFastq. But showMethods doesn't > show the function where I can find the body. Would you please let me > know how to show the body of the function. > > > library(ShortRead) > > showMethods('readFastq') > Function: readFastq (package ShortRead) > dirPath="SolexaPath" > dirPath="character" > > > -- > Regards, > Peng > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
On Sat, May 22, 2010 at 4:40 PM, Vincent Carey <stvjc at="" channing.harvard.edu=""> wrote: > getMethods(mname) will retrieve definitions for all methods named mname > getMethod(mname, sig) will retrieve definition for specified signature > > for your query > >> getMethod("readFastq", "character") Why the following command doesn't work for 'quality'? > getMethod('quality', 'ShortReadQ') Error in getMethod("quality", "ShortReadQ") : No method found for function "quality" and signature ShortReadQ > showMethods('quality') Function: quality (package Biostrings) x="ANY" x="FastqQuality" (inherited from: x="ANY") x="ShortReadQ" (inherited from: x="ANY") -- Regards, Peng
ADD REPLY
0
Entering edit mode
On 05/22/2010 03:46 PM, Peng Yu wrote: > On Sat, May 22, 2010 at 4:40 PM, Vincent Carey > <stvjc at="" channing.harvard.edu=""> wrote: >> getMethods(mname) will retrieve definitions for all methods named >> mname getMethod(mname, sig) will retrieve definition for specified >> signature >> >> for your query >> >>> getMethod("readFastq", "character") > > Why the following command doesn't work for 'quality'? > >> getMethod('quality', 'ShortReadQ') > Error in getMethod("quality", "ShortReadQ") : No method found for > function "quality" and signature ShortReadQ >> showMethods('quality') > Function: quality (package Biostrings) x="ANY" x="FastqQuality" > (inherited from: x="ANY") x="ShortReadQ" (inherited from: x="ANY") see ?getMethod and the difference between selectMethod and getMethod, conveniently documented on the same page. A call to ?getMethod? ... makes no use of inheritance. The function ?selectMethod? ... makes full use of the method dispatch mechanism; Martin > > -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD REPLY
0
Entering edit mode
On Sun, May 23, 2010 at 5:25 PM, Martin Morgan <mtmorgan at="" fhcrc.org=""> wrote: > On 05/22/2010 03:46 PM, Peng Yu wrote: >> On Sat, May 22, 2010 at 4:40 PM, Vincent Carey >> <stvjc at="" channing.harvard.edu=""> wrote: >>> getMethods(mname) will retrieve definitions for all methods named >>> mname getMethod(mname, sig) will retrieve definition for specified >>> signature >>> >>> for your query >>> >>>> getMethod("readFastq", "character") >> >> Why the following command doesn't work for 'quality'? >> >>> getMethod('quality', 'ShortReadQ') >> Error in getMethod("quality", "ShortReadQ") : No method found for >> function "quality" and signature ShortReadQ >>> showMethods('quality') >> Function: quality (package Biostrings) x="ANY" x="FastqQuality" >> (inherited from: x="ANY") x="ShortReadQ" (inherited from: x="ANY") > > see ?getMethod and the difference between selectMethod and getMethod, > conveniently documented on the same page. > > ? ? A call to ?getMethod? ... makes no use of inheritance. > > ? ? The function ?selectMethod? ... makes full use of the method > ? ? dispatch mechanism; Let me explain what I understand. Would you please let me know if my understanding is correct? quality is defined for signature 'ANY'. 'ShortReadQ' is inherited from 'ANY'. Since getMethod doesn't use inheritance, "getMethod('quality', 'ShortReadQ')" will not show retrieve the correct the function, right? I also see the class 'derivedDefaultMethod', where is it defined? > selectMethod(quality, 'ShortReadQ') Method Definition (Class "derivedDefaultMethod"): function (x) x at quality <environment: namespace:biostrings=""> Signatures: x target "ShortReadQ" defined "ANY" -- Regards, Peng
ADD REPLY

Login before adding your answer.

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