Issue 009) Adapt taxmap utility functions to taxonomy

Thu Sep 22 14:18:34 2016

I noticed that the edge list in taxonomy does not have an edge for each taxon. This is different than how it was structured in metacoder and this is making adapting functions like supertaxa more difficult than I thought. Also, the algolrythm used to construct the edge list involves an all-vs-all comparison of taxon objects. I think I had originally done something like this in metacoder, but eventully opted for a recursive strategy to make it faster on large datasets. However, I dont think I have ever taken into account situations like:

a > b > c b > c

Something to look into...

Wed Dec 7 18:25:57 2016

I think I have a non-recursive way to make an edge list from hierarchies.

mammalia <- taxon(
  name = taxon_name("Mammalia"),
  rank = taxon_rank("class"),
  id = taxon_id(9681)
)
plantae <- taxon(
  name = taxon_name("Plantae"),
  rank = taxon_rank("kingdom"),
  id = taxon_id(33090)
)
unidentified <- taxon(
  name = taxon_name("unidentified"),
  rank = taxon_rank("species"),
  id = taxon_id(0)
)
x <- taxonomy(unidentified_plant, unidentified_animal)
> x
<Taxonomy>
  3 taxa: 1. Plantae, 2. unidentified, 3. Mammalia
  2 edges: 1->2, 3->2


ropenscilabs/taxa documentation built on Feb. 23, 2024, 6:31 p.m.