ropensci / taxa

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

`parse_tax_data`: incorperate rank info #113

Closed zachary-foster closed 6 years ago

zachary-foster commented 6 years ago

Currently, the Taxon objects created for the taxmap output of parse_tax_data do not add rank information, although it is often available in various forms. This means taxon_ranks() does not work as expected (see https://github.com/grunwaldlab/metacoder/issues/188 and https://github.com/grunwaldlab/metacoder/issues/189).

The challenge here is the diversity of inputs to parse_tax_data and the different ways ranks can be encoded:

This means there are 4 ways to encode rank and handling all would require at least 2 new options and a new class_key value. The class_key value is intuitive and would not clutter the help page any, but I hesitate to add 2-3 options to handle rank.

Currently, I am thinking of doing the following:

This will not handle lists of data.frames, but that is the least common input type. Maybe another option called "rank_col" could be added in the future.