joey711/phyloseq — pull request #55 by pjm2 (2011-12-19 11:45:11+00:00)
Title: This will update to Bioconductor submission version

(v0.5.38 on devel numbering, jumped to 0.99.0 upon resubmission)

The following contains the list of updates:

Submission version number is 0.5.38:

- Check any remaining suggestions from Bioconductor staff.
DONE.

- Change all sampleMap()-accessor name to samData() or sampleData().
DONE.

- Rebuild the basics vignette after successful re-build of code w/ sampleData
DONE. Both vignettes rebuilt. Bugs squished.

- Rebuild example data so that it has the new slot name, samData.
DONE.

- Everywhere it says "sampleMap", change to "sampleData"
Done.

- Everywhere it says "sampleData(", change to "samData("

- check for direct slot assignments using "sampleData=", these need to
be changed to the new slot name "samData="

- The source file "sampleMap-class.R" needs to be changed to "sampleData-class.R"
Done.

- Change the class name from "sampleMap" to "sampleData".
- Same with virtual class "sampleDataOrNULL"
Done.

- The slot name should change from @sampleData to @samData
- In get.component.classes(), the "name" should change to samData slot name
Done.

v0.5.31+ has sampleMap change. . . Revert to 0.5.30 if there's a problem.

- Does makenetwork() orient the table, or check, at all?
DONE. v0.5.29. Fixed artifacts in makenetwork()

- Fix assignment bug where otuTable(x)<- has an error if x is otuTable.
This is a trivial syntactic bug, the assignment should just return the value.
Allows certain non-S4 functions to work just by assigning result to main argument.
DONE. v0.5.29

- Finish checking for examples for all functions.
DONE. v0.5.29
Checked and fixed a lot of them.
- sampleSums, speciesSums
DONE. v0.5.29

- import functions
DONE. v0.5.29

- getSamples, getSpecies
DONE. v0.5.29

- threshrankfun needs some examples.
DONE. v0.5.29

- Remove all reference to "higher order" or "higher-order" classes. Just phyloseq.
DONE. 0.5.28

- rename mergespecies() to merge_species(), everywhere, for consistency.
- main source code (DONE. 3 source files modified)
- basics vignette (DONE. Not present)
- big vignette (DONE. One body text function reference modified)
DONE. 0.5.27

- Make envHash2otuTable internal function.
Rename read_env_file to import_env_file
DONE.

- Add and document at least one interesting, already-published dataset.
DONE. Added enterotype (2011) and esophagus (2010) datasets.

- Add validity methods regarding phyloseq-defined classes.
see ~/Dropbox/R/validity-methods.R
DONE 0.5.21+

- Add "ape::" qualification back to all ape objects in accordance with
Bioconductor guidelines for "depends" dependencies.
Removed all "@import ape" tags from oxygen source headers.
DONE. v0.5.19. Also updated doc and features of plot_phyloseq()

- Migrate ape dependency from "depends" to "imports", as suggested by Bioconductor folks.
(https://github.com/joey711/phyloseq/issues/47)
NOTE: This was abandoned due to poor and incomplete NAMESPACE file in
current version (2.8) of ape-package.	ape-package still depends. In
the process of analyzing this, it was determined that the phylobase
dependency could be completely removed from phyloseq-package without
any consequences or limitations. Trees are now represented and stored
internally using the "phylo" class from the ape package, but modified
with the setOldClass() method to create an S4 container for it that
can behave properly with the rest of phyloseq-package.

The remainder of this item constitutes notes from the process of first removing ape::
notation (which was later added-back because the namespace of ape is incomplete)
and investigating bugs leftover from removing phylobase:

Getting close. Conflict causing pointless warning regarding the "edges" method from
phylobase, which will need to be specifically imported, along with everything else
from phylobase that you use. A time-efficient strategy seems to be:
- remove all general (unadorned) @import phylobase tags
- check that indeed phylobase is no longer "imported" in the namespace
- Try to do the obvious ones, "phylo" and "phylo4" classes, most method calls
appearing under "phylo4" signatures, and other obvious places.
- look at the errors regarding method-calls to "unknown" methods, stragglers.

Need to determine which tags to use. Good guesses are:
@importFrom, @importClassesFrom, @importMethodsFrom

#' @importFrom phylobase as
#' @importFrom phylobase tipLabels
#' @importFrom phylobase nodeLabels
#' @importClassesFrom phylobase phylo4
#' @importClassesFrom phylobase phylo

This has led to other errors during build. New strategy:
REMOVE phylobase PACKAGE FROM DEPENDENCIES.
Basically all meaningful analysis use of trees is done by first converting the phylo4
object to an ape-defined phyla class. Skip phylobase as the clumsy-namespaced middleman.

The following two lines of code will make the S3-defined "phylo" class definable for S4 slots/unions:

setOldClass("phylo")
setClassUnion("phyloOrNULL", c("phylo", "NULL"))

This is all you need for the slot, and no more dealing with phylo4/phylo ambiguation.
Just hope there aren't any tree file-types that are only readable by phylobase
(seems unlikely to be a persistent risk).

DONE. As of 0.5.18+ this no-phylobase approach seems to load without warnings. Some
re-testing is warranted, particularly of examples involving trees. Vignettes
build fine. Some brief tests involving plotting trees from phyloseq-class object
also works as expected.
DONE.

- Check merge_phyloseq() function for bugs using different combinations of slots in phlyoseq object.
make sure they are performing their role appropriately in the new paradigm.
Checks started. This will be easy. So far so good. It's probably fine.
DONE. 0.5.16+ Different class merges appear fine in tests. No obvious sources of error
in the method-changes for the 0.5.n update.

- Check merge_samples()
Done. Fine. Probably from much earlier version.

- Special fixes for taxaplot(). It has special S4 dispatching depending on which 2 or 3 components are available. Need to change this to an if/switch.
- test examples in taxaplot() to make sure those changes are functioning correctly.
DONE. Examples for taxaplot within the big vignette all work perfectly.
Additional tests on a subsets of ex1 in which some of the components are missing…
Works when supposed to, halts with standard accessor error when it is not supposed to work.
DONE. v0.5.16

- Fix problem in UniFrac example. Seems to be an issue with phyloseq() constructor no longer
pruning the tree. I vaguely remember an error like this before, but not the fix.
CONFIRMED. reconcile species is not pruning the tree.
CONFIRMED. Appears that prune_species() is not pruning the trees…
Was bug in which species.names() from phyloseq-class was same as otuTable, but if other
components differed from good-species vector, but not species.names(otuTable), then
pruning was skipped. This has been fixed by taking the union of all species.names from
all objects. 0.5.13.
Need to follow-through, and perhaps change species.names(signature("phyloseq")) to return
the union of all species.names() on all components.
DONE. 0.5.15+ species.names() and sample.names(), nsamples, nspecies accessors all use the
union of the component results, rather than just the value returned for otuTable(). This
should avoid any of the previously observed issues observed for reconciliation. It also
depends on splat.phyloseq.objects() returning only the non-NULL/empty slots of
a phyloseq-class object. Also revised documentation for a number of accessors, replacing
"x" or "object" with a more descriptive "physeq" as variable name. Links for phyloseq-class
documentation added as often as appropriate. Also converted a number of phyloseq-slot related
functions into internal-functions, as users should generally not be converting phyloseq-class
objects into lists, reconciling species/samples, etc. They should focus on using phyloseq()
constructor, importers, etc., all of which will handle these things automagically.

- Consider making a universal "import" wrapper function that calls all the other importers, depending
upon the input arguments.
DONE. First version of import() function added in 0.5.14 with doc.

- Add NArm option to taxglom(), to remove taxa if their classification is undetermined at the specified rank.
DONE. Add NArm option for pruning, and also bad_empty argument to manually specify new/different
values that can be considered "empty".

- migrate accessors, constructors, etc. to a className-class.R file from their current
accessor-methods.R and related files. Was requested by Bioconoductor convention,
and not a deal-breaker by any means.
DONE. Refinement of this is ongoing. v0.5.3+

- check all methods that they are using the appropriate accessor.
DONE. They will error if not. Need to build tests.

- change all phyloseqFather class names to "phyloseq". Consider if method is still
useful, and delete if it is not.
DONE.

- update documentation of the new accessors to explain the error/NULL option, etc.
DONE.

- omit special "initialization" setMethod in favor of a constructor
DONE. Extraneous slots omitted from otuTable-class as well.

- adapt "show" methods for phyloseq-class from otuSamTaxTree. Have it skip the NULL slots,
and/or list them as empty.
DONE. This was accomplished mainly by the revision of splat.phyloseq.objects() to
only return non-empty slots. The show,phyloseq-method just loops show() on the
output from splat.phyloseq.objects

- Does edgelist2clique have any purpose in this version of the code?? You just moved it to makenetwork so at least it doesn't have its own file. Does makenetwork() not use it? How does it differ from single-linkage clustering (if at all)?
DONE. NOPE. Could not find the function being called anywhere. Saved to your own repository of
functions and development. Removed from package. 0.5.6+
UPDATE. Indeed, edgelist2clique is being used by tipglom.internal. Its absence caused an error.
Added its source back, adjacent to tipglom.internal, within the new transform_filter-methods.R source file
DONE. v0.5.7+

- Add references and online examples for envHash2otuTable() and read_env_file().
They are now in the import_qiime.r file
DONE. As of v0.5.11

- At minimum, condense all import_*.R files into one IO-methods.R source file, separated with huge
commenting sections by import type.
DONE. As of 0.5.6+

- Make sure you have all of the replacement operators in place:
taxTab(x) <- ...
tre(x) <- ...
otuTable(x) <- ...
sampleMap(x) <- ...
DONE. A formal test is included in the new test_new_phyloseq.R script, which should eventually
be converted to a formal testing module included in the package for future development.

- AND also test prune_species() on phyloseq-class objects, to make sure this properly, also.
DONE. Looks good.

- mt() needs some looking over.
DONE. mt-method revised as of v0.5.10, both documentation and dispatch.
Formal test written and included in test_new_phyloseq.R

- Need to re-build ex1 data as a "phyloseq" object instead of a otuSamTaxTree object…
DONE. As of 0.5.4.

- Need to Re-draw class structure diagram in "basics" vignettes.
DONE. As of 0.5.9+
basics vignette also update to reflect class changes. Could still use a more thorough reading to make sure there aren't any lingering artifacts.

- "Taxonomic Level:" needs to be changed to "Taxonomic Rank:"
DONE.

- migrate:
threshrank.R
transformSampleCounts.R
transpose-methods.R
geneFilterSample.R
prune_species.R
prune_samples.R
taxglom.R
tipglom.R
to:
transform_filter-methods.R
DONE. As of 0.5.6+

-migrate:
calcplot.r
makenetwork.r
taxaplot.r
tip.annotate.r
colname2hex.r
to:
plot-methods.R
DONE. As of 0.5.6+

-migrate:
cca.phyloseq.R
rda.phyloseq.R
to:
ordination-methods.R
DONE. As of 0.5.6+

- migrate:
merge_phyloseq.r
merge_samples.r
mergespecies.r
to
merge-methods.R
DONE. As of 0.5.6+

- getvalues.r source migrated to almostAllAccessors.R
DONE. 0.5.6+