ropensci / taxa

taxonomic classes for R
https://docs.ropensci.org/taxa
Other
48 stars 12 forks source link

How to handle identical function names in other packages #99

Open zachary-foster opened 7 years ago

zachary-foster commented 7 years ago

For example: We hoped to not have to change the names of either phyloseq::filter_taxa or taxa::filter_taxa.

This is a continuation of the conversion here:

https://github.com/joey711/biom/issues/26

joey711 commented 7 years ago

Before making design decisions on a package meant to be "core", I highly recommend reading Hadley's field guide to OO in R.

Quick comment, S4 is a complete OO, but uses functional semantics. R5 and R6 use the more common "reference" semantics that you've seen elsewhere. S3 is somewhat incomplete, dispatch not explicit, etc.

http://adv-r.had.co.nz/OO-essentials.html

zachary-foster commented 7 years ago

Thanks @joey711! I have read that a while ago, but it would be a good idea to read it again before starting any S4 programming.

joey711 commented 7 years ago

May want to also look at this discussion on coercion:

https://github.com/waldronlab/curatedMetagenomicData/issues/96#issuecomment-328232962

And also at the SummarizedExperiment class:

https://www.bioconductor.org/packages/devel/bioc/vignettes/SummarizedExperiment/inst/doc/SummarizedExperiment.html

I'm adding some coercion methods to SummarizedExperiment for phyloseq and biomformat packages. Pretty natural, and the package code might provide some helpful examples for seeing S4 development in this context. My early mistake with phyloseq was to not leverage this infrastructure more.