Find the package of a class given classname

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Find the package of a class given classname

Yuan Luo
How to find the package of a class given classname?
For example, there is a class called GAlignments, I want to do something
like
attr("GAlignments", "package") that gives you the package where the class
is defined? But of course, attr("GAlignments", "package") won't work...

Thanks for any help!
Yuan

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Find the package of a class given classname

Bert Gunter
This probably doesn't answer your question, but, amazingly enough, try
googling the class name.
It worked for GAlignmnets.

Incidentally, there's no reason class names have to be unique among R
packages.. And they can be hidden in namespaces.

Cheers,
Bert


Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch




On Fri, Jan 10, 2014 at 6:49 PM, Yuan Luo <[hidden email]> wrote:

> How to find the package of a class given classname?
> For example, there is a class called GAlignments, I want to do something
> like
> attr("GAlignments", "package") that gives you the package where the class
> is defined? But of course, attr("GAlignments", "package") won't work...
>
> Thanks for any help!
> Yuan
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Find the package of a class given classname

Hervé Pagès
In reply to this post by Yuan Luo
Hi Yuan,

On 01/10/2014 06:49 PM, Yuan Luo wrote:
> How to find the package of a class given classname?
> For example, there is a class called GAlignments, I want to do something
> like
> attr("GAlignments", "package") that gives you the package where the class
> is defined? But of course, attr("GAlignments", "package") won't work...

You didn't say whether you wanted to be able to do this
programmatically.

If that's the case maybe you're lucky and the package where the class
is defined is already attached to your session. In that case:


   > attr(class(new("GAlignments")), "package")
   [1] "GenomicRanges"

Otherwise, if the package in question is installed but not attached
you can still do:

   ??`GAlignments-class`

If the package is not installed but you have a vague idea that this
could be a Bioconductor container, then search the bioconductor
mailing list:

   http://bioconductor.org/help/mailing-list/

If that still doesn't give you the answer, then you're welcome to ask
on the list.

Cheers,
H.

PS: If you're using the current devel version of BioC (requires R devel)
the GAlignments class has moved to the new GenomicAlignments package.

>
> Thanks for any help!
> Yuan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: [hidden email]
Phone:  (206) 667-5791
Fax:    (206) 667-1319

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Find the package of a class given classname

Yuan Luo
This is exactly what I am looking for.
Thanks all for your help!

Best,
Yuan


On Sat, Jan 11, 2014 at 1:28 AM, Hervé Pagès <[hidden email]> wrote:

> Hi Yuan,
>
>
> On 01/10/2014 06:49 PM, Yuan Luo wrote:
>
>> How to find the package of a class given classname?
>> For example, there is a class called GAlignments, I want to do something
>> like
>> attr("GAlignments", "package") that gives you the package where the class
>> is defined? But of course, attr("GAlignments", "package") won't work...
>>
>
> You didn't say whether you wanted to be able to do this
> programmatically.
>
> If that's the case maybe you're lucky and the package where the class
> is defined is already attached to your session. In that case:
>
>
>   > attr(class(new("GAlignments")), "package")
>   [1] "GenomicRanges"
>
> Otherwise, if the package in question is installed but not attached
> you can still do:
>
>   ??`GAlignments-class`
>
> If the package is not installed but you have a vague idea that this
> could be a Bioconductor container, then search the bioconductor
> mailing list:
>
>   http://bioconductor.org/help/mailing-list/
>
> If that still doesn't give you the answer, then you're welcome to ask
> on the list.
>
> Cheers,
> H.
>
> PS: If you're using the current devel version of BioC (requires R devel)
> the GAlignments class has moved to the new GenomicAlignments package.
>
>
>> Thanks for any help!
>> Yuan
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/
>> posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> --
> Hervé Pagès
>
> Program in Computational Biology
> Division of Public Health Sciences
> Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N, M1-B514
> P.O. Box 19024
> Seattle, WA 98109-1024
>
> E-mail: [hidden email]
> Phone:  (206) 667-5791
> Fax:    (206) 667-1319
>
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Find the package of a class given classname

hadley wickham
In reply to this post by Hervé Pagès
>> How to find the package of a class given classname?
>> For example, there is a class called GAlignments, I want to do something
>> like
>> attr("GAlignments", "package") that gives you the package where the class
>> is defined? But of course, attr("GAlignments", "package") won't work...
>
> You didn't say whether you wanted to be able to do this
> programmatically.
>
> If that's the case maybe you're lucky and the package where the class
> is defined is already attached to your session. In that case:
>
>   > attr(class(new("GAlignments")), "package")
>   [1] "GenomicRanges"

Or maybe findClass?

>
> Otherwise, if the package in question is installed but not attached
> you can still do:
>
>   ??`GAlignments-class`

Or class?GAlignments

Hadley

--
http://had.co.nz/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.