microbiome / miaViz

Microbiome Analysis Plotting and Visualization
https://microbiome.github.io/miaViz
Artistic License 2.0
10 stars 12 forks source link

plotAbundanceDensity bugfix #34

Closed TuomasBorman closed 3 years ago

TuomasBorman commented 3 years ago

Hi,

@ChouaibB reported following error

tse <- microbiomeDataSets::atlas1006()
tse <- transformSamples(tse, method = "relabundance")
# no error
plotAbundanceDensity(tse, layout = "density", abund_values = "relabundance", n = 10 ) + scale_x_log10()
# error
assay(tse,"counts") <- NULL
plotAbundanceDensity(tse, layout = "density", abund_values = "relabundance", n = 10 ) + scale_x_log10()
Error in assay(x, abund_values) : 
  'assay(<TreeSummarizedExperiment>, i="character", ...)' invalid subscript 'i'
'counts' not in names(assays(<TreeSummarizedExperiment>))

The problem was that getTopTaxa did expect "counts" because it was the default value of abund_values but it was not present in SE

-Tuomas