KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
67 stars 23 forks source link

Problems plotting functions in amp_heatmap when aggregating on species-level #164

Open SofieZacho opened 9 months ago

SofieZacho commented 9 months ago

I have troubles plotting functions in amp_heatmap when setting tax_aggregate = 'Species' as shown in example below:

amp_heatmap(data,
            group_by = 'SampleSite',
            normalise = F,
            tax_aggregate = 'Species',
            tax_add = c("Genus"),
            tax_empty = 'remove',
            plot_functions = T)

I am getting the following error:

Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [18] is duplicated

It is working completely fine when using tax_aggregate = 'Genus'. I can also make a text map (textmap=T) and get the function information when aggregating at species-level.

Thanks, Kasper!