gavinmdouglas / FuncDiv

R package for computing alpha and beta contributional diversity metrics
9 stars 0 forks source link

taxa tree and abundances? #4

Closed marwa38 closed 1 year ago

marwa38 commented 1 year ago

Hi again I think it will be helpful to clarify for me regarding alpha diversity

  1. I don't think that I need the sequence or a database sequence ID for the taxon, ASV1, ASV2 would be enough?
  2. in in_tree <- ape::read.tree("taxa.tree") is it tree produced from picrust2 as it is not clear? image

Thanks M

gavinmdouglas commented 1 year ago

Hi again,

  1. Yes the taxa just need the same ids in the taxa abundance and function copy number tables.

  2. The tree produced by the PICRUSt2 pipeline could be used there - it's not specified as such because FuncDiv is agnostic to the provenance of the input data (and actually it was designed with metagenome-assembled genomes in mind).

Cheers,

Gavin

gonzalofe commented 7 months ago

Hello. Regarding input, data... Could I use the default stratified contributions file provided by picrust2? Also, unfortunately I don't have the phylogenetic tree generated by picrust2, could use a phylogenetic tree generated from a phyloseq object? Thank you.

gavinmdouglas commented 7 months ago

Hi @gonzalofe,

Yes, you can use the output table from PICRUSt2. The key thing is that you need to specify what the four key column names are that the tool is looking for. You can take a look at this line from the FuncDiv tutorial for help:

alpha_out <- alpha_div_contrib(metrics = metrics,
                               contrib_tab = contrib_tab,
                               in_tree = in_tree,
                               ncores = 1,
                               replace_NA = FALSE,
                               samp_colname = "samp",
                               func_colname = "func",
                               taxon_colname = "tax",
                               abun_colname = "tax_abun")

If you're inputting a PICRUSt2 stratified table, then you would want to specify:

...
                               samp_colname = "sample",
                               func_colname = "function",
                               taxon_colname = "taxon",
                               abun_colname = "taxon_rel_abun")

Regarding the tree - FuncDiv is agnostic to how the input tree was produced. As long as the tip labels match the labels in the "taxon" column then it should work correctly.

Cheers,

Gavin