microeco icon indicating copy to clipboard operation
microeco copied to clipboard

cal_abund, trans_abund$new and plot_bar does shows all classification in legends

Open ShailNair opened this issue 3 years ago • 4 comments

I imported tsv files as dataframe and created an R6 object. Everything goes smoothly till I calculate abundance and plot barplots. Here when I specify a taxrank the plot will show all classifications pretending to that taxrank. e.g.

image

using delete_full_prefix = TRUE/FALSE in plot_bar does not make any difference

ShailNair avatar Jun 01 '21 23:06 ShailNair

Hi, I can not make sure where the issue come from. Could you please provide more information, such as the codes you used and your microtable object dataset?

ChiLiubio avatar Jun 02 '21 07:06 ChiLiubio

hi, Here is the data file data.zip

ShailNair avatar Jun 02 '21 07:06 ShailNair

Hi, It is the prefix issue in the taxonomic table. In your tax_table of 'ms2', the prefix is like "k_" and "g_". In the previous version, this case was not covered in the function tidy_taxonomy function. However, double underlines are necessary in the functions of trans_abund. Now two solutions:

  1. The function tidy_taxonomy has been optimized. Try to reinstall the microeco package from github. Then run your codes from this line: taxa2 %<>% tidy_taxonomy
  2. If you donnot want to reinstall the package, you can change your prefix in taxa2 or ms2$tax_table to the format with double underlines, such as changing "k_" to "k__".

ChiLiubio avatar Jun 02 '21 14:06 ChiLiubio

Thanks. I re-installed the microeco package and now the taxa labels are good

ShailNair avatar Jun 03 '21 04:06 ShailNair