[Bioc-devel] Duplicated method names in purrr and GenomicRanges

Liu, Qian Q|@n@L|u @end|ng |rom Ro@we||P@rk@org
Thu Sep 12 16:28:24 CEST 2019


In order to remove the warning message, you can do the following to import both packages,

@rawNamespace import(GenomicRanges, except=�reduce�)
@importFrom purrr reduce

Then the NAMESPACE of direct "reduce" call will be reserved only to the package of "purrr". Which means that when you do "reduce()", this function refers to the "purrr", When you use the reduce function from GenomicRanges, you have to use "GenomicRanges::reduce".
________________________________
From: Bioc-devel <bioc-devel-bounces using r-project.org> on behalf of Michael Lawrence via Bioc-devel <bioc-devel using r-project.org>
Sent: Thursday, September 12, 2019 7:05 AM
To: O'CALLAGHAN Alan <A.B.O'Callaghan using sms.ed.ac.uk>
Cc: bioc-devel using r-project.org <bioc-devel using r-project.org>
Subject: Re: [Bioc-devel] Duplicated method names in purrr and GenomicRanges

Third option: use Reduce() from base instead of purr::reduce().

On Thu, Sep 12, 2019 at 2:54 AM O'CALLAGHAN Alan
<A.B.O'Callaghan using sms.ed.ac.uk> wrote:
>
> Hi,
>
> Two options.
>
> First option: import either purrr::reduce or GenomicRanges::reduce, and
> call the other with [pkg]::reduce.
>
> Second option: remove the import for both of these. Use purrr::reduce
> and GenomicRanges::reduce to call both functions.
>
> I think the second option leads to clearer code and would be my definite
> preference.
>
>
> On 12/09/2019 10:07, bioinf using posteo.de wrote:
> > Dear all,
> >
> > I am developing a Bioconductor package and have a problem with two
> > methods which have the same name. I am using the reduce() function
> > from the R packages GenomicRanges and purrr. All methods from other
> > packages are imported with @importFrom in all of my functions.
> >
> >
> > During devtools::document() I get the following Warning:
> >
> > ...
> >
> > replacing previous import �GenomicRanges::reduce� by �purrr::reduce�
> > when loading �testPackage�
> >
> > ...
> >
> >
> > Here are my NAMESPACE entries:
> >
> > # Generated by roxygen2: do not edit by hand
> >
> > export(mergeDataFrameList)
> > export(reduceDummy)
> > importFrom(GenomicRanges,GRanges)
> > importFrom(GenomicRanges,reduce)
> > importFrom(IRanges,IRanges)
> > importFrom(dplyr,"%>%")
> > importFrom(dplyr,left_join)
> > importFrom(dplyr,mutate)
> > importFrom(dplyr,pull)
> > importFrom(magrittr,"%<>%")
> > importFrom(purrr,reduce)
> > importFrom(tibble,tibble)
> >
> >
> > I am not using both reduce functions in the same function. To use the
> > GenomicRanges reduce function, I have to call this function like this:
> > GenomicRanges::reduce().
> >
> > I understand the warning and why I have to call the reduce function
> > like this. Is there a solution for this problem? Compiling a R package
> > with warnings and calling functions like this is not the best way I
> > guess.
> >
> > I am using R version 3.6.1 (2019-07-05)
> >
> > Thanks for help!
> >
> > Best,
> >
> > Tobias
> >
> > _______________________________________________
> > Bioc-devel using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/bioc-devel
> The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
> _______________________________________________
> Bioc-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



--
Michael Lawrence
Scientist, Bioinformatics and Computational Biology
Genentech, A Member of the Roche Group
Office +1 (650) 225-7760
michafla using gene.com

Join Genentech on LinkedIn | Twitter | Facebook | Instagram | YouTube

_______________________________________________
Bioc-devel using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


This email message may contain legally privileged and/or confidential information.  If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited.  If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list