alexpiper / taxreturn

An R package for creating taxonomic reference databases for metabarcoding studies
GNU General Public License v3.0
8 stars 1 forks source link

tax2tree #24

Open padpadpadpad opened 2 years ago

padpadpadpad commented 2 years ago

Hi Alex

Package looks amazing! Have stumbled across it because I am trying to implement something similar to the tax2tree algorithm implemented by greengenes. And a quick Google flagged your tax2tree function!

I have a tree and after assigning taxonomy some of the tips remain unassigned at Order for example. I want to say if you are NA but within a monophyletic group of things that are named, you become that Order.

Does your tax2tree function deal with a similar problem?

Cheers Dan

alexpiper commented 2 years ago

Hi Dan,

I was not aware of the greengenes tax2tree algorithm until now. Ive looked into it, and unfortunately my tax2tree function does not deal with that problem. My function just simply transforms a vector of names that are in a heirarchial taxonomy format (i.e., Metazoa;Arthropoda;Insecta;Hemiptera;Acanaloniidae;Acanalonia;Acanalonia_bivittata) into a phylo object for plotting.

I havent really come up against that issue before, so I dont really have any code that achieves the goal you are after unfortunately. The problem does sound somewhat similar to ancestral state reconstruction / hidden state prediction algorithms where you want to predict the unknown value of a trait for a tip (in this case taxonomic label) using the known values of closely related tips. Ive used functions from the castor R package for this before, and you might find some inspiration there. Good luck with the implementation!

Cheers, Alex