Hello,
I just discovered metacoder and I found it really cool to display the relative abundance of different eukaryotic groups depending on the sampling site, size fraction, depth in the water column, etc. I want to try to do the heat trees and compare them.
The problem is that I don't know how to plot the abundance (amount of reads of each OTU) instead of richness (number of OTUs).
My initial file looks like this (I trimmed the sequences, so it's easy to see).
>OTU_3 65123 Root;Stramenopiles;Ochrophyta;Chrysophyceae_Synurophyceae;Synurales;Synurales_X
CCAGCACCCGCGGTAATTCCAGCTCCAATAGCGTATACTAAAG
>OTU_6 82891 Root;Alveolata;Ciliophora;Spirotrichea;Choreotrichia;Tintinnidiidae
CCAGCACCCGCGGTAATTCCAGCTCCAATAGCGTATATTAAAGTTGTT
>OTU_4 2375 Root;Stramenopiles;Ochrophyta;Bacillariophyta;Bacillariophyta_X;Radial_Coscinodiscophyceae
CCAGCACCCGCGGTAATTCCAGCTCCAATAGCGTATATTAAAGTTGTT
>OTU_1 7365 Root;Cryptophyta;Cryptophyta;Cryptophyceae;Cryptophyceae_X;Cryptomonadales
CCAGCACCCGCGGTAATTCCAGCTCTAATAGCATATATTAAAGT
The second column is the abundance of each OTU and this is the value I want to plot as node_color.
My code right now is like this:
prueba <- file.path("EukSeqs_prueba.fa")
seqs.prueba <- ape::read.FASTA(prueba)
data.prueba <- extract_taxonomy(seqs.prueba, regex = "^(.*)\\t(.*)\\t(.*)", key = c(id = "obs_id", "obs_info", "class"), class_sep = ";")
heat_tree(data.prueba, node_size = n_obs, node_label = name, node_color = obs_info, overlap_avoidance = 0.5)
But an error pops up "Error in eval(expr, envir, enclos) : object 'obs_info' not found'
I checked the data.prueba and it has two tables (taxon_data and obs_data), but I don't know how to use the obs_info from the obs_data table and the name and n_obs from the taxon_data table...
Any help? Thank you so much, and congratulations for the package. It's great!!
Alicia