[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bioc-devel
Subject:    Re: [Bioc-devel] Importing classes into NAMESPACE
From:       <hpages () fredhutch ! org>
Date:       2015-02-26 19:40:43
Message-ID: 54EF76BB.3050205 () fredhutch ! org
[Download RAW message or body]

Hi Karolis,

On 02/25/2015 09:02 AM, Karolis Uziela wrote:
> Thank you for your help everyone! Importing constructors separately (as
> Thomas suggested), has solved the problem.
>
> @Gabe: I am not using any methods from Biobase, GenomicRanges
> and S4Vectors. I am only using their constructors. Does it mean that I can
> skip importing the classes and only import the constructors? Or did you
> have something else in your mind?

If you really don't do anything with the objects returned by the
GRanges(), Rle(), or IRanges() constructors, that is, you either return
them directly to the user or pass them as input to other functions (not
methods), and if you don't define yourself methods for these classes,
I think you can skip importing the classes. However, as Gabe pointed
out, the cherry-picking game is generally not worth it and will often
turn out to be counter-productive.

Cheers,
H.

>
> I thought it is better to avoid importing whole packages, especially if
> they are large. Or do you have some arguments, why I should do that?
>
> Regards,
> Karolis
>
> On Wed, Feb 25, 2015 at 3:31 PM, Gabe Becker <becker.gabe@gene.com> wrote:
>
>> Karolis,
>>
>> Do you really not need any of the methods for GRanges and ExpressionSet
>> objects? import(GenomicRanges) might be better, even though the package
>> isn't exactly small.
>>
>> ~G
>>
>> On Wed, Feb 25, 2015 at 6:27 AM, Thomas Sandmann <sandmann.thomas@gene.c=
om
>>> wrote:
>>
>>> Hi Karolis,
>>>
>>> These classes have constructor functions of the same name as the class.
>>> For
>>> example, the constructor function for GRanges is called GRanges().
>>>
>>> If you use the constructors you need to import them separately, e.g.
>>>
>>> importFrom GenomicRanges GRanges
>>>
>>> Best,
>>> Thomas
>>>
>>>          [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> Bioc-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>>
>>
>>
>>
>> --
>> Gabriel Becker, Ph.D
>> Computational Biologist
>> Genentech Research
>>
>
>
>

-- =

Herv=E9 Pag=E8s

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: hpages@fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic