Full text
22,929 characters
· extracted from
preprint-html
· click to expand
TaxonReportViewer: Parsing and Visualizing Taxonomic Hierarchies in Metagenomic Datasets | bioRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M677548'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search New Results TaxonReportViewer: Parsing and Visualizing Taxonomic Hierarchies in Metagenomic Datasets View ORCID Profile Emanuel Razzolini , View ORCID Profile Claudia Regina de Souza doi: https://doi.org/10.1101/2025.06.07.658440 Emanuel Razzolini 1 Federal University of Paraná 2 Postgraduate Program in Bioprocess and Biotechnology Engineering Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Emanuel Razzolini For correspondence: erazzolini{at}gmail.com Claudia Regina de Souza 1 Federal University of Paraná 3 Postgraduate Program in Biochemistry Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Claudia Regina de Souza Abstract Full Text Info/History Metrics Data/Code Preview PDF Abstract Shotgun metagenomics enables comprehensive analysis of microbial communities by classifying sequencing reads directly from environmental samples, yet interpreting the resulting taxonomic classification reports— especially those generated by tools like Kraken2—remains a challenge due to their hierarchical, text-based format. Existing visualization tools such as Krona and Pavian either rely on web infrastructure or provide limited interactivity and flexibility for comparative analysis. To address this gap, we developed TaxonReportViewer (TRV), an open-source, cross-platform software with a graphical user interface that facilitates the exploration, comparison, and visualization of Kraken2 classification outputs. Implemented in Python 3, TRV includes a robust parser capable of accurately reconstructing taxonomic hierarchies even from inconsistently formatted reports. The tool offers dynamic search and filtering of taxa, exportable abundance matrices, one-click generation of comparative bar charts and heatmaps, and direct links to the NCBI Taxonomy database. TRV supports analysis of multiple samples in parallel, allowing users to identify taxonomic patterns across conditions without requiring programming skills. Its visualization features enable immediate recognition of taxon-specific abundance shifts and clustering of samples by taxonomic profile. Tested on a range of Kraken2 reports, TRV demonstrated consistent performance, rapid search capabilities, and accurate representation of lineage structures. It operates efficiently on standard consumer hardware and requires no installation beyond Python, ensuring accessibility for researchers in diverse computational environments. TaxonReportViewer fills a critical niche between raw taxonomic classification and biological interpretation, empowering researchers to derive meaningful insights from complex metagenomic datasets with ease. Introduction Shotgun metagenomics has revolutionized the study of microbial communities, enabling culture-independent analysis of their taxonomic composition, functional potential, and ecological roles directly from environmental samples ( Quince et al., 2017 ). A primary challenge in metagenomic analysis is the taxonomic classification of billions of short sequencing reads, a computationally intensive task that demands both speed and accuracy. In this context, k-mer-based classification methods have emerged as a highly efficient and widely adopted solution ( Breitwieser et al., 2018 ). Among these tools, Kraken is notable for its speed and low memory footprint, making it a staple in bioinformatics pipelines ( Wood & Salzberg, 2014 ). Its successor, Kraken2, further improves upon these aspects, offering even greater speed and lower memory requirements ( Wood et al., 2019 ). Kraken2 generates a detailed, hierarchical report file that summarizes the taxonomic distribution of reads, from broad domains down to the species and strain levels. While this report is rich in information, it is fundamentally a large text file that is cumbersome to manipulate directly. Extracting biological insights, comparing multiple samples, or interactively exploring specific lineages often requires researchers to develop custom scripts, a process that can be both time-consuming and prone to errors ( Breitwieser & Salzberg, 2020 ; Ondov et al., 2011 ). Although existing tools like Krona offer interactive plotting for hierarchical data ( Ondov et al., 2011 ), and web-based applications like Pavian provide excellent visualization dashboards for Kraken outputs ( Breitwieser & Salzberg, 2020 ), a gap remains for a standalone, cross-platform desktop tool that seamlessly integrates interactive data exploration with the agile generation of publication-ready comparative graphics and abundance matrices. Such a tool would empower researchers to quickly move from raw classification reports to biological interpretation without requiring programming expertise or reliance on web server installations. To address this need, TaxonReportViewer (TRV) was developed, an open-source software tool with a graphical user interface designed to simplify and accelerate the exploratory and comparative analysis of Kraken2 reports. TRV allows for intuitive searching and filtering of taxonomic data, one-click generation of abundance matrices, and integrated creation of comparative bar plots and heatmaps. In this paper, we describe the architecture of TRV, detail its core features for analysis and visualization, and demonstrate its utility in interpreting metagenomic datasets. Methodology Development of a Tool for Interactive Analysis of Kraken2 Reports To facilitate the exploration, comparative analysis, and visualization of taxonomic classification data, a novel software tool with a graphical user interface (GUI), named TaxonReportViewer (TRV) , was developed. The application was implemented in Python 3, utilizing the Tkinter library for the GUI, Pandas and NumPy for data manipulation, and the Matplotlib and Seaborn libraries for generating plots. The tool can be accessed at https://github.com/erazzolini/taxonreportviewer and is freely available for academic and non-commercial use. Parsing and Structuring of Taxonomic Data The core of the tool consists of a parsing module specifically designed to interpret the hierarchical structure of Kraken2 report files. For each line in the report, the parser extracts essential information, including: (1) The percentage of reads associated with that clade; (2) The total number of reads within the clade; (3) The number of reads directly assigned to the taxon; (4) The taxonomic rank code (e.g., ‘S’ for species, ‘G’ for genus); (5) The NCBI Taxonomy ID; and (6) The scientific name of the taxon. Essentially, the parser analyzes the indentation of each line to reconstruct the hierarchical relationships (domain, kingdom, phylum, etc.) among the taxa. This structured data is then loaded and displayed in a Treeview, which preserves the original taxonomic organization and uses a color-coding system to differentiate the main ranks (e.g., Species, Genus, Family), thereby enhancing readability and immediate visual interpretation. Data Exploration and Analysis Features The TRV interface was designed to enable an interactive and multifaceted analysis of the data, incorporating the following key features: Dynamic Search and Filtering: The tool allows the user to search for any taxon name. The results display the taxon of interest and its entire taxonomic sub-tree, making it possible to isolate and inspect specific lineages. Additionally, a filter can be applied to display only species-level results, focusing the analysis on the identified organisms. Selection for Comparative Analysis: Users can select multiple taxa of interest directly from the interface via checkboxes. This manual selection forms the basis for subsequent comparative analyses across different samples. The tool also provides an option to select or deselect all visible taxa at once, streamlining the workflow. Extraction of Reports and Abundance Matrices: The application allows the exportation of the displayed data into tab-separated values (TSV) format. Furthermore, it includes dedicated functions to generate abundance matrices. It is possible to create a matrix for a single sample (based on the full report, a search result, or selected taxa) or a comparative matrix, which aggregates read counts of target taxa across multiple samples (loaded in separate tabs). The output matrices are formatted to be directly compatible with other statistical analysis tools, such as R or STAMP. Integrated Data Visualization: To elucidate patterns in abundance, multiple visualization modules were implemented: Comparative Bar Plots: Generates a grouped bar plot comparing the abundance (read count) of multiple selected taxa across the different loaded samples. Abundance Heatmaps: The tool can generate heatmaps to visualize abundance distributions. Several options are available: (i) a heatmap for a single sample showing the abundance of selected (or the most abundant) taxa; (ii) a comparative heatmap across all samples based on a set of user-selected reference taxa; and (iii) “simplified,” interactive versions of these heatmaps that display abundance values via tooltips on mouseover, facilitating the exploration of dense data matrices. NCBI Integration: Each line in the results table is a hyperlink that, when clicked, opens the corresponding page of the TaxID in the NCBI Taxonomy Browser. This allows for rapid verification and retrieval of additional information about the taxon. Results The developed tool ( Figure 1 ) was tested on multiple report files generated by Kraken2, including both well-formatted and structurally inconsistent reports. The objective was to validate the tool’s ability to reliably retrieve taxonomic descendants of a user-defined query taxon based solely on taxonomic rank and ID hierarchy, independent of line indentation. Download figure Open in new tab Figure 1: Main interface of TaxonReportViewer (TRV). The tool was developed to facilitate the exploration, comparative analysis, and visualization of Kraken2 taxonomic classification data. The interface allows for loading reports, dynamic search and filtering of taxa, and access to visualization functionalities Successful Extraction of Taxonomic Descendants The tool accurately identified descendant taxa for a range of input queries across various taxonomic levels, including phylum, class, genus, and species ( Figure 2 ). For each query, the extracted taxa included all children taxonomic entries (e.g., genera under a family, species under a genus), along with associated metadata such as taxonomic rank, NCBI taxID, and number of reads assigned. Download figure Open in new tab Figure 2: Example of taxonomic descendant extraction and display in TaxonReportViewer (TRV). The tool accurately identifies and presents hierarchical taxonomic data, including associated metadata such as taxonomic rank, NCBI TaxID, and assigned read counts, for user-defined queries across various taxonomic levels. In cases where the report files had inconsistent or missing indentation—an issue frequently encountered in manually modified outputs—the tool successfully parsed the hierarchy using taxonomic rank order and preserved the expected lineage relationships. Multi-sample Compatibility The graphical interface allowed users to analyze multiple Kraken2 reports in parallel. Each result table included an indication of the original sample file, facilitating comparison across metagenomic samples. This feature proved useful in scenarios where researchers needed to trace the presence of a specific taxon (e.g., a pathogen or a genus of interest) across different environments or conditions. Output Validation Exported results were saved in plain-text format with one line per descendant taxon. Each line included the following columns: Taxonomic rank (e.g., genus, species); NCBI taxID; Scientific name; Number of reads assigned; Source report filename. The output was manually validated by comparing it with reference Kraken2 report files and the expected taxonomic tree structures obtained from NCBI Taxonomy. In all cases tested, the output was consistent with known taxonomic relationships and read counts. Visual Analysis of Comparative Abundance Beyond data extraction, the tool’s visualization capabilities were pivotal for interpreting cross-sample trends. The comparative bar chart feature allowed for the direct comparison of read counts for specific user-selected taxa across all loaded samples. A simple search illustrates a use case where the abundance of two distinct bacterial genera was tracked across three different environmental samples, revealing a clear shift in dominance from one environment to another ( Figure 3 ). This visual approach provided an immediate and intuitive understanding of taxon-specific variations that would be less apparent from numerical tables alone. Download figure Open in new tab Figure 3: Comparative bar chart illustrating read counts for selected taxa across multiple samples in TaxonReportViewer (TRV). This visualization highlights a clear shift in dominance of bacterial genera across different environmental samples, demonstrating the tool’s capability for interpreting cross-sample trends. Furthermore, the abundance heatmaps provided a high-level overview of the taxonomic community structure. By generating a comparative heatmap for a curated set of species across multiple samples ( Figure 4 ), it was possible to identify distinct sample clusters based on shared taxonomic profiles. Samples originating from similar conditions visually grouped together, highlighting co-occurrence and mutual exclusion patterns among the selected taxa. This method proved effective for generating hypotheses about the ecological drivers shaping the microbial communities in each sample. Download figure Open in new tab Figure 4: Comparative abundance heatmap generated by TaxonReportViewer (TRV) for selected species across multiple samples. This visualization provides a high-level overview of taxonomic community structure, enabling the identification of distinct sample clusters based on shared taxonomic profiles. Usability and Performance The graphical interface was reported to be responsive, even when handling large report files (e.g., >100,000 lines). Searches were completed in under one second on a typical consumer-grade laptop (Intel Core i5, 8 GB RAM). No installation steps beyond Python 3 were required, and the tool functioned identically on both Windows, Linux and MacOS systems. Conclusion In this study, we presented TaxonReportViewer (TRV), a graphical user interface software designed to overcome the challenges associated with the manual analysis and interpretation of Kraken2 report files. The tool successfully combines a robust parsing module, capable of interpreting taxonomic hierarchy even from inconsistently formatted files, with a suite of interactive features for data searching, filtering, and selection. The results demonstrate that TRV not only ensures accurate data extraction but also accelerates the discovery of biological patterns. Through its integrated visualization modules, such as comparative bar charts and heatmaps, users can rapidly identify variations in taxon abundance and cluster samples by profile similarity, effectively translating raw data into testable hypotheses. The tool works well on regular consumer hardware and is compatible across different platforms, making it easy for labs with varied computational setups to use. In summary, TaxonReportViewer fills a critical gap between the generation of metagenomic classification data and its subsequent biological interpretation. It serves as an intuitive and efficient bridge, empowering researchers to explore complex datasets without the need for advanced command-line scripting skills. Future work may include the integration of statistical analysis tests directly within the interface, support for output formats from other taxonomic classification tools, and the development of a web-based version to further enhance accessibility. Footnotes https://github.com/erazzolini/taxonreportviewer References ↵ Breitwieser , F. P. , Lu , J. , & Salzberg , S. L. ( 2018 ). A review of methods and databases for metagenomic classification and assembly . Briefings in Bioinformatics , 20 ( 4 ), 1125 – 1139 . doi: 10.1093/bib/bbx120 OpenUrl CrossRef ↵ Breitwieser , F. P. , & Salzberg , S. L. ( 2020 ). Pavian: Interactive analysis of metagenomics data for microbiome studies and pathogen identification . Bioinformatics , 36 ( 4 ), 1303 – 1304 . doi: 10.1093/bioinformatics/btz715 OpenUrl CrossRef PubMed ↵ Ondov , B. D. , Bergman , N. H. , & Phillippy , A. M. ( 2011 ). Interactive metagenomic visualization in a Web browser . BMC Bioinformatics , 12 . doi: 10.1186/1471-2105-12-385 OpenUrl CrossRef PubMed ↵ Quince , C. , Walker , A. W. , Simpson , J. T. , Loman , N. J. , & Segata , N. ( 2017 ). Shotgun metagenomics, from sampling to analysis . In Nature Biotechnology (Vol. 35 , Issue 9 , pp. 833 – 844 ). Nature Publishing Group . doi: 10.1038/nbt.3935 OpenUrl CrossRef PubMed ↵ Wood , D. E. , Lu , J. , & Langmead , B. ( 2019 ). Improved metagenomic analysis with Kraken 2 . Genome Biology , 20 ( 1 ). doi: 10.1186/s13059-019-1891-0 OpenUrl CrossRef PubMed ↵ Wood , D. E. , & Salzberg , S. L. ( 2014 ). Kraken: ultrafast metagenomic sequence classification using exact alignments . http://ccb.jhu.edu/software/kraken/ . View the discussion thread. Back to top Previous Next Posted June 10, 2025. Download PDF Data/Code Email Thank you for your interest in spreading the word about bioRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following TaxonReportViewer: Parsing and Visualizing Taxonomic Hierarchies in Metagenomic Datasets Message Subject (Your Name) has forwarded a page to you from bioRxiv Message Body (Your Name) thought you would like to see this page from the bioRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share TaxonReportViewer: Parsing and Visualizing Taxonomic Hierarchies in Metagenomic Datasets Emanuel Razzolini , Claudia Regina de Souza bioRxiv 2025.06.07.658440; doi: https://doi.org/10.1101/2025.06.07.658440 Share This Article: Copy Citation Tools TaxonReportViewer: Parsing and Visualizing Taxonomic Hierarchies in Metagenomic Datasets Emanuel Razzolini , Claudia Regina de Souza bioRxiv 2025.06.07.658440; doi: https://doi.org/10.1101/2025.06.07.658440 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Bioinformatics Subject Areas All Articles Animal Behavior and Cognition (7633) Biochemistry (17681) Bioengineering (13890) Bioinformatics (41930) Biophysics (21446) Cancer Biology (18586) Cell Biology (25493) Clinical Trials (138) Developmental Biology (13374) Ecology (19897) Epidemiology (2067) Evolutionary Biology (24308) Genetics (15607) Genomics (22498) Immunology (17736) Microbiology (40385) Molecular Biology (17175) Neuroscience (88584) Paleontology (666) Pathology (2831) Pharmacology and Toxicology (4823) Physiology (7641) Plant Biology (15149) Scientific Communication and Education (2045) Synthetic Biology (4293) Systems Biology (9823) Zoology (2271)
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.