q2-krona: Plugin for creating Krona plots

Hello everyone,

I've finally got time from work and finished the plugin. :tada:

Special thanks to @Nicholas_Bokulich for suggesting making my own plugin, and @thermokarst for revision.

The plugin is available at my github page (see: https://github.com/kaanb93/q2-krona).

Simply, Krona is a tool to create interactive multi-layered pie charts. Here is an example view of the chart below.

q2-krona is developed to make is easy to generate Krona plots, because the tool needs some rearrangement on FeatureTable[Frequency] to be able to work.

For now, the plugin consists of one visualizer and one pipeline. There might be some additions later on.

PLOT

This visualizer takes FeatureTable[Frequency] as input. But, I strongly suggest to use a collapsed table because this visualizer does NOT use reference taxonomy.

COLLAPSE AND PLOT

This pipeline uses taxa collapse method to use reference taxonomy with FeatureTable[Frequency] taken as input and krona plot visualizer to generate Krona plots. Collapse level and taxonomy delimiter are definable.

Here, I used feature table filtered to 2k minimum frequency and taxonomy from Parkinson's Mouse Tutorial to test the plugin.

Files:
https://docs.qiime2.org/2021.8/data/tutorials/pd-mice/table_2k.qza
https://docs.qiime2.org/2021.8/data/tutorials/pd-mice/taxonomy.qza

 qiime krona collapse-and-plot \
--i-table table_2k.qza \
--i-taxonomy taxonomy.qza \
--o-krona-plot krona.qzv

Output:
krona.qzv (401.0 KB)

The visualizer is viewable at QIIME 2 View.

Hope this plugin helps all QIIMErs. I can take suggestions/critiques on this forum or the github page.

Best wishes,

13 Likes

Hi @the_dummy,
Brilliant thanks so much!
I got only one comment:
could you please add to:
https://library.qiime2.org/plugins/

:pray:

Thank so much!
Luca

6 Likes

Hi @llenzi ,

I have just done it :+1:

6 Likes

This looks great @the_dummy!

One suggestion, you should add the original Krona reference to the plugin, so that the original authors get credit. Below are some examples from RESCRIPt:

Then you can test that it works by running qiime krona --citations.

6 Likes

Hi @SoilRotifer,

I wasn't sure how to cite it but your example helped me clarify my head. Thank you!

1 Like

Thank you for this nice tool!
I have an issue: on a command-line-only computer. I get the message:
Plugin error from krona:
[Errno 2] No such file or directory: '/tmp/tmpx4vzjxpu/index.html'
Debug info has been saved to /tmp/qiime2-q2cli-err-slkk0igk.log

However: it works perfectly on a local PC the same command with the same data and same version of Qiime (2021.11) and Ubuntu (20.04), Python (3.8).

If you want I can also supply the log file.

Hi @jack2017 ,

It's nice to see people using it :slight_smile:

Could you check if krona itself is installed and ktImportText is callable in the environment?

1 Like

I've added error handling for FileNotFoundError. Now, the plugin checks if ktImportText is available.

Dear @the_dummy

I installed krona 1.0.2, ran the command again and got the message:

Plugin error from krona:
'ktImportText' is not found, but can be installed with:
conda install -c bioconda krona
Debug info has been saved to /tmp/qiime2-q2cli-err-8fro5eex.log

So I installed bioconda krona and now it works indeed! Thanks!

2 Likes

It is in the instructions, so I must have been too hasty installing krona on that 2nd machine...

1 Like

Hi @the_dummy!

Amazing work! I was looking at Krona's web for days hoy to import qiime files and it was just here in the forum!! Thank you so much!

Just one thing... do u know if it is possible to delete the first letter in the taxonomy file (like k_ from kingdom etc) for the plot??

Thank you in advance!!
Ana.

1 Like

Hi @Anuka,

Firstly, you are welcome. I'm glad that the plugin is helping people.

And I think RESCRIPt's edit taxonomy is the right answer here. It is better to edit taxonomy file first, and then use the plotting tool. Some regex knowledge is required to accomplish what you asked, and I'm not good at it. :man_facepalming:

But I think the pattern is something like below:

^(k_)*(p_)* etc. etc. (s_)*$

Maybe @SoilRotifer could help us better.

Best wishes,

Kaan

2 Likes