Direct access of individual method documentation in a module
Hello all,=0AIs there any convenient way to check the documentation (and so=
urce code) for individual method of an installed module? For instance, biop=
erl has a module called Bio::Seq. I may simply check the documentation of t=
his whole module using:=0Aperldoc Bio::Seq=0A=0ABut now i am interested in =
getting more information about a method called add_SeqFeature. There seem t=
o be no good way other than searching in the whole documentation of the mod=
ule. Ideally, I want some thing like the below (unfortunately they don=E2=
=80=99t work):=0Aperldoc Bio::Seq::add_SeqFeature=0Aperldoc -f Bio::Seq::ad=
d_SeqFeature=0A=0AAlso it would be helpful if I can locate and print out th=
e definition source code chuck for this particular method. Could anyone sug=
gest some good way to access the documentation/source code for individual f=
unction/method? Thanks!=0AHeyi=0A
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Direct access of individual method documentation in a module
On 4/25/11 Mon Apr 25, 2011 5:16 PM, "heyi xiao" <xiaoheyiyh [at] yahoo.com>
scribbled:
> Hello all,
> Is there any convenient way to check the documentation (and source code) =
for
> individual method of an installed module? For instance, bioperl has a mod=
ule
> called Bio::Seq. I may simply check the documentation of this whole modul=
e
> using:
> perldoc Bio::Seq
>
> But now i am interested in getting more information about a method called
> add_SeqFeature. There seem to be no good way other than searching in the =
whole
> documentation of the module. Ideally, I want some thing like the below
> (unfortunately they don=B9t work):
> perldoc Bio::Seq::add_SeqFeature
> perldoc -f Bio::Seq::add_SeqFeature
perldoc processes the module source file, extracts the embedded POD
documentation, if any, and displays it on your monitor. Documentation is fo=
r
the module as a whole, not individual methods. It is up to the module write=
r
to include POD information for each method, but it is not required. There i=
s
no mechanism in POD or perldoc to display information about a specified
method.
>
> Also it would be helpful if I can locate and print out the definition sou=
rce
> code chuck for this particular method. Could anyone suggest some good way=
to
> access the documentation/source code for individual function/method? Than=
ks!
> Heyi
Use can use the following arguments to perldoc to find or display the
module's source file:
-m Display module's file in its entirety
-l Display the module's file name
For example, on Unix you can view the source code in the vi editor in
read-only mode with this command:
view `perldoc -l Bio::Seq`
from which I can tell you that the add_SeqFeature method starts on line 106=
2
in version 1.6.1.
You can also find module source code at cpan.org:
<http://cpansearch.perl.org/src/CJFIELDS/BioPerl-1.6.0/Bio/Seq.pm>
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Direct access of individual method documentation in a module
On Mon, Apr 25, 2011 at 20:16, heyi xiao <xiaoheyiyh [at] yahoo.com> wrote:
> Is there any convenient way to check the documentation (and source code) for individual method of an installed module? For instance, bioperl has a module called Bio::Seq. I may simply check the documentation of this whole module using:
> perldoc Bio::Seq
Everything Jim Gibson said is spot on, but I will also mention that
for the Bio::Perl modules specifically, there exists a website called
the BioPerl Deobfuscator at
<http://bioperl.org/cgi-bin/deob_interface.cgi>. Here's the entry for
add_SeqFeature:
<http://bioperl.org/cgi-bin/deob_detail.cgi?method=Bio::Seq::add_SeqFeature>.
The Bio::Perl modules are *very* heavily object-oriented, and it can
sometimes be hard to tell where a particular method is implemented,
due to all the inheritance that's going on behind the scenes. The
Deobfuscator helps with that. (Note that it still doesn't give you the
code, but it will give you the method signature and return values.)
chrs,
john.
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Direct access of individual method documentation in a module
Hello Jim and John,=0AThe information you provided is very helpful! Thanks =
a lot!=0AOne related question here. Sometimes I would like to check the sou=
rce code of a particular method. But it can sometimes be hard to tell where=
a particular method is implemented due to the object-oriented programming =
approach as John noted. Is there any good way in perl to track the inherita=
nce tree as to check the source code of a method in the module where it is =
defined originally. For example, how to track down the source code of add_S=
eqFeature, as it is not defined in Bio::Seq, the module I am looking at. Th=
anks!=0AHeyi=0A=0A=0A--- On Mon, 4/25/11, heyi xiao <xiaoheyiyh [at] yahoo.com> =
wrote:=0A=0A> From: heyi xiao <xiaoheyiyh [at] yahoo.com>=0A> Subject: Direct ac=
cess of individual method documentation in a module=0A> To: beginners [at] perl.=
org=0A> Date: Monday, April 25, 2011, 8:16 PM=0A> Hello all,=0A> Is there a=
ny convenient way to check the documentation (and=0A> source code) for indi=
vidual method of an installed module?=0A> For instance, bioperl has a modul=
e called Bio::Seq. I may=0A> simply check the documentation of this whole m=
odule using:=0A> perldoc Bio::Seq=0A> =0A> But now i am interested in getti=
ng more information about a=0A> method called add_SeqFeature. There seem to=
be no good way=0A> other than searching in the whole documentation of the=
=0A> module. Ideally, I want some thing like the below=0A> (unfortunately t=
hey don=E2=80=99t work):=0A> perldoc Bio::Seq::add_SeqFeature=0A> perldoc -=
f Bio::Seq::add_SeqFeature=0A> =0A> Also it would be helpful if I can locat=
e and print out the=0A> definition source code chuck for this particular me=
thod.=0A> Could anyone suggest some good way to access the=0A> documentatio=
n/source code for individual function/method?=0A> Thanks!=0A> Heyi=0A> =0A>=
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: Direct access of individual method documentation in a module
At 8:12 AM -0700 4/26/11, heyi xiao wrote:
>Hello Jim and John, The information you provided is very helpful!
>Thanks a lot! One related question here. Sometimes I would like to
>check the source code of a particular method. But it can sometimes
>be hard to tell where a particular method is implemented due to the
>object-oriented programming approach as John noted. Is there any
>good way in perl to track the inheritance tree as to check the
>source code of a method in the module where it is defined
>originally. For example, how to track down the source code of
>add_SeqFeature, as it is not defined in Bio::Seq, the module I am
>looking at. Thanks!
The add_SeqFeature is indeed found in Seq.pm. It starts at line 1049.
Why do you say it is not defined there?
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/