<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="other" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.26669.2</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Software Tool Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>TreeSummarizedExperiment: a S4 class for data with hierarchical structure</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 2; peer review: 3 approved]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Huang</surname>
                        <given-names>Ruizhu</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0003-3285-1945</uri>
                    <xref ref-type="aff" rid="a1">1</xref>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Soneson</surname>
                        <given-names>Charlotte</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0003-3833-2169</uri>
                    <xref ref-type="aff" rid="a1">1</xref>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a3">3</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Ernst</surname>
                        <given-names>Felix G.M.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-5064-0928</uri>
                    <xref ref-type="aff" rid="a4">4</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Rue-Albrecht</surname>
                        <given-names>Kevin C.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0003-3899-3872</uri>
                    <xref ref-type="aff" rid="a5">5</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Yu</surname>
                        <given-names>Guangchuang</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-6485-8781</uri>
                    <xref ref-type="aff" rid="a6">6</xref>
                    <xref ref-type="aff" rid="a7">7</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Hicks</surname>
                        <given-names>Stephanie C.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-7858-0231</uri>
                    <xref ref-type="aff" rid="a8">8</xref>
                </contrib>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Robinson</surname>
                        <given-names>Mark D.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-3048-5518</uri>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a1">1</xref>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>Department of Molecular Life Sciences, University of Zurich, Zurich, Switzerland</aff>
                <aff id="a2">
                    <label>2</label>SIB Swiss Institute of Bioinformatics, Zurich, Switzerland</aff>
                <aff id="a3">
                    <label>3</label>Friedrich Miescher Institute for Biomedical Research, Basel, Switzerland</aff>
                <aff id="a4">
                    <label>4</label>Population Health Sciences, German Center for Neurodegenerative Diseases (DZNE), Bonn, Germany</aff>
                <aff id="a5">
                    <label>5</label>MRC WIMM Centre for Computational Biology, University of Oxford,, Oxford, OX3 9DS, UK</aff>
                <aff id="a6">
                    <label>6</label>Department of Bioinformatics, School of Basic Medical University, Guangzhou, Guangdong, China</aff>
                <aff id="a7">
                    <label>7</label>Microbiome Medicine Center, Division of Laboratory Medicine, Zhujiang Hospital, Southern Medical University, Guangzhou, Guangdong, China</aff>
                <aff id="a8">
                    <label>8</label>Department of Biostatistics, Johns Hopkins Bloomberg School of Public Health, Baltimore, USA</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:mark.robinson@imls.uzh.ch">mark.robinson@imls.uzh.ch</email>
                </corresp>
                <fn fn-type="conflict">
                    <p>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>2</day>
                <month>3</month>
                <year>2021</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2020</year>
            </pub-date>
            <volume>9</volume>
            <elocation-id>1246</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>4</day>
                    <month>2</month>
                    <year>2021</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2021 Huang R et al.</copyright-statement>
                <copyright-year>2021</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/9-1246/pdf"/>
            <abstract>
                <p>Data organized into hierarchical structures (e.g., phylogenies or cell types) arises in several biological fields. It is therefore of interest to have data containers that store the hierarchical structure together with the biological profile data, and provide functions to easily access or manipulate data at different resolutions. Here, we present 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold>, a R/S4 class that extends the commonly used 
                    <bold>
                        <italic toggle="yes">SingleCellExperiment</italic>
                    </bold> class by incorporating tree representations of rows and/or columns (represented by objects of the 
                    <monospace>phylo</monospace> class). It follows the convention of the 
                    <bold>
                        <italic toggle="yes">SummarizedExperiment</italic>
                    </bold> class, while providing links between the 
                    <monospace>assays</monospace> and the nodes of a tree to allow data manipulation at arbitrary levels of the tree. The package is designed to be extensible, allowing new functions on the tree (
                    <monospace>phylo</monospace>) to be contributed. As the work is based on the 
                    <bold>
                        <italic toggle="yes">SingleCellExperiment</italic>
                    </bold> class and the 
                    <monospace>phylo</monospace> class, both of which are popular classes used in many R packages, it is expected to be able to interact seamlessly with many other tools.</p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>SummarizedExperiment</kwd>
                <kwd>tree</kwd>
                <kwd>microbiome</kwd>
                <kwd>hierarchical structure</kwd>
            </kwd-group>
            <funding-group>
                <award-group id="fund-1">
                    <funding-source>Chan Zuckerberg Initiative DAF</funding-source>
                    <award-id>CZF2019-002443</award-id>
                </award-group>
                <award-group id="fund-2">
                    <funding-source>University Research Priority Program Evolution in Action at the University of Zurich</funding-source>
                </award-group>
                <award-group id="fund-3" xlink:href="http://dx.doi.org/10.13039/501100001711">
                    <funding-source>Schweizerischer Nationalfonds zur F&#x00f6;rderung der Wissenschaftlichen Forschung</funding-source>
                    <award-id>310030_175841</award-id>
                </award-group>
                <funding-statement>This work was supported by the Swiss National Science Foundation (grant number 310030\_175841). MDR acknowledges support from the University Research Priority Program Evolution in Action at the University of Zurich. SCH is supported by CZF2019-002443 from the Chan Zuckerberg Initiative DAF, an advised fund of Silicon Valley Community Foundation.</funding-statement>
            </funding-group>
        </article-meta>
        <notes>
            <sec sec-type="version-changes">
                <label>Revised</label>
                <title>Amendments from Version 1</title>
                <p>TreeSummarizedExperiment (TSE) now allows rowTree() and colTree() to work as both setters and getters, provides a new slot referenceSeq() to store sequence information, and replaces aggValue with aggTSE to provide more flexible data aggregation. The combination of multiple TSE objects is enabled, for which a new column whichTree is added in LinkDataFrame for rowLinks()/colLinks() to register which rows and columns are are mapped to which trees in rowTree() &amp; colTree(). Also, an example analysis of CyTOF data is added as a new use case of TreeSummarizedExperiment. This necessarily added new commands and text to describe new features of TSE. Otherwise, all text and figures have remained the same.</p>
            </sec>
        </notes>
    </front>
    <body>
        <sec sec-type="intro">
            <title>Introduction</title>
            <p>Biological data arranged into a hierarchy occurs in several fields. A notable example is in microbial survey studies, where the microbiome is profiled with amplicon sequencing or whole genome shotgun sequencing, and microbial taxa are organized as a tree according to their similarities in the genomic sequence or the evolutionary history. Also, a tree might be used in single cell cytometry or RNA-seq data, with nodes representing cell subpopulations at different granularities
                <sup>
                    <xref ref-type="bibr" rid="ref-1">1</xref>
                </sup>. Currently, 
                <monospace>phyloseq</monospace>
                <sup>
                    <xref ref-type="bibr" rid="ref-2">2</xref>
                </sup> and 
                <bold>
                    <italic toggle="yes">SingleCellExperiment</italic>
                </bold>
                <sup>
                    <xref ref-type="bibr" rid="ref-3">3</xref>
                </sup> are popular classes used in the analysis of microbial data and single cell data, respectively. The former supports the information pertaining to the hierarchical structure that is available as the 
                <monospace>phylo</monospace> class (e.g., phylogenetic tree), and the latter is derived from the 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> class (defined in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.11/bioc/html/SummarizedExperiment.html">SummarizedExperiment</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-4">4</xref>
                </sup>), which is widely used as a standardized container across many Bioconductor packages. Since the data structures in these fields share similarities, we were motivated to develop an S4 class
                <sup>
                    <xref ref-type="bibr" rid="ref-5">5</xref>
                </sup>, 
                <bold>
                    <italic toggle="yes">TreeSummarizedExperiment</italic>
                </bold>, that not only leverages the facilities from the 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> class, but also bridges the functionality from the 
                <monospace>phylo</monospace> class, which is available from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=ape">ape</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-6">6</xref>
                </sup> package and has been imported in more than 200 R packages.</p>
            <p>We define 
                <bold>
                    <italic toggle="yes">TreeSummarizedExperiment</italic>
                </bold> by extending the 
                <bold>
                    <italic toggle="yes">SingleCellExperiment</italic>
                </bold> class, so that it is a member of the 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> family, and thus benefits from the comprehensive Bioconductor ecosystem (e.g., 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/iSEE">iSEE</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-7">7</xref>
                </sup>, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/SEtools">SEtools</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>
                </sup>, and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/ggbio">ggbio</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-9">9</xref>
                </sup>). At the same time, all slots of the 
                <monospace>phyloseq</monospace> class have their corresponding slots in the 
                <bold>
                    <italic toggle="yes">TreeSummarizedExperiment</italic>
                </bold> class, which enables convenient conversion between these classes. Furthermore, we allow the link between profile data and nodes of the tree, including leaves and internal nodes, which is useful for algorithms in the downstream analysis that need to access internal nodes of the tree (e.g., treeclimbR
                <sup>
                    <xref ref-type="bibr" rid="ref-1">1</xref>
                </sup>).</p>
            <p>Overall, the class 
                <bold>
                    <italic toggle="yes">TreeSummarizedExperiment</italic>
                </bold> is provided as a standalone R package, analogous to 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> and 
                <bold>
                    <italic toggle="yes">SingleCellExperiment</italic>
                </bold>. Thus, it is convenient for R package developers to import it and build downstream data analyses or visualizations on it. Also, it is flexible to combine with R packages that are linked to the 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> family or the 
                <monospace>phylo</monospace> tree class, which enables R package users to explore data with the support of other tools.</p>
        </sec>
        <sec sec-type="methods">
            <title>Methods</title>
            <sec>
                <title>Implementation</title>
                <p>
                    <bold>
                        <italic toggle="yes">The structure of TreeSummarizedExperiment</italic>
                    </bold>. The structure of the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> class is shown in 
                    <xref ref-type="fig" rid="f1">Figure 1</xref>.</p>
                <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                    <label>Figure 1. </label>
                    <caption>
                        <title>The structure of the 
                            <italic toggle="yes">TreeSummarizedExperiment</italic> class.</title>
                        <p>The rectangular data matrices are stored in 
                            <monospace>assays</monospace>. Each matrix usually has rows representing entities (e.g., genes or microbial taxa) and columns representing cells or samples. Information about rows and columns is stored in 
                            <monospace>rowData</monospace> and 
                            <monospace>colData</monospace>, respectively. The hierarchy structure on rows or columns is stored in 
                            <monospace>rowTree</monospace> or 
                            <monospace>colTree</monospace> respectively, and the link information between rows/columns and nodes of the row/column tree is in 
                            <monospace>rowLinks/colLinks</monospace>. 
                            <monospace>referenceSeq</monospace> is an optional slot to store the sequence information for rows.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure1.gif"/>
                </fig>
                <p>Compared to the 
                    <bold>
                        <italic toggle="yes">SingleCellExperiment</italic>
                    </bold> objects, 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> has five additional slots:</p>
                <list list-type="bullet">
                    <list-item>
                        <p>
                            <monospace>rowTree:</monospace> the hierarchical structure on the rows of the 
                            <monospace>assays</monospace>.</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>rowLinks:</monospace> the link information between rows of the 
                            <monospace>assays</monospace> and the 
                            <monospace>rowTree</monospace>.</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>colTree:</monospace> the hierarchical structure on the columns of the 
                            <monospace>assays</monospace>.</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>colLinks:</monospace> the link information between columns of the 
                            <monospace>assays</monospace> and the 
                            <monospace>colTree</monospace>.</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>referenceSeq</monospace> (optional): the sequence information for rows of the 
                            <monospace>assays</monospace>.</p>
                    </list-item>
                </list>
                <p>The 
                    <monospace>rowTree</monospace> and
                    <italic toggle="yes">/</italic>or 
                    <monospace>colTree</monospace> can be left empty (
                    <monospace>NULL</monospace>) if no trees are available; in this case, the 
                    <monospace>rowLinks</monospace> and
                    <italic toggle="yes">/</italic>or 
                    <monospace>colLinks</monospace> are also set to 
                    <monospace>NULL</monospace>. The 
                    <monospace>referenceSeq</monospace> is an optional slot to store the sequence data of features either as 
                    <monospace>DNAStringSet</monospace> or 
                    <monospace>DNAStringSetList</monospace>. All other 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> slots are inherited from 
                    <bold>
                        <italic toggle="yes">SingleCellExperiment</italic>
                    </bold>.</p>
                <p>The 
                    <monospace>rowTree</monospace> and 
                    <monospace>colTree</monospace> slots require the tree to be an object of the 
                    <monospace>phylo</monospace> class. If a tree is available in an alternative format, it can often be converted to a 
                    <monospace>phylo</monospace> object using dedicated R packages (e.g., 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/treeio">treeio</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-10">10</xref>
                    </sup>).</p>
                <p>Functions in the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/TreeSummarizedExperiment">TreeSummarizedExperiment</ext-link>
                    </italic> package fall in two main categories: operations on the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object or operations on the tree (
                    <monospace>phylo</monospace>) objects. The former includes constructors and accessors, and the latter serves as &#x201c;components&#x201d; to be assembled as accessors or functions that manipulate the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object. Given that more than 200 R packages make use of the 
                    <monospace>phylo</monospace> class, there are many resources (e.g., 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=ape">ape</ext-link>
                    </italic>) for users to manipulate the small &#x201c;pieces&#x201d; in addition to those provided in 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/TreeSummarizedExperiment">TreeSummarizedExperiment</ext-link>
                    </italic>. </p>
            </sec>
            <sec>
                <title>The toy datasets as the example data</title>
                <p>We generate a toy dataset that has observations of 6 entities collected from 4 samples as an example to show how to construct a 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(TreeSummarizedExperiment)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># assays data (typically, representing observed data from an experiment)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">assay_data &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rbind</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">rep</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">matrix</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">20</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">nrow =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">5</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">))</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colnames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(assay_data) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">paste0</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"sample"</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>)

                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(assay_data) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">paste0</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"entity"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">seq_len</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">6</styled-content>))

                        <styled-content style="font-size:15px;color:#000000;">assay_data</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">##         sample1 sample2 sample3 sample4
## entity1       0       0       0       0
## entity2       1       6      11      16
## entity3       2       7      12      17
## entity4       3       8      13      18
## entity5       4       9      14      19
## entity6       5      10      15      20</styled-content>
                    </preformat>
                </p>
                <p>The information of entities and samples are given in the 
                    <bold>row_data</bold> and 
                    <bold>col_data</bold>, respectively.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># row data (feature annotations)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">row_data &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">data.frame</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">Kingdom =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"A"</styled-content>,
                          
                        <styled-content style="font-size:15px;color:#214A87">Phylum = rep</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"B1"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"B2"</styled-content>), 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>)),
                          
                        <styled-content style="font-size:15px;color:#214A87">Class = rep</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"C1"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"C2"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"C3"</styled-content>), 
                        <styled-content style="font-size:15px;color:#214A87">each =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>),
                          
                        <styled-content style="font-size:15px;color:#214A87">OTU = paste0</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"D"</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">6</styled-content>),
                          
                        <styled-content style="font-size:15px;color:#214A87">row.names = rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(assay_data),</styled-content>
                          
                        <styled-content style="font-size:15px;color:#214A87">stringsAsFactors =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>)

                        <styled-content style="font-size:15px;color:#000000;">row_data</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">##         Kingdom Phylum Class OTU
## entity1       A     B1    C1  D1
## entity2       A     B1    C1  D2
## entity3       A     B2    C2  D3
## entity4       A     B2    C2  D4
## entity5       A     B2    C3  D5
## entity6       A     B2    C3  D6</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># column data (sample annotations)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">col_data &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">data.frame</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">gg = c</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">3</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">3</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">),</styled-content>
                          
                        <styled-content style="font-size:15px;color:#214A87">group = rep</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(LETTERS[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>], 
                        <styled-content style="font-size:15px;color:#214A87">each =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>),
                          
                        <styled-content style="font-size:15px;color:#214A87">row.names = colnames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(assay_data),</styled-content>
                          
                        <styled-content style="font-size:15px;color:#214A87">stringsAsFactors =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>)

                        <styled-content style="font-size:15px;color:#000000;">col_data</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##         gg group
## sample1  1     A
## sample2  2     A
## sample3  3     B
## sample4  3     B</styled-content>
                    </preformat>
                </p>
                <p>The hierarchical structure of the 6 entities and 4 samples are denoted as 
                    <bold>row_tree</bold> and 
                    <bold>col_tree</bold>, respectively. The two trees are 
                    <monospace>phylo</monospace> objects randomly created with 
                    <monospace>rtree</monospace> from the package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=ape">ape</ext-link>
                    </italic>. Note that the row tree has 5 rather than 6 leaves; this is used later to show that multiple rows in the 
                    <monospace>assays</monospace> are allowed to map to a single node in the tree.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ape)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># The first toy tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">set.seed</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">12</styled-content>)

                        <styled-content style="font-size:15px;color:#000000;">row_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rtree</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">5</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># The second toy tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">set.seed</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">12</styled-content>)

                        <styled-content style="font-size:15px;color:#000000;">col_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rtree</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># change node labels</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">col_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">tip.label &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colnames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(assay_data)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">col_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">node.label &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"All"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"GroupA"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"GroupB"</styled-content>)</preformat>
                </p>
                <p>We visualize the tree using the package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/ggtree">ggtree</ext-link>
                    </italic> (v. 2.2.4)
                    <sup>
                        <xref ref-type="bibr" rid="ref-11">11</xref>
                    </sup>. Here, the internal nodes of the 
                    <bold>row_tree</bold> have no labels as shown in 
                    <xref ref-type="fig" rid="f2">Figure 2</xref>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggtree)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggplot2)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Visualize the row tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">ggtree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(row_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">branch.length =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"none"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">node),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"darkblue"</styled-content>,
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.5</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">label),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"darkorange"</styled-content>,
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.1</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>)</preformat>
                </p>
                <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                    <label>Figure 2. </label>
                    <caption>
                        <title>The structure of the row tree.</title>
                        <p>The node labels and the node numbers are in orange and blue text, respectively.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure2.gif"/>
                </fig>
                <p>The 
                    <bold>col_tree</bold> has labels for internal nodes as shown in 
                    <xref ref-type="fig" rid="f3">Figure 3</xref>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># Visualize the column tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">ggtree</styled-content>(col_tree, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">branch.length =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"none"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> node), 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"darkblue"</styled-content>,
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.5</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> label), 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"darkorange"</styled-content>,
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.1</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>)
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">ylim</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">0.8</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">4.5</styled-content>)) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">xlim</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">2.2</styled-content>))</preformat>
                </p>
                <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                    <label>Figure 3. </label>
                    <caption>
                        <title>The structure of the column tree. </title>
                        <p>The node labels and the node numbers are in orange and blue text, respectively.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure3.gif"/>
                </fig>
            </sec>
            <sec>
                <title>The construction of 
                    <italic toggle="yes">TreeSummarizedExperiment</italic>
                </title>
                <p>The 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> class is used to store the toy data generated in the previous section: 
                    <bold>assay_data</bold>, 
                    <bold>row_data</bold>, 
                    <bold>col_data</bold>, 
                    <bold>col_tree</bold> and 
                    <bold>row_tree</bold>. To correctly store data, the link information between the rows (or columns) of 
                    <bold>assay_data</bold> and the nodes of the 
                    <bold>row_tree</bold> (or 
                    <bold>col_tree</bold>) can be provided via a character vector 
                    <monospace>rowNodeLab</monospace> (or 
                    <monospace>colNodeLab</monospace>), with length equal to the number of rows (or columns) of the 
                    <monospace>assays</monospace>; otherwise the row (or column) names are used. Tree data takes precedence to determine entities included during the creation of the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object; columns and rows with labels that are not present among the node labels of the tree are removed with warnings. The link data between the 
                    <monospace>assays</monospace> tables and the tree data is automatically generated during the construction.</p>
                <p>The row and column trees can be included simultaneously during the construction of a 
                    <bold>
                        <italic toggle="yes">TreeSummarized-Experiment</italic>
                    </bold> object. Here, the column names of 
                    <bold>assay_data</bold> can be found in the node labels of the column tree, which enables the link to be created between the column dimension of 
                    <bold>assay_data</bold> and the column tree 
                    <bold>col_tree</bold>. If the row names of 
                    <bold>assay_data</bold> are not in the node labels of 
                    <bold>row_tree</bold>, we would need to provide their corresponding node labels (
                    <bold>row_lab</bold>) to 
                    <monospace>rowNodeLab</monospace> in the construction of the object. It is possible to map multiple rows or columns to a node, for example, the same leaf label is used for the first two rows in 
                    <bold>row_lab</bold>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># all column names could be found in the node labels of the column tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">all</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">colnames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(assay_data)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">%in%</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(col_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">tip.label, col_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">node.label))</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## [1] TRUE</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># provide the node labels in rowNodeLab</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tip_lab &lt;- row_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">tip.label</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">row_lab &lt;- tip_lab[</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">5</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)]</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">row_lab</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## [1] "t3" "t3" "t2" "t1" "t5" "t4"</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">both_tse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">TreeSummarizedExperiment</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">assays = list</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">Count =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">assay_data),</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">rowData =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">row_data,</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">colData =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">col_data,</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">rowTree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">row_tree,</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">rowNodeLab =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">row_lab,</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">colTree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">col_tree)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">both_tse

## class: TreeSummarizedExperiment
## dim: 6 4
## metadata(0):
## assays(1): Count
## rownames(6): entity1 entity2 ... entity5 entity6
## rowData names(4): Kingdom Phylum Class OTU
## colnames(4): sample1 sample2 sample3 sample4
## colData names(2): gg group
## reducedDimNames(0):
## altExpNames(0):
## rowLinks: a LinkDataFrame (6 rows)
## rowTree: 1 phylo tree(s) (5 leaves)
## colLinks: a LinkDataFrame (4 rows)
## colTree: 1 phylo tree(s) (4 leaves)</styled-content>
                    </preformat>
                </p>
                <p>When printed on screen, 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> objects display information as the parent 
                    <bold>
                        <italic toggle="yes">SingleCell-Experiment</italic>
                    </bold> class followed by four additional lines for 
                    <monospace>rowLinks</monospace>, 
                    <monospace>rowTree</monospace>, 
                    <monospace>colLinks</monospace> and 
                    <monospace>colTree</monospace>.</p>
            </sec>
            <sec>
                <title>The accessor functions</title>
                <p>Slots inherited from the 
                    <bold>
                        <italic toggle="yes">SummarizedExperiment</italic>
                    </bold> class can be accessed in the standard way (e.g., via accessors 
                    <monospace>assays()</monospace>, 
                    <monospace>rowData()</monospace>, 
                    <monospace>colData()</monospace> and 
                    <monospace>metadata()</monospace>). These functions are both getters and setters. To clarify, getters and setters are functions for users to retrieve and to overwrite data from the corresponding slots, respectively. Here, accessors for 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> are both getters and setters unless specifically mentioned.</p>
                <p>For new slots, we provide 
                    <monospace>rowTree</monospace> (and 
                    <monospace>colTree</monospace>) to access the row (column) trees, and 
                    <monospace>rowLinks</monospace> (and 
                    <monospace>colLinks</monospace>) as getters to retrieve the link information between 
                    <monospace>assays</monospace> and the row (column) tree. If the tree is not available, the corresponding link data is 
                    <monospace>NULL</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># access trees</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rowTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse)</styled-content>
                    </preformat>


                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">##
## Phylogenetic tree with 5 tips and 4 internal nodes.
##
## Tip labels:
##   t3, t2, t1, t5, t4
##
## Rooted; includes branch lengths.</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">colTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">##
## Phylogenetic tree with 4 tips and 3 internal nodes.
##
## Tip labels:
##   sample1, sample2, sample3, sample4
## Node labels:
##   All, GroupA, GroupB
##
## Rooted; includes branch lengths.</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># access the link data</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">(r_link &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse))</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 6 rows and 5 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## entity1          t3       alias_1         1      TRUE       phylo
## entity2          t3       alias_1         1      TRUE       phylo
## entity3          t2       alias_2         2      TRUE       phylo
## entity4          t1       alias_3         3      TRUE       phylo
## entity5          t5       alias_4         4      TRUE       phylo
## entity6          t4       alias_5         5      TRUE       phylo</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">(c_link &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse))</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 4 rows and 5 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## sample1     sample1       alias_1         1      TRUE       phylo
## sample2     sample2       alias_2         2      TRUE       phylo
## sample3     sample3       alias_3         3      TRUE       phylo
## sample4     sample4       alias_4         4      TRUE       phylo</styled-content>
                    </preformat>
                </p>
                <p>The link data objects are of the 
                    <monospace>LinkDataFrame</monospace> class, which extends the 
                    <monospace>DataFrame</monospace> class from 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/S4Vectors">S4Vectors</ext-link>
                    </italic> with the restriction that it has five columns:</p>
                <list list-type="bullet">
                    <list-item>
                        <p>
                            <monospace>nodeLab:</monospace> the labels of nodes on the tree</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>nodeLab_alias:</monospace> the alias labels of nodes on the tree</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>nodeNum:</monospace> the numbers of nodes on the tree</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>isLeaf:</monospace> whether the node is a leaf node</p>
                    </list-item>
                    <list-item>
                        <p>
                            <monospace>whichTree:</monospace> which tree the row/col is linked to</p>
                    </list-item>
                </list>
                <p>The data in 
                    <monospace>colLinks()</monospace> is updated automatically with the change of 
                    <monospace>colTree()</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># remove the column tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">NULL</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># the colLinks() is updated accordingly</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## NULL</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># colTree works as a setter</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse) &lt;- col_tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 4 rows and 5 columns
##       nodeLab   nodeNum nodeLab_alias    isLeaf   whichTree
##   &lt;character&gt; &lt;integer&gt;   &lt;character&gt; &lt;logical&gt; &lt;character&gt;
## 1     sample1         1       alias_1      TRUE       phylo
## 2     sample2         2       alias_2      TRUE       phylo
## 3     sample3         3       alias_3      TRUE       phylo
## 4     sample4         4       alias_4      TRUE       phylo</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>The subsetting function</title>
                <p>A 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object can be subset in two different ways: 
                    <monospace>[</monospace> to subset by rows or columns, and 
                    <monospace>subsetByNode</monospace> to retrieve row and/or columns that correspond to nodes of a tree. As the numeric ID of a node changes with the cut of a 
                    <monospace>phylo</monospace> tree, to keep track of the original data, we do not prune the tree structure in the subsetting. Below, we can see that 
                    <monospace>rowLinks</monospace> and 
                    <monospace>rowData</monospace> are updated to have the same number of rows as 
                    <monospace>assays</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">sub_tse &lt;- both_tse[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>]

                        <styled-content style="font-size:15px;color:#000000;">sub_tse</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## class: TreeSummarizedExperiment
## dim: 2 1
## metadata(0):
## assays(1): Count
## rownames(2): entity1 entity2
## rowData names(4): Kingdom Phylum Class OTU
## colnames(1): sample1
## colData names(2): gg group
## reducedDimNames(0):
## altExpNames(0):
## rowLinks: a LinkDataFrame (2 rows)
## rowTree: 1 phylo tree(s) (5 leaves)
## colLinks: a LinkDataFrame (1 rows)
## colTree: 1 phylo tree(s) (4 leaves)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># the row data</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(sub_tse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## DataFrame with 2 rows and 4 columns
##             Kingdom      Phylum       Class         OTU
##         &lt;character&gt; &lt;character&gt; &lt;character&gt; &lt;character&gt;
## entity1           A          B1          C1          D1
## entity2           A          B1          C1          D2</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># the row link data</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(sub_tse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 2 rows and 5 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## entity1          t3       alias_1         1      TRUE       phylo
## entity2          t3       alias_1         1      TRUE       phylo</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># The first four columns are from colLinks data and the others from colData</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">cbind</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">colLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(sub_tse),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(sub_tse))</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## DataFrame with 1 row and 7 columns
##       nodeLab   nodeNum nodeLab_alias    isLeaf   whichTree        gg
##   &lt;character&gt; &lt;integer&gt;   &lt;character&gt; &lt;logical&gt; &lt;character&gt; &lt;numeric&gt;
## 1     sample1         1       alias_1      TRUE       phylo         1
##         group
##   &lt;character&gt;
## 1           A</styled-content>
                    </preformat>
                </p>
                <p>To subset by nodes, we specify the node by its node label or node number. Here, 
                    <italic toggle="yes">entity1</italic> and 
                    <italic toggle="yes">entity2</italic> are both mapped to the same node 
                    <monospace>t3</monospace>, so both of them are retained.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">node_tse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">subsetByNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">both_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowNode =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"t3"</styled-content>)


                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(node_tse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 2 rows and 5 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## entity1          t3       alias_1         1      TRUE       phylo
## entity2          t3       alias_1         1      TRUE       phylo</styled-content>
                    </preformat>
                </p>
                <p>Subsetting simultaneously in both dimensions is also allowed.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">node_tse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">subsetByNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">both_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowNode =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"t3"</styled-content>,
                            
                        <styled-content style="font-size:15px;color:#214A87">colNode = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"sample1"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"sample2"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">))</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(node_tse)[[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]]</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##         sample1 sample2
## entity1       0       0
## entity2       1       6</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Changing the tree</title>
                <p>The current tree can be replaced by a new one using 
                    <monospace>changeTree</monospace>. Here, we don&#x2019;t use 
                    <monospace>rowTree()</monospace> to do the replacement because the new tree has node labels that cannot match with row names of the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object. If the hierarchical information is available as a 
                    <monospace>data.frame</monospace> with each column representing a taxonomic level (e.g., 
                    <italic toggle="yes">row_data</italic>), we provide 
                    <monospace>toTree</monospace> to convert it into a 
                    <monospace>phylo</monospace> object that is further visualized in 
                    <xref ref-type="fig" rid="f4">Figure 4</xref>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># The toy taxonomic table</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">(taxa &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tse))</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## DataFrame with 6 rows and 4 columns
##             Kingdom      Phylum       Class         OTU
##         &lt;character&gt; &lt;character&gt; &lt;character&gt; &lt;character&gt;
## entity1           A          B1          C1          D1
## entity2           A          B1          C1          D2
## entity3           A          B2          C2          D3
## entity4           A          B2          C2          D4
## entity5           A          B2          C3          D5
## entity6           A          B2          C3          D6</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f4" orientation="portrait" position="float">
                    <label>Figure 4. </label>
                    <caption>
                        <title>The structure of the taxonomic tree that is generated from the taxonomic table.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure4.gif"/>
                </fig>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># convert it to a phylo tree</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">taxa_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">toTree</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">data =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Viz the new tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">ggtree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(taxa_tree)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">node),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"darkblue"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.5</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">label),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"darkorange"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.7</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_point2</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">()</styled-content>
                    </preformat>
                </p>
                <p>If the nodes of the two trees have a different set of labels, a vector mapping the nodes of the new tree must be provided in 
                    <monospace>rowNodeLab</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">taxa_tse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">changeTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">both_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowTree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_tree,</styled-content>
                          
                        <styled-content style="font-size:15px;color:#214A87">rowNodeLab =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa[[</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"OTU"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]])</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">taxa_tse</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## class: TreeSummarizedExperiment
## dim: 6 4
## metadata(0):
## assays(1): Count
## rownames(6): entity1 entity2 ... entity5 entity6
## rowData names(4): Kingdom Phylum Class OTU
## colnames(4): sample1 sample2 sample3 sample4
## colData names(2): gg group
## reducedDimNames(0):
## altExpNames(0):
## rowLinks: a LinkDataFrame (6 rows)
## rowTree: 1 phylo tree(s) (6 leaves)
## colLinks: a LinkDataFrame (4 rows)
## colTree: 1 phylo tree(s) (4 leaves)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(taxa_tse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 6 rows and 4 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## entity1          D1       alias_1         1      TRUE       phylo
## entity2          D2       alias_2         2      TRUE       phylo
## entity3          D3       alias_3         3      TRUE       phylo
## entity4          D4       alias_4         4      TRUE       phylo
## entity5          D5       alias_5         5      TRUE       phylo
## entity6          D6       alias_6         6      TRUE       phylo</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Aggregation</title>
                <p>Since it may be of interest to report or analyze observed data at multiple resolutions based on the provided tree(s), the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> package offers functionality to flexibly aggregate data to arbitrary levels of a tree.</p>
                <p>
                    <bold>The column dimension.</bold> Here, we demonstrate the aggregation functionality along the column dimension. The desired aggregation level is given in the 
                    <monospace>colLevel</monospace> argument, which can be specified using node labels (orange text in 
                    <xref ref-type="fig" rid="f3">Figure 3</xref>) or node numbers (blue text in 
                    <xref ref-type="fig" rid="f3">Figure 3</xref>). Furthermore, the summarization method used to aggregate multiple values can be specified via the argument 
                    <monospace>colFun</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># use node labels to specify colLevel</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_col &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_tse,</styled-content>
                    
                        <styled-content style="font-size:15px;color:#214A87">colLevel = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"GroupA"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"GroupB"</styled-content>),
                    
                        <styled-content style="font-size:15px;color:#214A87">colFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sum)</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># or use node numbers to specify colLevel</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_col &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colLevel = c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">6</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">7</styled-content>), 
                        <styled-content style="font-size:15px;color:#214A87">colFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sum)</styled-content>



                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_col)[[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]]</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##         alias_6 alias_7
## entity1       0       0
## entity2       7      27
## entity3       9      29
## entity4      11      31
## entity5      13      33
## entity6      15      35</styled-content>
                    </preformat>
                </p>
                <p>The 
                    <monospace>rowData</monospace> does not change, but the 
                    <monospace>colData</monospace> is updated to reflect the metadata information that remains valid for the individual nodes after aggregation. For example, the column 
                    <bold>group</bold> has the 
                    <monospace>A</monospace> value for 
                    <monospace>GroupA</monospace> because the descendant nodes of 
                    <monospace>GroupA</monospace> all have the value 
                    <monospace>A</monospace>; whereas the column 
                    <bold>gg</bold> has the 
                    <monospace>NA</monospace> value for 
                    <monospace>GroupA</monospace> because the descendant nodes of 
                    <monospace>GroupA</monospace> have different values, (1 and 2).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># before aggregation</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(taxa_tse)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## DataFrame with 4 rows and 2 columns
##                gg       group
##         &lt;numeric&gt; &lt;character&gt;
## sample1         1           A
## sample2         2           A
## sample3         3           B
## sample4         3           B</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># after aggregation</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_col)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## DataFrame with 2 rows and 2 columns
##                gg       group
##         &lt;numeric&gt; &lt;character&gt;
## alias_6        NA           A
## alias_7         3           B</styled-content>
                    </preformat>
                </p>
                <p>The 
                    <monospace>colLinks</monospace> is also updated to link the new rows of 
                    <monospace>assays</monospace> tables to the corresponding nodes of the column tree (
                    <xref ref-type="fig" rid="f3">Figure 3</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># the link data is updated</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_col)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 2 rows and 5 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## alias_6      GroupA       alias_6         6     FALSE       phylo
## alias_7      GroupB       alias_7         7     FALSE       phylo</styled-content>
                    </preformat>
                </p>
                <p>
                    <bold>The row dimension.</bold> Similarly, we can aggregate rows to phyla by providing the names of the internal nodes that represent the phylum level (see 
                    <monospace>taxa_one</monospace> below).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># the phylum level</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">taxa &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(taxa_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">tip.label, taxa_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">node.label)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">(taxa_one &lt;- taxa[</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">startsWith</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(taxa,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Phylum:"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)])</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## [1] "Phylum:B1" "Phylum:B2"</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># aggregation</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_taxa &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLevel =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_one,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sum)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_taxa)[[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]] </styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##          sample1 sample2 sample3 sample4
## alias_8        1       6      11      16
## alias_10      14      34      54      74</styled-content>
                    </preformat>
                </p>
                <p>Users are nonetheless free to choose nodes from different taxonomic ranks for each final aggregated row. Note that it is not necessary to use all original rows during the aggregation process. Similarly, it is entirely possible for a row to contribute to multiple aggregated rows.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># A mixed level</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">taxa_mix &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"Class:C3"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"Phylum:B1"</styled-content>)

                        <styled-content style="font-size:15px;color:#000000;">agg_any &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLevel =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">taxa_mix,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sum)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_any)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## DataFrame with 2 rows and 4 columns
##              Kingdom      Phylum       Class       OTU
##          &lt;character&gt; &lt;character&gt; &lt;character&gt; &lt;logical&gt;
## alias_12           A          B2          C3        NA
## alias_8            A          B1          C1        NA</styled-content>
                    </preformat>
                </p>
                <p>
                    <bold>Both dimensions.</bold> The aggregation on both dimensions could be performed in one step, in which case users can specify the order of aggregation; either rows first 
                    <monospace>(rowFirst = TRUE)</monospace> or columns first 
                    <monospace>(rowFirst = FALSE)</monospace>. The aggregate functions for the row and the column dimension can be provided via 
                    <monospace>rowFun</monospace> and 
                    <monospace>colFun</monospace>, respectively. Additionally, parallel computation is enable by providing 
                    <monospace>BPPARAM</monospace> with a 
                    <monospace>BiocParallelParam</monospace> object.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">agg_both &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">both_tse,</styled-content>
                     
                        <styled-content style="font-size:15px;color:#214A87">rowLevel =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">7</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">9</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sum,</styled-content>
                     
                        <styled-content style="font-size:15px;color:#214A87">colLevel = </styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">6</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">:</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">7</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">mean,</styled-content>
                     
                        <styled-content style="font-size:15px;color:#214A87">rowFirst =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>)</preformat>
                </p>
                <p>As expected, we obtain a table with 3 rows representing the aggregated row nodes 7, 8 and 9 (
                    <monospace>rowLevel = 7:9</monospace>) and 2 columns representing the aggregated column nodes 6 and 7 (
                    <monospace>colLevel = 6:7</monospace>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_both)[[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]]</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##         alias_6 alias_7
## alias_7     8.0    28.0
## alias_8    19.5    49.5
## alias_9    12.0    32.0</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Functions operating on the 
                    <monospace>phylo</monospace> object</title>
                <p>Next, we highlight some functions to manipulate and/or to extract information from the 
                    <monospace>phylo</monospace> object. Further operations can be found in other packages, such as 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=ape">ape</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-6">6</xref>
                    </sup>, 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=tidytree">tidytree</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-12">12</xref>
                    </sup>. These functions are useful for users who wish to develop more functions for the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> class.</p>
                <p>To show these functions, we use the tree shown in 
                    <xref ref-type="fig" rid="f5">Figure 5</xref>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">data</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"tinyTree"</styled-content>)

                        <styled-content style="font-size:15px;color:#214A87">ggtree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tinyTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">branch.length =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"none"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">label),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.1</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">3</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_text2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">label =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">node),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">vjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.8</styled-content>,
                 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">-0.2</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"blue"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">3</styled-content>)</preformat>
                </p>
                <fig fig-type="figure" id="f5" orientation="portrait" position="float">
                    <label>Figure 5. </label>
                    <caption>
                        <title>An example tree with node labels and numbers in black and blue texts, respectively.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure5.gif"/>
                </fig>
                <p>
                    <bold>Conversion of the node label and the node number</bold> The translation between the node labels and node numbers can be achieved by the function 
                    <monospace>convertNode</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">convertNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tinyTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node = c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">12</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">4</styled-content>))</preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## [1] "Node_12" "t2"      "t9"</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">convertNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tinyTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"t4"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"Node_18"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">))</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">##      t4 Node_18
##       5      18</styled-content>
                    </preformat>
                </p>
                <p>
                    <bold>Find the descendants</bold> To get descendants that are at the leaf level, we could set the argument 
                    <monospace>only.leaf = TRUE</monospace> for the function 
                    <monospace>findDescendant</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># only the leaf nodes</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">findDescendant</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tinyTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">17</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">only.leaf =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">TRUE</styled-content>)</preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## $Node_17
## [1] 4 5 6</styled-content>
                    </preformat>
                </p>
                <p>When 
                    <monospace>only.leaf = FALSE</monospace>, all descendants are returned.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># all descendant nodes</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">findDescendant</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tinyTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">17</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">only.leaf =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>)


                        <styled-content style="font-size:15px;color:#000000;">## $Node_17
## [1]  4  5  6 18</styled-content>
                    </preformat>
                </p>
                <p>
                    <bold>More functions.</bold> We list some functions that might also be useful in 
                    <xref ref-type="table" rid="T1">Table 1</xref>. More functions are available in the package, and we encourage users to develop and contribute their own functions to the package.</p>
                <table-wrap id="T1" orientation="portrait" position="anchor">
                    <label>Table 1. </label>
                    <caption>
                        <title>A table lists some functions operating on the 
                            <monospace>phylo</monospace> object that are available in the 
                            <italic toggle="yes">TreeSummarizedExperiment</italic>.</title>
                    </caption>
                    <table content-type="article-table" frame="hsides">
                        <thead>
                            <tr>
                                <th align="left" colspan="1" rowspan="1" valign="top">Functions</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Goal</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">printNode </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">print out the information of nodes </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">countNode </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">count the number of nodes </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">distNode </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">give the distance between a pair of nodes </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">matTree </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">list paths of a tree </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">findAncestor </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">find ancestor nodes </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">findChild </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">find child nodes </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">findSibling </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">find sibling nodes </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">shareNode </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">find the first node shared in the paths of nodes to the root </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">unionLeaf </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">find the union of descendant leaves </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">trackNode </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">track nodes by adding alias labels to a phylo object </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">isLeaf </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">test whether a node is a leaf node </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">showNode</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">print out nodes of a tree</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">addLabel</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">label nodes of a tree</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">joinNode</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">represent descendant nodes with their ancestor nodes</td>
                            </tr>
                        </tbody>
                    </table>
                </table-wrap>
            </sec>
            <sec>
                <title>Custom functions for the 
                    <italic toggle="yes">TreeSummarizedExperiment</italic> class</title>
                <p>Here, we show examples of how to write custom functions for 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> objects. To extract data corresponding to specific leaves, we created a function 
                    <monospace>subsetByLeaf</monospace> by combining functions working on the 
                    <monospace>phylo</monospace> class (e.g., 
                    <monospace>convertNode, keep.tip, trackNode</monospace>) with the accessor function 
                    <monospace>subsetByNode</monospace>. Here, 
                    <monospace>convertNode</monospace> and 
                    <monospace>trackNode</monospace> are available in 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold>, and 
                    <monospace>keep.tip</monospace> is from the 
                    <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=ape">
                        <italic toggle="yes">ape</italic>
                    </ext-link> package. Since the numeric identifier of a node is changed after pruning a tree with 
                    <monospace>keep.tip</monospace>, 
                    <monospace>trackNode</monospace> is provided to track the node and further update links between the rectangular assay matrices and the new tree.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># tse: a TreeSummarizedExperiment object</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># rowLeaf: specific leaves</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">subsetByLeaf &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">function</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse, rowLeaf) {</styled-content>
  
                        <styled-content style="font-size:15px;color:#8F5903;"># if rowLeaf is provided as node labels, convert them to node numbers</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">if</styled-content> (
                        <styled-content style="font-size:15px;color:#214A87">is.character</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(rowLeaf)) {</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">rowLeaf &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">convertNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree = rowTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse),</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">rowLeaf)</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">}</styled-content>

  
                        <styled-content style="font-size:15px;color:#8F5903;"># subset data by leaves</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">sse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">subsetByNode</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowNode =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">rowLeaf)</styled-content>

  
                        <styled-content style="font-size:15px;color:#8F5903;"># update the row tree</styled-content>
    
                        <styled-content style="font-size:15px;color:#8F5903;">## -------------- new tree: drop leaves ----------</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">oldTree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(sse)</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">newTree &lt;- ape</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">::</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">keep.tip</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">phy =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">oldTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">tip =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">rowLeaf)</styled-content>

    
                        <styled-content style="font-size:15px;color:#8F5903;">## -------------- update the row tree ----------</styled-content>
    
                        <styled-content style="font-size:15px;color:#8F5903;"># track the tree</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">track &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">trackNode</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(oldTree)</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">track &lt;- ape</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">::</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">keep.tip</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">phy =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">track,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">tip =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">rowLeaf)</styled-content>

    
                        <styled-content style="font-size:15px;color:#8F5903;"># update the row tree:</styled-content>
   
                        <styled-content style="font-size:15px;color:#8F5903;"> #   1. get the old alias label and update it to the new node label</styled-content>
    
                        <styled-content style="font-size:15px;color:#8F5903;">#   2. provide the new node label as rowNodeLab to update the row tree</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">oldAlias &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(sse)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">nodeLab_alias</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">newNode &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">convertNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">track,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">oldAlias)</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">newLab &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">convertNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">newTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">newNode)</styled-content>

    
                        <styled-content style="font-size:15px;color:#214A87">changeTree</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowTree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">newTree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowNodeLab =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">newLab)</styled-content>
}</preformat>
                </p>
                <p>The row tree is updated; after subsetting, it has only two leaves, 
                    <monospace>t2</monospace> and 
                    <monospace>t3</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">(both_sse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">subsetByLeaf</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tse =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">both_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLeaf = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"t2"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"t3"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)))</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">## class: TreeSummarizedExperiment
## dim: 3 4
## metadata(0):
## assays(1): Count
## rownames(3): entity1 entity2 entity3
## rowData names(4): Kingdom Phylum Class OTU
## colnames(4): sample1 sample2 sample3 sample4
## colData names(2): gg group
## reducedDimNames(0):
## altExpNames(0):
## rowLinks: a LinkDataFrame (3 rows)
## rowTree: 1 phylo tree(s) (2 leaves)
## colLinks: a LinkDataFrame (4 rows)
## colTree: 1 phylo tree(s) (4 leaves)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_sse)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## LinkDataFrame with 3 rows and 5 columns
##             nodeLab nodeLab_alias   nodeNum    isLeaf   whichTree
##         &lt;character&gt;   &lt;character&gt; &lt;integer&gt; &lt;logical&gt; &lt;character&gt;
## entity1          t3       alias_1         1      TRUE       phylo
## entity2          t3       alias_1         1      TRUE       phylo
## entity3          t2       alias_2         2      TRUE       phylo</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Operation</title>
                <p>The 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> package can be installed by following the standard installation procedures of Bioconductor packages.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># install BiocManager</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">if </styled-content>(
                        <styled-content style="font-size:15px;color:#CF5C00;">!</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">requireNamespace</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"BiocManager"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">quietly =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">TRUE</styled-content>))
     
                        <styled-content style="font-size:15px;color:#214A87">install.packages</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"BiocManager"</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># install TreeSummarizedExperiment package</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">BiocManager</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">::</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">install</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"TreeSummarizedExperiment"</styled-content>)</preformat>
                </p>
                <p>Minimum system requirements is R version 3.6 (or later) on a Mac, Windows or Linux system. The version of 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> should be later than 1.99.10, which is available in Bioconductor 3.13.</p>
            </sec>
        </sec>
        <sec>
            <title>Use cases</title>
            <sec>
                <title>HMP 16S rRNA-seq data</title>
                <p>To demonstrate the functionality of 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold>, we use it to store and manipulate a microbial dataset. We further show exploratory graphics using the available functions designed for 
                    <bold>
                        <italic toggle="yes">SummarizedExperiment</italic>
                    </bold> objects in other packages (e.g., 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/scater">scater</ext-link>
                    </italic>), or customized functions from popular visualization packages (e.g., 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=ggplot2">ggplot2</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-13">13</xref>
                    </sup>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># Packages providing dataset</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(HMP16SData)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Package to do parallel computation</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(BiocParallel)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Packages to manipulate data extracted from TreeSummarizedExperiment</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tidyr)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(dplyr)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># Packages providing visualization</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggplot2)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(scales)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggtree)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(scater)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(cowplot)</styled-content>
                    </preformat>
                </p>
                <p>The Human Microbiome Project (HMP) 16S rRNA sequencing data, 
                    <monospace>v35</monospace>, is downloaded using the R package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/HMP16SData">HMP16SData</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-14">14</xref>
                    </sup>, which contains survey data of samples collected at five major body sites in the variable regions 3&#x2013;5.
                    <monospace>v35</monospace> is available as a SummarizedExperiment object via the 
                    <monospace>ExperimentHub</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">(v35 &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">V35</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">())</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## class: SummarizedExperiment
## dim: 45383 4743
## metadata(2): experimentData phylogeneticTree
## assays(1): 16SrRNA
## rownames(45383): OTU_97.1 OTU_97.10 ... OTU_97.9998 OTU_97.9999
## rowData names(7): CONSENSUS_LINEAGE SUPERKINGDOM ... FAMILY GENUS
## colnames(4743): 700013549 700014386 ... 700114717 700114750
## colData names(7): RSID VISITNO ... HMP_BODY_SUBSITE SRS_SAMPLE_ID</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># name the assay</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">names</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(v35)) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Count"</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>The storage of HMP 16S rRNA-seq data</title>
                <p>We store the phylogenetic tree as the 
                    <monospace>rowTree</monospace>. Links between nodes of the tree and rows of 
                    <monospace>assays</monospace> are automatically generated in the construction of the 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object, and are stored as rowLinks. Rows of the 
                    <monospace>assays</monospace> matrices that do not have a match to nodes of the tree are removed with warnings.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">TreeSummarizedExperiment</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">assays = assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(v35),</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">rowData = rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(v35),</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">colData = colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(v35),</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">rowTree = metadata</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(v35)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">phylogeneticTree,</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">metadata = metadata</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(v35)[</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"experimentData"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]))</styled-content>



                        <styled-content style="font-size:15px;color:#000000;">## Warning: 47 row(s) couldn&#x2019;t be matched to the tree and are/is removed.

## class: TreeSummarizedExperiment
## dim: 45336 4743
## metadata(1): experimentData
## assays(1): Count
## rownames(45336): OTU_97.1 OTU_97.10 ... OTU_97.9998 OTU_97.9999
## rowData names(7): CONSENSUS_LINEAGE SUPERKINGDOM ... FAMILY GENUS
## colnames(4743): 700013549 700014386 ... 700114717 700114750
## colData names(7): RSID VISITNO ... HMP_BODY_SUBSITE SRS_SAMPLE_ID
## reducedDimNames(0):
## altExpNames(0):
## rowLinks: a LinkDataFrame (45336 rows)
## rowTree: 1 phylo tree(s) (45364 leaves)
## colLinks: NULL
## colTree: NULL</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">cD &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">dim</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">table</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(cD</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">HMP_BODY_SITE, cD</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">RUN_CENTER))

## [1] 5 12</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Exploratory graphics</title>
                <p>Here, we show 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> working seamlessly with 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/SEtools">SEtools</ext-link>
                    </italic> (v.1.2.0) to prepare data for the exploratory graphics. Since all operational taxonomic units (OTUs) in the sample belong to 
                    <monospace>Bacteria</monospace> in the 
                    <monospace>SUPERKINGDOM</monospace> level, we can calculate the sequencing depths by aggregating counts to the 
                    <monospace>SUPERKINGDOM</monospace> level. The resultant 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> object 
                    <bold>
                        <monospace>agg_total</monospace>
                    </bold> is further converted into a data frame 
                    <bold>
                        <monospace>df_total</monospace>
                    </bold> with selected columns (
                    <monospace>HMP_BODY_SITE and RUN_CENTER</monospace>) from the column data.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(SEtools)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_total &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tse_phy,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">by =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"SUPERKINGDOM"</styled-content>,
                     
                        <styled-content style="font-size:15px;color:#214A87">assayFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">sum)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># The assays data and selected columns of the row/col data are merged into a</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># data frame</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">df_total &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">meltSE</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_total,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">genes = rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_total),</styled-content>
                     
                        <styled-content style="font-size:15px;color:#214A87">colDat.columns = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"HMP_BODY_SITE"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"RUN_CENTER"</styled-content>))


                        <styled-content style="font-size:15px;color:#214A87">head</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(df_total)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##    feature    sample          HMP_BODY_SITE RUN_CENTER Count
## 1 Bacteria 700013549 Gastrointestinal Tract        BCM  5295
## 2 Bacteria 700014386 Gastrointestinal Tract     BCM,BI 10811
## 3 Bacteria 700014403                   Oral     BCM,BI 12312
## 4 Bacteria 700014409                   Oral     BCM,BI 20355
## 5 Bacteria 700014412                   Oral     BCM,BI 14021
## 6 Bacteria 700014415                   Oral     BCM,BI 17157</styled-content>
                    </preformat>
                </p>
                <p>To make harmonized figures with 
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/package=ggplot2">ggplot2</ext-link> (v.3.3.2)
                    <sup>
                        <xref ref-type="bibr" rid="ref-13">13</xref>
                    </sup>, we customized a theme to be applied to several plots in this section.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># Customized the plot theme</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">prettify &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">theme_bw</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">base_size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">10</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">theme</styled-content>(
     
                        <styled-content style="font-size:15px;color:#214A87">panel.spacing = unit</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"lines"</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">axis.text = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"black"</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">axis.text.x = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">angle =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">45</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">axis.title = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">8</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">legend.key.size= unit</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">3</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"mm"</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">legend.spacing.x = unit</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"mm"</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">plot.title = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.5</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">legend.text = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">8</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">legend.position=</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"bottom"</styled-content>,
     
                        <styled-content style="font-size:15px;color:#214A87">strip.background = element_rect</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">colour =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"black"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">fill =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"gray90"</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">strip.text.x = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"black"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">10</styled-content>),
     
                        <styled-content style="font-size:15px;color:#214A87">strip.text.y = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"black"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">10</styled-content>))</preformat>
                </p>
                <p>From 
                    <xref ref-type="fig" rid="f6">Figure 6</xref>, we note that more samples were collected from the oral site than other body sites.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># Figure: (the number of samples) VS (centers)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">ggplot</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(df_total)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_bar</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(RUN_CENTER,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">fill =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">HMP_BODY_SITE),</styled-content>
                
                        <styled-content style="font-size:15px;color:#214A87">position = position_dodge</styled-content>()) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">title =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"The number of samples across centers"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">y =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">""</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">scale_fill_brewer</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">palette =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Set1"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#000000;">prettify</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f6" orientation="portrait" position="float">
                    <label>Figure 6. </label>
                    <caption>
                        <title>The number of samples from different research centers.</title>
                        <p>Samples collected at different body sites are in different colors.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure6.gif"/>
                </fig>
                <p>
                    <xref ref-type="fig" rid="f7">Figure 7</xref> shows that the sequencing depth of each sample across different coordination centers are quite similar. Within the coordination center, samples collected from 
                    <monospace>Skin</monospace> are more variable in the sequencing depth than those from other body sites.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># Figure: (the sequencing depths) VS (centers)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">ggplot</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(df_total)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">geom_boxplot</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">RUN_CENTER,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">y =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">Count,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">fill =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">HMP_BODY_SITE),</styled-content>
                   
                        <styled-content style="font-size:15px;color:#214A87">position = position_dodge</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">())</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">title =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"The sequencing depths of samples"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">scale_y_continuous</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">trans = log10_trans</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">())</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">scale_fill_brewer</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">palette =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Set1"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">y =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Total counts"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#000000;">prettify</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f7" orientation="portrait" position="float">
                    <label>Figure 7. </label>
                    <caption>
                        <title>The sequencing depth of samples from different research centers.</title>
                        <p>Samples collected at different body sites are in different colors.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure7.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Dimensionality reduction</title>
                <p>We visualize samples in reduced dimensions to see whether those from the same body site are similar to each other. Three dimensionality reduction techniques are available in the package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/scater">scater</ext-link>
                    </italic> (v. 1.16.2), including principal component analysis (PCA)
                    <sup>
                        <xref ref-type="bibr" rid="ref-15">15</xref>
                    </sup>, t-distributed Stochastic Neighbor Embedding (t-SNE)
                    <sup>
                        <xref ref-type="bibr" rid="ref-16">16</xref>
                    </sup>, and uniform manifold approximation and projection (UMAP)
                    <sup>
                        <xref ref-type="bibr" rid="ref-17">17</xref>
                    </sup>. Since 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> extends the 
                    <bold>
                        <italic toggle="yes">SingleCellExperiment</italic>
                    </bold> class, functions from 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/scater">scater</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-18">18</xref>
                    </sup> can be used directly. Here, we first apply PCA and t-SNE on data at the OTU level, and select the one better clustering the samples to apply on data aggregated at coarser taxonomic levels to see whether the resolution affects the separation of samples.</p>
                <p>
                    <bold>PCA and t-SNE at the OTU level</bold> The PCA is performed on the log-transformed counts that are stored in the 
                    <monospace>assays</monospace> matrix with the name 
                    <monospace>logcounts</monospace>. In practice, data normalization is usually applied prior to the downstream analysis, to address bias or noise introduced during the sampling or sequencing process (e.g., uneven sampling depth). Here, the library size is highly variable (
                    <xref ref-type="fig" rid="f7">Figure 7</xref>) and non-zero OTUs vary across body sites. It is difficult to say what is the optimal normalization strategy, and the use of an inappropriate normalization method might introduce new biases. The discussion of normalization is outside the scope of this work. To keep it simple, we will visualize data without further normalization.</p>
                <p>In 
                    <xref ref-type="fig" rid="f8">Figure 8</xref>, we see that the 
                    <monospace>Oral</monospace> samples are distinct from those of other body sites. Samples from 
                    <monospace>Skin, Urogenital Tract, Airways</monospace> and 
                    <monospace>Gastrointestinal Tract</monospace> are not separated very well in the first two principal components.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># log-transformed data</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>logcounts &lt;- 
                        <styled-content style="font-size:15px;color:#214A87">log</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>(tse_phy)
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>Count 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># run PCA at the OTU level</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tse_phy &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">runPCA</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">name=</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"PCA_OTU"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">exprs_values =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"logcounts"</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># plot samples in the reduced dimensions</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">plotReducedDim</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">dimred =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"PCA_OTU"</styled-content>,
                 
                        <styled-content style="font-size:15px;color:#214A87">colour_by =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"HMP_BODY_SITE"</styled-content>)
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">title =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"PCA at the OTU level"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">guides</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">fill = guide_legend</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">override.aes = list</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">size=</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">2.5</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">alpha =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>))) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#000000;">prettify</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f8" orientation="portrait" position="float">
                    <label>Figure 8. </label>
                    <caption>
                        <title>Principal component analysis (PCA) plot of samples using data at the OTU level.</title>
                        <p>The first two principal components (PCs) are plotted. Each point represents a sample. Samples are coloured according to the body sites.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure8.gif"/>
                </fig>
                <p>The separation is well improved with the use of 
                    <monospace>t-SNE</monospace> in 
                    <xref ref-type="fig" rid="f9">Figure 9</xref>. Samples from 
                    <monospace>Oral, Gastrointestinal Tract</monospace>, and 
                    <monospace>Urogenital Tract</monospace> form distinct clusters. Skin samples and airways samples still overlap.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># run t-SNE at the OTU level</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tse_phy &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">runTSNE</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">name=</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"TSNE_OTU"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">exprs_values =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"logcounts"</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># plot samples in the reduced dimensions</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tsne_otu &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">plotReducedDim</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">dimred =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"TSNE_OTU"</styled-content>,
                            
                        <styled-content style="font-size:15px;color:#214A87">   colour_by =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"HMP_BODY_SITE"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">title =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"t-SNE at the OTU level"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">theme</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">plot.title = element_text</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">hjust =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.5</styled-content>)) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>     
     
                        <styled-content style="font-size:15px;color:#214A87">scale_fill_brewer</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">palette =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Set1"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">fill =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Body sites"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#214A87">guides</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">fill = guide_legend</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">override.aes = list</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">size=</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">2.5</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">alpha =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)))</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
     
                        <styled-content style="font-size:15px;color:#000000;">prettify</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tsne_otu</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f9" orientation="portrait" position="float">
                    <label>Figure 9. </label>
                    <caption>
                        <title>t-SNE plot of samples using data at the OTU level.</title>
                        <p>The first two t-SNE components are plotted. Each point represents a sample. Samples are coloured according to the body site.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure9.gif"/>
                </fig>
                <p>Notably, there are two well-separated clusters labelled as oral samples. The smaller cluster includes samples from the 
                    <monospace>Supragingival Plaque</monospace> and 
                    <monospace>Subgingival Plaque</monospace> sites, while the larger cluster includes samples from other oral sub-sites (
                    <xref ref-type="fig" rid="f10">Figure 10</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">is_oral &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">HMP_BODY_SITE</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">%in%</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Oral"</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">from_plaque &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">grepl</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">pattern =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Plaque"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                                         
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">HMP_BODY_SUBSITE)</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># Oral samples</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">plotReducedDim</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy[, is_oral],</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">dimred =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"TSNE_OTU"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                 
                        <styled-content style="font-size:15px;color:#214A87">colour_by =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"from_plaque"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">guides</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">fill = guide_legend</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">override.aes = list</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">size=</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">2.5</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">alpha =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)))</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">prettify</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f10" orientation="portrait" position="float">
                    <label>Figure 10. </label>
                    <caption>
                        <title>t-SNE plot of samples from the oral site using data at the OTU level.</title>
                        <p>The two t-SNE components computed are plotted. Each point is a sample. Samples from the &#x2018;supragingival or subgingival Plaque&#x2018; are in orange, and those from other oral sub-sites are in blue.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure10.gif"/>
                </fig>
                <p>
                    <bold>t-SNE on broader taxonomic levels</bold> To organize data at different taxonomic levels, we first replace the phylogenetic tree with the taxonomic tree that is generated from the taxonomic table. Due to the existence of polyphyletic groups, a tree structure cannot be generated. For example, the 
                    <monospace>Alteromonadaceae</monospace> family is from different orders: 
                    <monospace>Alteromonadales</monospace> and 
                    <monospace>Oceanospirillales</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># taxonomic tree</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tax_order &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"SUPERKINGDOM"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"PHYLUM"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"CLASS"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                 
                        <styled-content style="font-size:15px;color:#4F9905;">"ORDER"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"FAMILY"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"GENUS"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"CONSENSUS_LINEAGE"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tax_</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content> &lt;- 
                        <styled-content style="font-size:15px;color:#214A87">data.frame</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)[, tax_order])</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tax_loop &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">detectLoop</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tax_tab =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tax_</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># show loops that are not caused by NA</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">head</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tax_loop[</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">!</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">is.na</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tax_loop</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">child), ])</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">##               parent            child parent_column child_column
## 35   Alteromonadales Alteromonadaceae         ORDER       FAMILY
## 36 Oceanospirillales Alteromonadaceae         ORDER       FAMILY
## 37       Rhizobiales Rhodobacteraceae         ORDER       FAMILY
## 38   Rhodobacterales Rhodobacteraceae         ORDER       FAMILY
## 39      Chromatiales  Sinobacteraceae         ORDER       FAMILY
## 40   Xanthomonadales  Sinobacteraceae         ORDER       FAMILY</styled-content>
                    </preformat>
                </p>
                <p>To resolve the loops, we add a suffix to the polyphyletic genus with 
                    <monospace>resolveLoop</monospace>. For example, 
                    <monospace>Ruminococcus</monospace> belonging to the 
                    <monospace>Lachnospiraceae</monospace> and the 
                    <monospace>Ruminococcaceae</monospace> families become 
                    <monospace>Ruminococcus_1</monospace> and 
                    <monospace>Ruminococcus_2</monospace>, respectively. A 
                    <monospace>phylo</monospace> tree is created afterwards using 
                    <monospace>toTree</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">tax_</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content> &lt;- 
                        <styled-content style="font-size:15px;color:#214A87">resolveLoop</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tax_tab =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tax_</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tax_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">toTree</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">data =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tax_</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># change the tree</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tse_tax &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">changeTree</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tse_phy,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowTree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tax_tree,</styled-content>
                         
                        <styled-content style="font-size:15px;color:#214A87">rowNodeLab = rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_phy)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">CONSENSUS_LINEAGE)</styled-content>
                    </preformat>
                </p>
                <p>The separation of samples from different body sites appears to be worse when the data on broader resolution is used (
                    <xref ref-type="fig" rid="f11">Figure 11</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># aggregation data to all internal nodes</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># Parallel computation is performed with BPPARAM</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tse_agg &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tse_tax,</styled-content>
                    
                        <styled-content style="font-size:15px;color:#214A87">rowLevel =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">tax_tree</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">node.label,</styled-content>
                    
                        <styled-content style="font-size:15px;color:#214A87">whichAssay =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Count"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                    
                        <styled-content style="font-size:15px;color:#214A87">BPPARAM = MulticoreParam</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(),</styled-content>
                    
                        <styled-content style="font-size:15px;color:#214A87">message =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>
                       

                        <styled-content style="font-size:15px;color:#8F5903;"># log-transform count</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_agg)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">logcounts &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">log</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">assays</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_agg)[[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]]</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f11" orientation="portrait" position="float">
                    <label>Figure 11. </label>
                    <caption>
                        <title>t-SNE plot of samples using data at different taxonomic levels.</title>
                        <p>The two t-SNE components computed are plotted. Each point is a sample. Samples are colored according to the body sites.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure11.gif"/>
                </fig>
                <p>Specifically, we loop over each taxonomic rank and generate a t-SNE representation using data aggregated at that taxonomic rank level.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">tax_rank &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"GENUS"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"FAMILY"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"ORDER"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"CLASS"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"PHYLUM"</styled-content>)

                        <styled-content style="font-size:15px;color:#214A87">names</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tax_rank) &lt;- tax_rank</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">fig_list &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">lapply</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tax_rank,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">FUN = function</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(x) {</styled-content>
  
                        <styled-content style="font-size:15px;color:#8F5903;"># nodes represent the specific taxonomic level</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">xx &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">startsWith</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_agg)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">nodeLab, x)</styled-content>

  
                        <styled-content style="font-size:15px;color:#8F5903;"># run t-SNE on the specific level</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">xx_tse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">runTSNE</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_agg,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">name = paste0</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"TSNE_"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">, x),</styled-content>
                      
                        <styled-content style="font-size:15px;color:#214A87">exprs_values =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"logcounts"</styled-content>,
                      
                        <styled-content style="font-size:15px;color:#214A87">subset_row = rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_agg)[xx])</styled-content>
                       
  
                        <styled-content style="font-size:15px;color:#8F5903;"># plot samples in the reduced dimensions</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">plotReducedDim</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(xx_tse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">dimred = paste0</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#4F9905;">"TSNE_"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">, x),</styled-content>
                   
                        <styled-content style="font-size:15px;color:#214A87">colour_by =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"HMP_BODY_SITE"</styled-content>,
                   
                        <styled-content style="font-size:15px;color:#214A87">point_size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.5</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
    
                        <styled-content style="font-size:15px;color:#214A87">labs</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">title =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">x)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;"> +</styled-content>
    
                        <styled-content style="font-size:15px;color:#000000;">prettify</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
    
                        <styled-content style="font-size:15px;color:#214A87">theme</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">legend.position =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"none"</styled-content>)
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>    
    
                        <styled-content style="font-size:15px;color:#214A87">scale_fill_brewer</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">palette =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"Set1"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">guides</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">fill = guide_legend</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">override.aes = list</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">size=</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">2.5</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)))</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">})</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">legend &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">get_legend</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
  
                        <styled-content style="font-size:15px;color:#8F5903;"># create some space to the left of the legend</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">tsne_otu</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
    
                        <styled-content style="font-size:15px;color:#214A87">theme</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">legend.box.margin = margin</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">35</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">),</styled-content>
           
                        <styled-content style="font-size:15px;color:#214A87">legend.position =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"right"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">plot_grid</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">plotlist =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">fig_list,</styled-content>
           
                        <styled-content style="font-size:15px;color:#000000;">legend,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">nrow =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>CyTOF data</title>
                <p>Here, a mass cytometry (CyTOF) dataset
                    <sup>
                        <xref ref-type="bibr" rid="ref-19">19</xref>
                    </sup> is used to show the application of 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> on single cell data. The data was available initially as a 
                    <bold>
                        <italic toggle="yes">SummarizedExperiment</italic>
                    </bold> object, and became a 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperient</italic>
                    </bold> object after the incorporation of a tree on cells. Data was then aggregated along nodes of the tree to provide data at different resolutions. The data visualization was finally performed as heatmaps along with the tree using the R package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/ggtree">ggtree</ext-link>
                    </italic>. </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># packages for visualization</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggplot2)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggtree)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ggnewscale)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(RColorBrewer)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># packages for data download and preprocess</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(HDCytoData)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(diffcyt)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ape)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># packages for data manipulation</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(dplyr)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tidyr)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">library</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tibble)</styled-content>
                    </preformat>
                </p>
                <p>The mass cytometry (CyTOF) dataset
                    <sup>
                        <xref ref-type="bibr" rid="ref-19">19</xref>
                    </sup> is downloaded from the R package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/HDCytoData">HDCytoData</ext-link>
                    </italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-20">20</xref>
                    </sup>. The data has 16 samples (eight pairs) of peripheral blood cell collected from eight healthy individuals. Each pair consists of one unstimulated sample, and one sample stimulated with B cell receptor/Fc receptor cross-linker (BCR-XL). The data contains expressions of 24 protein markers: 10 surface lineage markers 
                    <monospace>(type)</monospace> and 14 intracellular signaling functional markers 
                    <monospace>(state)</monospace>, from 172791 cells.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># download data</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">d_se &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">Bodenmiller_BCR_XL_SE</styled-content>()


                        <styled-content style="font-size:15px;color:#8F5903;"># Extract data of protein markers
# surface lineage markers: type
# intracellular signaling functional markers: state</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">is_ab &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">marker_class</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">%in%</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"type"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"state"</styled-content>)

                        <styled-content style="font-size:15px;color:#000000;">d_se &lt;- d_se[, is_ab]
d_se</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## class: SummarizedExperiment
## dim: 172791 24
## metadata(2): experiment_info n_cells
## assays(1): exprs
## rownames: NULL
## rowData names(4): group_id patient_id sample_id population_id
## colnames(24): CD3 CD45 ... HLA-DR CD7
## colData names(3): channel_name marker_name marker_class</styled-content>
                    </preformat>
                </p>
                <p>We preprocess the data and cluster cells using the workflow from the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/diffcyt">diffcyt</ext-link>
                    </italic> package
                    <sup>
                        <xref ref-type="bibr" rid="ref-21">21</xref>,
                        <xref ref-type="bibr" rid="ref-22">22</xref>
                    </sup>. According to the median expressions of lineage markers per cluster, a tree 
                    <monospace>cytof_hclust</monospace> is then constructed by applying the hierarchical clustering on the cell cluster level, using only the &#x201c;type&#x201d; gene.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># Transform data</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">d_se &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">transformData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Include a random seed to generate a reproducible clustering</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">d_se &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">generateClusters</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">xdim =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">ydim =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">7</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">seed_clustering =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">12</styled-content>)

                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>(d_se)
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>cluster_id &lt;- 
                        <styled-content style="font-size:15px;color:#214A87">paste0</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">cluster_id)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Use cluster IDs as row names</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">cluster_id</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Generate a tree with cell clusters as leaves</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">d_medians &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">calcMediansByClusterMarker</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">md &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">assay</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_medians)[,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">metadata</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_medians)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">id_type_markers]</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">cytof_hclust &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">hclust</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">dist</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(md,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">method =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"manhattan"</styled-content>), 
                        <styled-content style="font-size:15px;color:#214A87">method =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"mcquitty"</styled-content>)</preformat>
                </p>
                <p>The data 
                    <monospace>d_se</monospace> is converted from 
                    <bold>
                        <italic toggle="yes">SummarizedExperiment</italic>
                    </bold> to 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> to provide a 
                    <monospace>rowTree</monospace> slot for the storage the tree information.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># The tree format: convert from hclust to phylo; label internal nodes</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">cytof_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">as.phylo</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(cytof_hclust)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">cytof_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">addLabel</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">on =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"internal"</styled-content>)


                        <styled-content style="font-size:15px;color:#8F5903;"># Construct a TreeSummarizedExperiment object</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">lse &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">as</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(d_se,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"TreeSummarizedExperiment"</styled-content>)

                        <styled-content style="font-size:15px;color:#214A87">rowTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(lse) &lt;- cytof_tree</styled-content>
                    </preformat>
                </p>
                <p>In 
                    <monospace>lse</monospace>, multiple rows (cells) are mapped to a leaf (a cell cluster) of the tree.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># Data corresponding to the cluster_1</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">subsetByNode</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(lse,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowNode =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_1"</styled-content>)


                        <styled-content style="font-size:15px;color:#000000;">## class: TreeSummarizedExperiment
## dim: 2461 24
## metadata(3): experiment_info n_cells MST
## assays(1): exprs
## rownames(2461): cluster_1 cluster_1 ... cluster_1 cluster_1
## rowData names(5): group_id patient_id sample_id population_id
##   cluster_id
## colnames(24): CD3 CD45 ... HLA-DR CD7
## colData names(3): channel_name marker_name marker_class
## reducedDimNames(0):
## altExpNames(0):
## rowLinks: a LinkDataFrame (2461 rows)
## rowTree: 1 phylo tree(s) (49 leaves)
## colLinks: NULL
## colTree: NULL</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Data aggregation</title>
                <p>We split the data into two 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold> objects: 
                    <monospace>lse_type</monospace> for lineage markers and 
                    <monospace>lse_state</monospace> for functional markers, to perform aggregation in different ways. For 
                    <monospace>lse_type</monospace>, the marker median expression is calculated over all samples to compare expression patterns of lineage markers across all cell clusters. For 
                    <monospace>lse_state</monospace>, the marker median expression is computed on individual samples, to enable comparison between stimulated and unstimulated samples across clusters.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># Split TSE: lineage markers and functional markers</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">lse_type &lt;- lse[,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(lse)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">marker_class</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">==</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"type"</styled-content>]

                        <styled-content style="font-size:15px;color:#000000;">lse_state &lt;- lse[,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">colData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(lse)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">marker_class</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">==</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"state"</styled-content>]


                        <styled-content style="font-size:15px;color:#8F5903;"># All nodes of the tree</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">nodes &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">showNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">only.leaf =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>)

                        <styled-content style="font-size:15px;color:#214A87">length</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(nodes)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## [1] 97</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Calculate marker median expressions for clusters</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tse_type &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">lse_type,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLevel =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">nodes,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">median)</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># use node labels instead of node alias as row names</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">nodeLab</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># row --&gt; node; column --&gt; marker</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">dim</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## [1] 97 10</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Calculate marker median expressions for clusters separately on each sample</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">tse_state &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">aggTSE</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">x =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">lse_state,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLevel =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">nodes,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowFun =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">median,</styled-content>
                      
                        <styled-content style="font-size:15px;color:#214A87">rowBlock =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"sample_id"</styled-content>)

                        <styled-content style="font-size:15px;color:#8F5903;"># use node labels instead of node alias as row names</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_state) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_state)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">nodeLab</styled-content>

                        <styled-content style="font-size:15px;color:#8F5903;"># row --&gt; node per sample; column --&gt; marker</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">dim</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_state)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## [1] 1552 14</styled-content>
                    </preformat>
                </p>
                <p>After aggregation, 
                    <monospace>tse_type</monospace> and 
                    <monospace>tse_state</monospace> have 97 and 1552 rows, respectively. The former has each row representing a cell cluster that is mapped to a node of the tree; the latter has each row representing a cell cluster in a sample.</p>
                <p>In the downloaded data, cells are annotated with cell types (
                    <monospace>population_id</monospace> in 
                    <monospace>rowData()</monospace>). As clustering is not perfect, cells within a cluster are not expected to have exactly the same cell type. Therefore, we would like to annotate a cell cluster with the cell type that the majority of cells (&gt; 60%) belong to, or 
                    <monospace>mixed</monospace> if none of cell types has more than &gt; 60% cells. Note, internal nodes of the tree 
                    <monospace>cytof_tree</monospace> are considered as cell clusters at broader resolution than leaf nodes. To annotate an internal node, we need to first find all cells that are mapped to its descendant leaves, and then take the cell type shared by its majority of cells.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#8F5903;"># Find descendant leaves of all nodes; Leaves return themselves</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">desd_leaf &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">findDescendant</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">nodes,</styled-content>
                               
                        <styled-content style="font-size:15px;color:#214A87">only.leaf =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">TRUE</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">self.include =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">TRUE</styled-content>)

                        <styled-content style="font-size:15px;color:#8F5903;"># For example, Node_90 has two descendant leaves: 32 &amp; 33 (node number)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">desd_leaf[[</styled-content>
                        <styled-content style="font-size:15px;color:#0000CF;">90</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">]]</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">## Node_90 Node_90
##      32      33</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Decide cell type for each node according to majorities of cells belong to it</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">threshold &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">0.6</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">ct &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">sapply</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(desd_leaf,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">FUN = function</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(x) {</styled-content>
  
                        <styled-content style="font-size:15px;color:#8F5903;"># Data of cells belong to the descendant leaves (x) of a node</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">xse &lt;- lse[</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">rowLinks</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(lse)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">nodeNum</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">%in%</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">x, ]</styled-content>

  
                        <styled-content style="font-size:15px;color:#8F5903;"># Percentages of cell types</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">tx &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">table</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(xse)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">population_id)</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">pr &lt;- tx</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">/</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">sum</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tx)</styled-content>

  
                        <styled-content style="font-size:15px;color:#8F5903;"># The cell type shared by the majority of cells</styled-content>
  
                        <styled-content style="font-size:15px;color:#000000;">ind &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">which</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(pr</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">&gt;</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">threshold)</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">if</styled-content> (
                        <styled-content style="font-size:15px;color:#CF5C00;">!</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">length</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ind)) {</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">return</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"mixed"</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">)}</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tx)[ind]</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">})</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">head</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(ct)</styled-content>


                        <styled-content style="font-size:15px;color:#000000;">##      cluster_1    cluster_10    cluster_11    cluster_12    cluster_13
##     "NK cells" "CD8 T-cells"    "NK cells" "CD8 T-cells"   "monocytes"
##     cluster_14
## "B-cells IgM-"</styled-content>


                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">
                            <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        </styled-content>
                        <styled-content style="font-size:15px;color:#000000;">population_id &lt;- ct[</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type)]</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">rowData</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_state)</styled-content>
                        <styled-content style="font-size:15px;color:#CF5C00;">
                            <styled-content style="font-size:15px;color:#CF5C00;">$</styled-content>
                        </styled-content>
                        <styled-content style="font-size:15px;color:#000000;">population_id &lt;- ct[</styled-content>
                        <styled-content style="font-size:15px;color:#214A87">rownames</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_state)]</styled-content>
                    </preformat>
                </p>
            </sec>
            <sec>
                <title>Visualization</title>
                <p>The 
                    <monospace>cytof_tree</monospace> tree is considered as a hierarchical structure organizing cell clusters at different granularities. So, an internal node is a cell cluster that incorporates several cell clusters represented by its descendant leaves. Here, we are interested in exploring the expression profile of markers at different resolutions.</p>
                <p>We customize a function 
                    <monospace>treeHM</monospace> (below) to draw a tree along with three heatmaps as 
                    <xref ref-type="fig" rid="f12">Figure 12</xref>. The function is created mainly based on 
                    <monospace>ggtree</monospace> and 
                    <monospace>gheatmap</monospace> from the R package 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/ggtree">ggtree</ext-link>
                    </italic>. The use of different color palettes for heatmaps is enable by 
                    <monospace>scale_fill_*</monospace> (from 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/ggplot2">ggplot2</ext-link>
                    </italic>) and 
                    <monospace>new_scale_fill()</monospace> (from 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/ggnewscale">ggnewscale</ext-link>
                    </italic>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="color:#000000;font-size:15px;">treeHM &lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">function</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(tse_type, tse_state,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">select =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"pS6"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">) {</styled-content>
   
                        <styled-content style="color:#8F5903;font-size:15px;"># plot the tree</styled-content>
   
                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">&lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">ggtree</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">rowTree</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(tse_type),</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">ladderize =</styled-content> 
                        <styled-content style="color:#8F5903;font-size:15px;">FALSE</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
    
                        <styled-content style="color:#214A87;font-size:15px;">geom_tiplab</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">size =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">1.8</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">align =</styled-content> 
                        <styled-content style="color:#8F5903;font-size:15px;">TRUE</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="color:#8F5903;font-size:15px;"># viz cell types of clusters in the 1st heatmap</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">cluster_type &lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">rowData</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(tse_type)[,</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"population_id"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">, drop =</styled-content> 
                        <styled-content style="color:#8F5903;font-size:15px;">FALSE</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">]</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">2</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">&lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">gheatmap</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">p =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">data =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">cluster_type,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">width =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">0.15</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                      
                        <styled-content style="color:#214A87;font-size:15px;">offset =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">3.5</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">colnames_angle =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">45</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">hjust =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                      
                        <styled-content style="color:#214A87;font-size:15px;">font.size =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">2.5</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">scale_fill_brewer</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">palette =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"Set1"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">name =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"Cell types"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                       
                        <styled-content style="color:#214A87;font-size:15px;">guide = guide_legend</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">order =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">))</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">new_scale_fill</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">()</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="color:#8F5903;font-size:15px;"># viz expression of lineage markers in the 2nd heatmap</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">3</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">&lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">gheatmap</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">p =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">2</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">data = assays</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(tse_type)[[</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">]],</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">width =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">1.2</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                      
                        <styled-content style="color:#214A87;font-size:15px;">offset =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">6.5</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">colnames_angle =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">45</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">hjust =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                      
                        <styled-content style="color:#214A87;font-size:15px;">font.size =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">2</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">scale_fill_viridis_c</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">option =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"A"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">name =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"Lineage (expr)"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                          
                        <styled-content style="color:#214A87;font-size:15px;">guide = guide_colourbar</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">order =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">2</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">))</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">new_scale_fill</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">()</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="color:#8F5903;font-size:15px;"># viz expression of pS6 in the 3rd heatmap</styled-content>

                        <styled-content style="color:#8F5903;font-size:15px;"># The expression of pS6 on all (97) nodes of the tree for 16 samples</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">sse &lt;- tse_state[,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">colData</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(tse_state)</styled-content>
                        <styled-content style="color:#CF5C00;font-size:15px;">$</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">marker_name</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">==</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">select]</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">mat &lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">assays</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(sse)[[</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">]]</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">%&gt;%</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">data.frame</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">check.names =</styled-content> 
                        <styled-content style="color:#8F5903;font-size:15px;">FALSE</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">%&gt;%</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">mutate</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">sample_id = paste</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">rowData</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(sse)</styled-content>
                        <styled-content style="color:#CF5C00;font-size:15px;">$</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">group_id,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">rowData</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(sse)</styled-content>
                        <styled-content style="color:#CF5C00;font-size:15px;">$</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">patient_id,</styled-content>
                               
                        <styled-content style="color:#214A87;font-size:15px;">sep =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"_"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
          
                        <styled-content style="color:#214A87;font-size:15px;">cluster_id = rowLinks</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(sse)</styled-content>
                        <styled-content style="color:#CF5C00;font-size:15px;">$</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">nodeLab)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">%&gt;%</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">arrange</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">desc</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">factor</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(sample_id)))</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">%&gt;%</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">pivot_wider</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">names_from =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">sample_id,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">values_from =</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">!!</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">select)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">%&gt;%</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">column_to_rownames</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">var =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"cluster_id"</styled-content>)

                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">4</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">&lt;-</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">gheatmap</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">p =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">3</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">data =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">mat,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">offset =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">18</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content>
                      
                        <styled-content style="color:#214A87;font-size:15px;">width =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">2</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">colnames_angle =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">45</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">hjust =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>,
                      
                        <styled-content style="color:#214A87;font-size:15px;">font.size =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">2</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">scale_fill_viridis_c</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">option =</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"D"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#214A87;font-size:15px;">name =</styled-content> 
                        <styled-content style="color:#000000;font-size:15px;">select,</styled-content>
                          
                        <styled-content style="color:#214A87;font-size:15px;">guide = guide_colourbar</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">order =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">3</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">))</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">expand_limits</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">y =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">-8</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">)</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">plot_</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">4</styled-content> 
                        <styled-content style="color:#CF5C00;font-size:15px;">+</styled-content>
  
                        <styled-content style="color:#214A87;font-size:15px;">theme</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#214A87;font-size:15px;">legend.key.size= unit</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">2.5</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"mm"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
         
                        <styled-content style="color:#214A87;font-size:15px;">legend.spacing.x = unit</styled-content>(
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"mm"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
         
                        <styled-content style="color:#214A87;font-size:15px;">legend.spacing.y = unit</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">(</styled-content>
                        <styled-content style="color:#0000CF;font-size:15px;">1</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">,</styled-content> 
                        <styled-content style="color:#4F9905;font-size:15px;">"mm"</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
         
                        <styled-content style="color:#214A87;font-size:15px;">legend.text = element_text</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">size =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">6</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
         
                        <styled-content style="color:#214A87;font-size:15px;">legend.title = element_text</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">size =</styled-content> 
                        <styled-content style="color:#0000CF;font-size:15px;">7</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
         
                        <styled-content style="color:#214A87;font-size:15px;">legend.background = element_rect</styled-content>(
                        <styled-content style="color:#214A87;font-size:15px;">fill =</styled-content> 
                        <styled-content style="color:#8F5903;font-size:15px;">NA</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">),</styled-content>
         
                        <styled-content style="color:#214A87;font-size:15px;">legend.position=c</styled-content>(
                        <styled-content style="color:#0000CF;font-size:15px;">0.05</styled-content>, 
                        <styled-content style="color:#0000CF;font-size:15px;">0.65</styled-content>
                        <styled-content style="color:#000000;font-size:15px;">))</styled-content>

                        <styled-content style="color:#000000;font-size:15px;">}</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f12" orientation="portrait" position="float">
                    <label>Figure 12. </label>
                    <caption>
                        <title>The median expression of markers across 49 cell clusters.</title>
                        <p>Leaves of the tree are labeled with
their corresponding cell clusters. Cell types 
                            <monospace>(population_id)</monospace> of leaves are shown in the first heatmap. Median expressions of ten lineage markers on each leaf are shown in the middle heatmap. Cell clusters in the same branch show similar expression patterns of lineage markers. The right heatmap is about the median expression of a functional marker 
                            <monospace>pS6</monospace> in clusters (rows) per sample (column).</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure12.gif"/>
                </fig>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">

                        <styled-content style="font-size:15px;color:#214A87">treeHM</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type, tse_state,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"pS6"</styled-content>)</preformat>
                </p>
                <p>In 
                    <xref ref-type="fig" rid="f12">Figure 12</xref>, the expression of 
                    <monospace>pS6</monospace> appears different mainly in three cell clusters (
                    <monospace>cluster_6</monospace>, 
                    <monospace>cluster_7</monospace> and 
                    <monospace>cluster_14</monospace>) between stimulated and unstimulated samples. These three clusters all belong to B cells. Also, monocytes seem to have slightly higher 
                    <monospace>pS6</monospace> in stimulated samples than in unstimulated samples. 
                    <monospace>cluster_18</monospace> is labeled as CD8 T-cells, but it is more similar to monocytes in the expression pattern of lineage markers.</p>
                <p>We manipulate 
                    <monospace>cytof_tree</monospace> by merging its three branches as three internal nodes to creates a new tree 
                    <monospace>agg_tree</monospace> (see 
                    <xref ref-type="fig" rid="f13">Figure 13</xref>). 
                    <monospace>shareNode</monospace> is used to find the first shared node on paths from specific nodes to the root.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#8F5903;"># find branch nodes of the three branches</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">B_node &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">shareNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_6"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_7"</styled-content>))

                        <styled-content style="font-size:15px;color:#000000;">CD4_node &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">shareNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_36"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_31"</styled-content>))

                        <styled-content style="font-size:15px;color:#000000;">mct_node &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">shareNode</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node = c</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_34"</styled-content>, 
                        <styled-content style="font-size:15px;color:#4F9905;">"cluster_28"</styled-content>))


                        <styled-content style="font-size:15px;color:#8F5903;"># Nodes are labeled in red (see Figure)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_node &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(B_node, CD4_node, mct_node)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_label &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">names</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(agg_node)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Set the specific nodes as leaves</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">agg_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">asLeaf</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">tree =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">node =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">agg_label)</styled-content>


                        <styled-content style="font-size:15px;color:#8F5903;"># Generate a figure to compare both trees</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">both_tree &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">list</styled-content>(
                        <styled-content style="font-size:15px;color:#4F9905;">"cytof_tree"</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">= cytof_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"agg_tree"</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">= agg_tree)</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">class</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tree) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"multiPhylo"</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">ggtree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(both_tree,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">ladderize =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">FALSE</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
  
                        <styled-content style="font-size:15px;color:#214A87">facet_wrap</styled-content>(
                        <styled-content style="font-size:15px;color:#CF5C00;">~</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">.id,</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">scales =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"free"</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>
    
                        <styled-content style="font-size:15px;color:#214A87">geom_tiplab</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">1.8</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">align =</styled-content> 
                        <styled-content style="font-size:15px;color:#8F5903;">TRUE</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">geom_point2</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">aes</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">subset =</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">label</styled-content> 
                        <styled-content style="font-size:15px;color:#CF5C00;">%in%</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;">agg_label),</styled-content>
              
                        <styled-content style="font-size:15px;color:#214A87">color =</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"red"</styled-content>, 
                        <styled-content style="font-size:15px;color:#214A87">size =</styled-content> 
                        <styled-content style="font-size:15px;color:#0000CF;">2</styled-content>) 
                        <styled-content style="font-size:15px;color:#CF5C00;">+</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">xlim</styled-content>(
                        <styled-content style="font-size:15px;color:#214A87">c</styled-content>(
                        <styled-content style="font-size:15px;color:#0000CF;">0</styled-content>, 
                        <styled-content style="font-size:15px;color:#0000CF;">10</styled-content>))</preformat>
                </p>
                <fig fig-type="figure" id="f13" orientation="portrait" position="float">
                    <label>Figure 13. </label>
                    <caption>
                        <title>Comparison of two trees: 
                            <monospace>cytof_tree</monospace> and 
                            <monospace>agg_tree</monospace>.</title>
                        <p>Three branches that are connected to the three red nodes in 
                            <monospace>cytof_tree</monospace> are merged, and are presented as dashed lines in 
                            <monospace>agg_tree</monospace>.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure13.gif"/>
                </fig>
                <p>We replace the 
                    <monospace>rowTree()</monospace> with the new tree 
                    <monospace>agg_tree,</monospace> and update 
                    <xref ref-type="fig" rid="f12">Figure 12</xref> to get 
                    <xref ref-type="fig" rid="f14">14</xref>. Also, other functional markers, e.g., 
                    <monospace>pNFkB</monospace>, can be visualized instead of 
                    <monospace>pS6</monospace>, which we do not show here.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#214A87">rowTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type) &lt;-</styled-content> 
                        <styled-content style="font-size:15px;color:#214A87">rowTree</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_state) &lt;- agg_tree</styled-content>

                        <styled-content style="font-size:15px;color:#214A87">treeHM</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">(tse_type, tse_state,</styled-content> 
                        <styled-content style="font-size:15px;color:#4F9905;">"pS6"</styled-content>)</preformat>
                </p>
                <fig fig-type="figure" id="f14" orientation="portrait" position="float">
                    <label>Figure 14. </label>
                    <caption>
                        <title>The median expression of markers across 26 cell clusters.</title>
                        <p>This figure is similar to 
                            <xref ref-type="fig" rid="f12">Figure 12</xref> except that B cells 
                            <monospace>(Node_51)</monospace>, monocytes 
                            <monospace>(Node_53)</monospace> and CD4 T-cells 
                            <monospace>(Node_55)</monospace> are now visualized at a broader resolution.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/54474/dfa2cf45-381d-4942-8306-e5e0cf856a40_figure14.gif"/>
                </fig>
                <p>Overall, with 
                    <bold>
                        <italic toggle="yes">TreeSummarizedExperiment</italic>
                    </bold>, single-cell users can over-cluster cells into many cell subpopulations, customize visualization functions to explore data at the high resolution, and finally merge clusters with similar profiles to a suitable resolution to perform downstream analysis.</p>
            </sec>
        </sec>
        <sec>
            <title>Summary</title>
            <p>
                <italic toggle="yes">TreeSummarizedExperiment</italic> is an S4 class in the family of 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> classes, which enables it to work seamlessly with many other packages in Bioconductor. It integrates the 
                <bold>
                    <italic toggle="yes">SummarizedExperiment</italic>
                </bold> and the 
                <monospace>phylo</monospace> class, facilitating data access or manipulation at different resolutions of the hierarchical structure. By providing additional functions for the 
                <monospace>phylo</monospace> class, we support users to customize functions for the 
                <bold>
                    <italic toggle="yes">TreeSummarizedExperiment</italic>
                </bold> class in their workflows.</p>
        </sec>
        <sec>
            <title>Data availability</title>
            <sec>
                <title>Underlying data</title>
                <p>Human Microbiome Project data (v35) and mass cytometry (CyTOF) dataset
                    <sup>
                        <xref ref-type="bibr" rid="ref-19">19</xref>
                    </sup> were used for the presented use cases. They can be downloaded using the R package 
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/HMP16SData">HMP16SData</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-14">14</xref>
                    </sup> and 
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.12/HDCytoData">HDCytoData</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-20">20</xref>
                    </sup>, respectively.</p>
            </sec>
        </sec>
        <sec>
            <title>Software availability</title>
            <p>The TreeSummarizedExperiment package is available at:</p>
            <p>
                <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/release/bioc/html/TreeSummarizedExperiment.html">https://doi.org/doi:10.18129/B9.bioc.TreeSummarizedExperiment</ext-link> </p>
            <p>Source code of the development version of the package is available at:</p>
            <p>
                <ext-link ext-link-type="uri" xlink:href="https://github.com/fionarhuang/TreeSummarizedExperiment">https://github.com/fionarhuang/TreeSummarizedExperiment</ext-link>
            </p>
            <p>Archived source code as at time of publication: 
                <ext-link ext-link-type="uri" xlink:href="http://doi.org/10.5281/zenodo.4046096">http://doi.org/10.5281/zenodo.4046096</ext-link>
                <sup>
                    <xref ref-type="bibr" rid="ref-23">23</xref>
                </sup>
            </p>
        </sec>
    </body>
    <back>
        <sec>
            <title>Author information</title>
            <p>RH developed the software with contributions from FGME. All authors participated in the conceptualization of the software. RH, CS and MDR drafted the manuscript with review and editing from KCRA, SCH, GY and FGME. All authors read and approved the final manuscript.</p>
        </sec>
        <ack>
            <title>Acknowledgments</title>
            <p>We thank H&#x00e9;ctor Corrada Bravo, LeviWaldron, Herv&#x00e9; Pag&#x00e8;s, Martin Morgan, Federico Marini, Jayaram Kancherla, Domenick Braccia, Vince Carey, Kasper D Hansen, Davide Risso, Daniel van Twisk, Marcel Ramos and other members of the Bioconductor community for their helpful suggestions.</p>
        </ack>
        <ref-list>
            <ref id="ref-1">
                <label>1</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Huang</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Soneson</surname>
                            <given-names>C</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Germain</surname>
                            <given-names>PL</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>treeclimbR pinpoints the data-dependent resolution of hierarchical hypotheses.</article-title>
                    <source>

                        <italic toggle="yes">bioRxiv.</italic>
</source>
                    <year>2020</year>.
                    <pub-id pub-id-type="doi">10.1101/2020.06.08.140608</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-2">
                <label>2</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>McMurdie</surname>
                            <given-names>PJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Holmes</surname>
                            <given-names>S</given-names>
                        </name>
</person-group>:
                    <article-title>phyloseq: an R package for reproducible interactive analysis and graphics of microbiome census data.</article-title>
                    <source>

                        <italic toggle="yes">PLoS One.</italic>
</source>
                    <year>2013</year>;<volume>8</volume>(<issue>4</issue>):<fpage>e61217</fpage>.
                    <pub-id pub-id-type="pmid">23630581</pub-id>
                    <pub-id pub-id-type="doi">10.1371/journal.pone.0061217</pub-id>
                    <pub-id pub-id-type="pmcid">3632530</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-3">
                <label>3</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Lun</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Risso</surname>
                            <given-names>D</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Korthauer</surname>
                            <given-names>K</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>SingleCellExperiment: S4 Classes for Single Cell Data</article-title>.<year>2020</year>.
                    <pub-id pub-id-type="doi">10.18129/B9.bioc.SingleCellExperiment </pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-4">
                <label>4</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Morgan</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Obenchain</surname>
                            <given-names>V</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Hester</surname>
                            <given-names>J</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>SummarizedExperiment: SummarizedExperiment container</article-title>.<year>2020</year>.
                    <pub-id pub-id-type="doi">10.18129/B9.bioc.SummarizedExperiment</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-5">
                <label>5</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Wickham</surname>
                            <given-names>H</given-names>
                        </name>
</person-group>:
                    <article-title>Advanced r</article-title>. 
CRC press, second edition.<year>2019</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://adv-r.hadley.nz/">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-6">
                <label>6</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Paradis</surname>
                            <given-names>E</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Schliep</surname>
                            <given-names>K</given-names>
                        </name>
</person-group>:
                    <article-title>ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2019</year>;<volume>35</volume>(<issue>3</issue>):<fpage>526</fpage>&#x2013;<lpage>528</lpage>.
                    <pub-id pub-id-type="pmid">30016406</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/bty633</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-7">
                <label>7</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Rue-Albrecht</surname>
                            <given-names>K</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Marini</surname>
                            <given-names>F</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Soneson</surname>
                            <given-names>C</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>iSEE: Interactive SummarizedExperiment Explorer [version 1; peer review: 3 approved].</article-title>
                    <source>

                        <italic toggle="yes">F1000Res.</italic>
</source>
                    <year>2018</year>;<volume>7</volume>:<fpage>741</fpage>.
                    <pub-id pub-id-type="pmid">30002819</pub-id>
                    <pub-id pub-id-type="doi">10.12688/f1000research.14966.1</pub-id>
                    <pub-id pub-id-type="pmcid">6013759</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-8">
                <label>8</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Germain</surname>
                            <given-names>PL</given-names>
                        </name>
</person-group>:
                    <article-title>SEtools: tools for working with SummarizedExperiment</article-title>.<year>2020</year>.
                    <pub-id pub-id-type="doi">10.18129/B9.bioc.SEtools</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-9">
                <label>9</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Yin</surname>
                            <given-names>T</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Cook</surname>
                            <given-names>D</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Lawrence</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>ggbio: an R package for extending the grammar of graphics for genomic data.</article-title>
                    <source>

                        <italic toggle="yes">Genome Biol.</italic>
</source>
                    <year>2012</year>;<volume>13</volume>(<issue>8</issue>):<fpage>R77</fpage>.
                    <pub-id pub-id-type="pmid">22937822</pub-id>
                    <pub-id pub-id-type="doi">10.1186/gb-2012-13-8-r77</pub-id>
                    <pub-id pub-id-type="pmcid">4053745</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-10">
                <label>10</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Wang</surname>
                            <given-names>LG</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Lam</surname>
                            <given-names>TTY</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Xu</surname>
                            <given-names>S</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>
                        <italic toggle="yes">Treeio</italic>: An R Package for Phylogenetic Tree Input and Output with Richly Annotated and Associated Data.</article-title>
                    <source>

                        <italic toggle="yes"> Mol Biol Evol.</italic>
</source>
                    <year>2020</year>;<volume>37</volume>(<issue>2</issue>):<fpage>599</fpage>&#x2013;<lpage>603</lpage>.
                    <pub-id pub-id-type="pmid">31633786</pub-id>
                    <pub-id pub-id-type="doi">10.1093/molbev/msz240</pub-id>
                    <pub-id pub-id-type="pmcid">6993851</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-11">
                <label>11</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Yu</surname>
                            <given-names>G</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Smith</surname>
                            <given-names>DK</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Zhu</surname>
                            <given-names>H</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>ggtree: an r package for visualization and annotation of phylogenetic trees with their covariates and other associated data.</article-title>
                    <source>

                        <italic toggle="yes">Methods Ecol Evol.</italic>
</source>
                    <year>2017</year>;<volume>8</volume>(<issue>1</issue>):<fpage>28</fpage>&#x2013;<lpage>36</lpage>.
                    <pub-id pub-id-type="doi">10.1111/2041-210X.12628</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-12">
                <label>12</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Yu</surname>
                            <given-names>G</given-names>
                        </name>
</person-group>:
                    <article-title>tidytree: A Tidy Tool for Phylogenetic Tree Data Manipulation</article-title>.<year>2020</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://mran.microsoft.com/snapshot/2018-07-11/web/packages/tidytree/vignettes/tidytree.html">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-13">
                <label>13</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Wickham</surname>
                            <given-names>H</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Chang</surname>
                            <given-names>W</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Henry</surname>
                            <given-names>L</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics</article-title>.<year>2020</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://ggplot2.tidyverse.org/reference/ggplot2-package.html">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-14">
                <label>14</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Schiffer</surname>
                            <given-names>L</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Azhar</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Shepherd</surname>
                            <given-names>L</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>
                        <italic toggle="yes">HMP16SData</italic>: Efficient Access to the Human Microbiome Project Through Bioconductor.</article-title>
                    <source>

                        <italic toggle="yes">Am J Epidemiol.</italic>
</source>
                    <year>2019</year>;<volume>188</volume>(<issue>6</issue>):<fpage>1023</fpage>&#x2013;<lpage>1026</lpage>.
                    <pub-id pub-id-type="pmid">30649166</pub-id>
                    <pub-id pub-id-type="doi">10.1093/aje/kwz006</pub-id>
                    <pub-id pub-id-type="pmcid">6545282</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-15">
                <label>15</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Wold</surname>
                            <given-names>S</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Esbensen</surname>
                            <given-names>K</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Geladi</surname>
                            <given-names>P</given-names>
                        </name>
</person-group>:
                    <article-title>Principal component analysis.</article-title>
                    <source>

                        <italic toggle="yes">Chemometr Intell Lab.</italic>
</source>
                    <year>1987</year>;<volume>2</volume>(<issue>1&#x2013;3</issue>):<fpage>37</fpage>&#x2013;<lpage>52</lpage>.
                    <pub-id pub-id-type="doi">10.1016/0169-7439(87)80084-9</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-16">
                <label>16</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Van Der Maaten</surname>
                            <given-names>L</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Hinton</surname>
                            <given-names>G</given-names>
                        </name>
</person-group>:
                    <article-title>Visualizing Data using t-SNE.</article-title>
                    <source>

                        <italic toggle="yes">J Mach Learn Res.</italic>
</source>
                    <year>2008</year>;<volume>9</volume>(86):<fpage>2579</fpage>&#x2013;<lpage>2605</lpage>.
                    <ext-link ext-link-type="uri" xlink:href="https://jmlr.org/papers/v9/vandermaaten08a.html">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-17">
                <label>17</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>McInnes</surname>
                            <given-names>L</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Healy</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Melville</surname>
                            <given-names>J</given-names>
                        </name>
</person-group>:
                    <article-title>UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction.</article-title>
                    <source>

                        <italic toggle="yes">arXiv.</italic>
</source>
                    <year>2018</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://arxiv.org/pdf/1802.03426.pdf">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-18">
                <label>18</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>McCarthy</surname>
                            <given-names>DJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Campbell</surname>
                            <given-names>KR</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Lun</surname>
                            <given-names>AT</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Scater: pre-processing, quality control, normalization and visualization of single-cell RNA-seq data in R.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2017</year>;<volume>33</volume>(<issue>8</issue>):<fpage>1179</fpage>&#x2013;<lpage>1186</lpage>.
                    <pub-id pub-id-type="pmid">28088763</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/btw777</pub-id>
                    <pub-id pub-id-type="pmcid">5408845</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-19">
                <label>19</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bodenmiller</surname>
                            <given-names>B</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Zunder</surname>
                            <given-names>ER</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Finck</surname>
                            <given-names>R</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Multiplexed mass cytometry profiling of cellular states perturbed by small-molecule regulators.</article-title>
                    <source>

                        <italic toggle="yes">Nat Biotechnol.</italic>
</source>
                    <year>2012</year>;<volume>30</volume>(<issue>9</issue>):<fpage>858</fpage>&#x2013;<lpage>867</lpage>.
                    <pub-id pub-id-type="pmid">22902532</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nbt.2317</pub-id>
                    <pub-id pub-id-type="pmcid">3627543</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-20">
                <label>20</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Weber</surname>
                            <given-names>LM</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Soneson</surname>
                            <given-names>C</given-names>
                        </name>
</person-group>:
                    <article-title>HDCytoData: Collection of high-dimensional cytometry benchmark datasets in Bioconductor object formats [version 2; peer review: 2 approved].</article-title>
                    <source>

                        <italic toggle="yes">F1000Res.</italic>
</source>
                    <year>2019</year>;<volume>8</volume>:<fpage>1459</fpage>.
                    <pub-id pub-id-type="pmid">31857895</pub-id>
                    <pub-id pub-id-type="doi">10.12688/f1000research.20210.2</pub-id>
                    <pub-id pub-id-type="pmcid">6904983</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-21">
                <label>21</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Weber</surname>
                            <given-names>LM</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Nowicka</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Soneson</surname>
                            <given-names>C</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>diffcyt: Differential discovery in high-dimensional cytometry via high-resolution clustering.</article-title>
                    <source>

                        <italic toggle="yes">Commun Biol.</italic>
</source>
                    <year>2019</year>;<volume>2</volume>:<fpage>183</fpage>.
                    <pub-id pub-id-type="pmid">31098416</pub-id>
                    <pub-id pub-id-type="doi">10.1038/s42003-019-0415-5</pub-id>
                    <pub-id pub-id-type="pmcid">6517415</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-22">
                <label>22</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Van Gassen</surname>
                            <given-names>S</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Callebaut</surname>
                            <given-names>B</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Van Helden</surname>
                            <given-names>MJ</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>FlowSOM: Using self-organizing maps for visualization and interpretation of cytometry data.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry A.</italic>
</source>
                    <year>2015</year>;<volume>87</volume>(<issue>7</issue>):<fpage>636</fpage>&#x2013;<lpage>645</lpage>.
                    <pub-id pub-id-type="pmid">25573116</pub-id>
                    <pub-id pub-id-type="doi">10.1002/cyto.a.22625</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-23">
                <label>23</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Huang</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Soneson</surname>
                            <given-names>C</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Ernst</surname>
                            <given-names>F</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>&#xfb01;onarhuang/TreeSummarizedExperiment: v1.4.8 TreeSummarizedExperiment (Version v1.4.8).</article-title>
                    <source>

                        <italic toggle="yes">Zenodo.</italic>
</source>
                    <year>2020</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.5281/zenodo.4046096">http://www.doi.org/10.5281/zenodo.4046096</ext-link>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report80502">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.54474.r80502</article-id>
            <title-group>
                <article-title>Reviewer response for version 2</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Ghazanfar</surname>
                        <given-names>Shila</given-names>
                    </name>
                    <xref ref-type="aff" rid="r80502a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-7861-6997</uri>
                </contrib>
                <aff id="r80502a1">
                    <label>1</label>Cancer Research UK Cambridge Institute, Li Ka Shing Centre, University of Cambridge, Cambridge, UK</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>19</day>
                <month>3</month>
                <year>2021</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2021 Ghazanfar S</copyright-statement>
                <copyright-year>2021</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport80502" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.26669.2"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The authors have done an excellent job in addressing each of my questions and implementing feature suggestions where appropriate.</p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>statistics, high throughput genomics data analysis, single cell genomics analysis, spatial gene expression analysis</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report80503">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.54474.r80503</article-id>
            <title-group>
                <article-title>Reviewer response for version 2</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Lahti</surname>
                        <given-names>Leo</given-names>
                    </name>
                    <xref ref-type="aff" rid="r80503a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-5537-637X</uri>
                </contrib>
                <aff id="r80503a1">
                    <label>1</label>Department of Computing, Faculty of Technology, University of Turku, Turku, Finland</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>Since I reviewed this article in October 2020, I have started collaboration with the authors of this manuscript. This had not influenced my original review, and I think the feedback in that original review has been adequately addressed now.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>2</day>
                <month>3</month>
                <year>2021</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2021 Lahti L</copyright-statement>
                <copyright-year>2021</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport80503" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.26669.2"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>Approved.</p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>Bioinformatics, open research software, R/Bioconductor, microbiome research, statistical machine learning</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report73185">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.29440.r73185</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Ritchie</surname>
                        <given-names>Matthew</given-names>
                    </name>
                    <xref ref-type="aff" rid="r73185a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-7383-0609</uri>
                </contrib>
                <aff id="r73185a1">
                    <label>1</label>The Walter and Eliza Hall Institute of Medical Research, Parkville, Vic, Australia</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>23</day>
                <month>11</month>
                <year>2020</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Ritchie M</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport73185" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.26669.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>Huang 
                <italic>et al</italic>. describe the TreeSummarizedExperiment package, which provides well-designed S4 infrastructure that couples the phylo and SingleCellExperiment classes to create a container for high-throughput data that can be organised in a tree-like structure.&#x00a0;</p>
            <p> </p>
            <p> The article is structured like a vignette, providing an overview of the class (Figure 1) and stepping the reader through the process of setting up a TreeSummarizedExperiment object and accessing and assigning data to its various slots, firstly for a toy data set and then for data from the Human Microbiome Project.</p>
            <p> </p>
            <p> The article is very clearly written, and the authors demonstrate the ability to use TreeSummarizedExperiment objects in conjunction with other established software for dealing with trees (e.g. ggtree and tidyTree) or dimensionality reduction of high-throughout data (e.g. scater). One topic that I was interested to read more about was its potential use in a single cell RNA-seq analysis. Perhaps use cases for such applications can be added as future work. The TreeSummarizedExperiment package has been available from Bioconductor since May 2019 and it has been downloaded &gt; 2.4K times, which indicates it is being taken up by the community. &#x00a0;</p>
            <p> </p>
            <p> Minor issues: 
                <list list-type="bullet">
                    <list-item>
                        <p>Affiliation 5: missing 'O' in 'Oxford'.</p>
                    </list-item>
                    <list-item>
                        <p>'Functions operating on the phylo object.' section, sentence 2, missing word: 'such as ape [and] tidytree.'</p>
                    </list-item>
                </list>
            </p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>Transcriptomics (bulk and single cell)</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <sub-article article-type="response" id="comment6408-73185">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Huang</surname>
                            <given-names>Ruizhu</given-names>
                        </name>
                        <aff>University of Z&#x00fc;rich, Switzerland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>2</day>
                    <month>3</month>
                    <year>2021</year>
                </pub-date>
            </front-stub>
            <body>
                <p>
                    <list list-type="order">
                        <list-item>
                            <p>
                                <underline>
                                    <bold>Affiliation 5: missing 'O' in 'Oxford'.</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> Thank you. &#x00a0;The typo is fixed.</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>'Functions operating on the phylo object.' section, sentence 2, missing word: 'such as ape [and] tidytree.'</bold>
                                </underline>
                            </p>
                        </list-item>
                    </list> 
                    <bold>&#x00a0; &#x00a0; &#x00a0; &#x00a0; &#x00a0; </bold>The missing word is added now.</p>
            </body>
        </sub-article>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report73184">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.29440.r73184</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Ghazanfar</surname>
                        <given-names>Shila</given-names>
                    </name>
                    <xref ref-type="aff" rid="r73184a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-7861-6997</uri>
                </contrib>
                <aff id="r73184a1">
                    <label>1</label>Cancer Research UK Cambridge Institute, Li Ka Shing Centre, University of Cambridge, Cambridge, UK</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>12</day>
                <month>11</month>
                <year>2020</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Ghazanfar S</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport73184" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.26669.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve-with-reservations</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>Huang and colleagues have written a software article presenting TreeSummarizedExperiment [currently version 1.6.0], a Bioconductor package aimed at providing an S4 class for omics data with hierarchical tree structure. The TreeSummarizedExperiment class builds on the popular SingleCellExperiment object class, with additional slots in which hierarchical structure, in the form of phylo objects, can be added for features (rows) and observations (columns). In addition to the object class, the package contains several functions for manipulating these objects, ranging from getting/setting/resetting the tree slots, aggregating across rows and/or columns, and various analytical tasks operating on the phylo objects.</p>
            <p> </p>
            <p> The article is well written with clear motivation and description of the package, and addresses an important problem of performing analysis of high dimensional hierarchically structured data using object-oriented programming. I have a few further comments and questions that may improve the breadth of use of TreeSummarizedExperiment by the research community.&#x00a0; 
                <list list-type="bullet">
                    <list-item>
                        <p>Is there a way to simply include an argument for aggValue() that would swap the order to columns first and rows second, rather than requiring the user to perform two distinct operations?</p>
                    </list-item>
                    <list-item>
                        <p>The new slots, rowTree, colTree, rowLinks and colLinks are 'getter' accessors but not currently 'setter' functions. I can imagine a popular use-case among users with an already constructed object of class SummarizedExperiment or SingleCellExperiment would be to simply use as(, "TreeSummarizedExperiment") and then attempt to add the additional slots, for example as the output of hclust(). I would suggest prioritising converting these functions to both 'getter' and 'setter', or perhaps adding a constructor usage for TreeSummarizedExperiment for objects that are already SummarizedExperiment or SingleCellExperiment, if possible.</p>
                    </list-item>
                    <list-item>
                        <p>I'm interested in how TreeSummarizedExperiment would work in the case where the hierarchical structure is not a typical single tree, but comprising of multiple distinct tree structures. An example of such is single cell (or single clone) lineage data where there exists a tree structure within each experimental condition, but not between cells from different conditions. Would the colTree slot correspond to a list of trees in this case?</p>
                    </list-item>
                    <list-item>
                        <p>How would one go about combining different TreeSummarizedExperiment objects? Do the typical cbind() and rbind() operations have meaning here? In which cases are they not to be used?</p>
                    </list-item>
                    <list-item>
                        <p>I would be interested in getting to a clustered heatmap as an example of visualisation for the TreeSummarizedExperiment, either implemented using ggplot2/ggtree, or other packages like ComplexHeatmap?</p>
                    </list-item>
                    <list-item>
                        <p>How would the tree structure information storage scale in terms of the number of rows and columns, or in the hierarchical structures?</p>
                    </list-item>
                </list> Minor/cosmetic 
                <list list-type="bullet">
                    <list-item>
                        <p>typo in affiliation 5.</p>
                    </list-item>
                    <list-item>
                        <p>legend cut off in Figures 6, 7, and 8.</p>
                    </list-item>
                </list>
            </p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>statistics, high throughput genomics data analysis, single cell genomics analysis, spatial gene expression analysis</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.</p>
        </body>
        <sub-article article-type="response" id="comment6410-73184">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Huang</surname>
                            <given-names>Ruizhu</given-names>
                        </name>
                        <aff>University of Z&#x00fc;rich, Switzerland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>2</day>
                    <month>3</month>
                    <year>2021</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Thank you for your comments! 
                    <list list-type="order">
                        <list-item>
                            <p>
                                <underline>
                                    <bold>swap the order to columns first and rows second, rather than requiring the user to perform two distinct operations?</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> aggValue() is now deprecated and replaced by a new function, aggTSE(), that allows users to swap the order of aggregation and define different functions for the row and the column dimension.</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>The new slots, rowTree, colTree, rowLinks and colLinks are 'getter' accessors but not currently 'setter' functions. I can imagine a popular use-case among users with an already constructed object of class SummarizedExperiment or SingleCellExperiment would be to simply use as(, "TreeSummarizedExperiment") and then attempt to add the additional slots, for example as the output of hclust(). I would suggest prioritising converting these functions to both 'getter' and 'setter', or perhaps adding a constructor usage for TreeSummarizedExperiment for objects that are already SummarizedExperiment or SingleCellExperiment, if possible.</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> rowTree and colTree are now both setters and getters. When the row/column tree is replaced, the rowLinks/colLinks is updated automatically. To avoid breaking links between assays and trees, we don't recommend users to modify the rowLinks/colLinks data. Therefore, rowLinks/colLinks are still kept as getters.</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>I'm interested in how TreeSummarizedExperiment would work in the case where the hierarchical structure is not a typical single tree, but comprising of multiple distinct tree structures. An example of such is single cell (or single clone) lineage data where there exists a tree structure within each experimental condition, but not between cells from different conditions. Would the colTree slot correspond to a list of trees in this case?</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> Yes, it's possible to have a list of trees in the rowTree/colTree. In the rowLinks/colLinks, we have added a new column (whichTree) to give information about which row/column tree a row/column is mapped to. We have also added a new vignette describing how to combine multiple TSEs. (
                                <ext-link ext-link-type="uri" xlink:href="https://www.bioconductor.org/packages/devel/bioc/vignettes/TreeSummarizedExperiment/inst/doc/The_combination_of_multiple_TSEs.html">https://www.bioconductor.org/packages/devel/bioc/vignettes/TreeSummarizedExperiment/inst/doc/The_combination_of_multiple_TSEs.html</ext-link>)</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>How would one go about combining different TreeSummarizedExperiment objects? Do the typical cbind() and rbind() operations have meaning here? In which cases are they not to be used?</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> rbind() and cbind() are now implemented for TreeSummarizedExperiment objects. To rbind() multiple TSEs successfully, it's required that the TSEs agree in the column dimension to have the same colTree() and colLinks(). Similarly, cbind() would require TSEs to have the same rowTree() and rowLinks(). More detailed information is available in the new vignette about combining multiple TSEs. (
                                <ext-link ext-link-type="uri" xlink:href="https://www.bioconductor.org/packages/devel/bioc/vignettes/TreeSummarizedExperiment/inst/doc/The_combination_of_multiple_TSEs.html">https://www.bioconductor.org/packages/devel/bioc/vignettes/TreeSummarizedExperiment/inst/doc/The_combination_of_multiple_TSEs.html</ext-link>)</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>I would be interested in getting to a clustered heatmap as an example of visualisation for the TreeSummarizedExperiment, either implemented using ggplot2/ggtree, or other packages like ComplexHeatmap?</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> We have added a new use case of TSE on CyTOF data, and customized a visualization function based on 
                                <italic>ggtree, ggplot2</italic> and 
                                <italic>ggnewscale</italic> to plot a clustered heatmap.</p>
                        </list-item>
                        <list-item>
                            <p>
                                <bold>
                                    <underline>How would the tree structure information storage scale in terms of the number of rows and columns, or in the hierarchical structures.</underline>
                                </bold>
                            </p>
                            <p> </p>
                            <p> We store the tree structure as a phylo object. The size of a phylo object is quite small even for a tree with 10
                                <sup>6</sup> leaves (about 90 Mb). To set up the link between rows/columns to a tree, it takes only a few seconds even for 10
                                <sup>6</sup>&#x00a0;rows&#x00a0;to a tree with 10
                                <sup>6</sup> leaves.</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>typo in affiliation 5. legend cut off in Figures 6, 7, and 8.</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> The typo and the legend cut off are fixed.</p>
                        </list-item>
                    </list>
                </p>
            </body>
        </sub-article>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report73188">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.29440.r73188</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Lahti</surname>
                        <given-names>Leo</given-names>
                    </name>
                    <xref ref-type="aff" rid="r73188a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-5537-637X</uri>
                </contrib>
                <aff id="r73188a1">
                    <label>1</label>Department of Computing, Faculty of Technology, University of Turku, Turku, Finland</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>I recently discussed possible further extensions with the authors of this work. The discussion was based on my own initiative as I am working on related topics, and at that time I did not know that they had (already) submitted this manuscript for review. I do not know the authors, and we have no ongoing collaboration.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>19</day>
                <month>10</month>
                <year>2020</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Lahti L</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport73188" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.26669.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>This software article introduces TreeSummarizedExperiment, a S4 class for hierarchically structured data in R. This provides a very generic data structure that serves for instance the single cell and microbiome bioinformatics communities, and has already gathered remarkable attention with a growing user base. The package is mature and has been available via Bioconductor for some time already.</p>
            <p> </p>
            <p> The rationale for developing the new software tool has been clearly explained, and sufficient examples are provided. It extends the popular SingleCellExperiment class structure by bringing in tree info on data rows and cols (based on the phylo class). The new extended class has potentially many new applications, for instance in microbiome research; concrete examples are provided. The new class combines and extends other common class structures, which is very beneficial for the overall compatibility. Many tools for manipulation and use already exist based for instance on related work on the SummarizedExperiment family of classes, phylo tree structure, and the phyloseq class.</p>
            <p> </p>
            <p> The overall description of the software is technically sound and follows standard conventions in the R/Bioconducor community. Sufficient details have been provided to allow replication of the software development and its use by others; the documentation and examples are sufficient for getting started with and interpreting outputs of the new class for anyone who has the technical skills that are needed to utilize this work.</p>
            <p> </p>
            <p> 
                <underline>
                    <bold>Major</bold>
                </underline> 
                <list list-type="order">
                    <list-item>
                        <p>Efficiency of the new method could be discussed further; does this&#x00a0; scale up to population level cohorts that have thousands of samples are increasing hierarchical resolutions?</p>
                    </list-item>
                    <list-item>
                        <p>How easy it would be to incorporate further supporting information on the rows and columns, for instance on DNA/RNA sequence information?</p>
                    </list-item>
                    <list-item>
                        <p>The class is very generic; is the idea that this package can be used as such in (hierarchical) single-cell experiments, microbiome research, and potentially other fields that have little overlap currently? Or is this package meant to be a fundamental structure that can be further extended in more specific application domains? Some more discussion on these aspects could help to contextualize the new class.</p>
                    </list-item>
                </list> 
                <underline>
                    <bold>Minor</bold>
                </underline> 
                <list list-type="order">
                    <list-item>
                        <p>" ssay_data" -&gt; "assay_data"</p>
                    </list-item>
                </list>
            </p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>Bioinformatics, open research software, R/Bioconductor, microbiome research, statistical machine learning</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <sub-article article-type="response" id="comment6409-73188">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Huang</surname>
                            <given-names>Ruizhu</given-names>
                        </name>
                        <aff>University of Z&#x00fc;rich, Switzerland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>2</day>
                    <month>3</month>
                    <year>2021</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Thank you for reviewing our work. 
                    <list list-type="order">
                        <list-item>
                            <p>
                                <underline>
                                    <bold>Efficiency of the new method could be discussed further; does this&#x00a0; scale up to population level cohorts that have thousands of samples are increasing hierarchical resolutions?</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> TreeSummarizedExperiment (TSE) inherits the slots of the SummarizedExperiment (SE) &amp; SingleCellExperiment (SCE) classes, and adds new slots like rowTree, colTree, rowLinks, colLinks, referenceSeq. For operations involving the inherited slots, TSE works similarly as SE and SCE. For the new slots, the data manipulation depends on the functions that users have applied on the tree object (of class phylo). These functions might be from TSE or outside TSE. For functions from TSE, either those working on the phylo tree (e.g., findDescendant, convertNode, matTree, addLabel) or those working on TSE (e.g., rowTree, colTree, rowLinks, colLinks, changeTree), takes only seconds even for a tree with up to 100,000 nodes.&#x00a0;</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>How easy it would be to incorporate further supporting information on the rows and columns, for instance on DNA/RNA sequence information?</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> TSE now has a slot referenceSeq to store the sequence information of features ( rows).</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>The class is very generic; is the idea that this package can be used as such in (hierarchical) single-cell experiments, microbiome research, and potentially other fields that have little overlap currently? Or is this package meant to be a fundamental structure that can be further extended in more specific application domains? Some more discussion on these aspects could help to contextualize the new class.</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> Currently, there is not much overlap in the community across fields, e.g, single-cell experiments, microbiome research. But, we do see that they share similarities in data structures, and can potentially share synergies in data visualization or analysis. We provide TSE as a standalone R package like SummarizedExperiment and SingleCellExperiment, and propose it as a convenient starting point to create R packages for downstream analysis or visualization of data with tree structures. We are open to update our work or receive pull requests if new features (or slots) required in a specific field are feasible to be integrated to TreeSummarizedExperiment. &#x00a0; For example, a new optional slot referenceSeq(), which was requested mainly for microbiome data to store RNA/DNA sequencing information, has been developed by F&#x00e9;lix G.M. Ernst,&#x00a0; and the PR has been accepted in TreeSummarizedExperiment.&#x00a0;</p>
                        </list-item>
                        <list-item>
                            <p>
                                <underline>
                                    <bold>" ssay_data" -&gt; "assay_data"</bold>
                                </underline>
                            </p>
                            <p> </p>
                            <p> The typo is fixed.</p>
                        </list-item>
                    </list>
                </p>
            </body>
        </sub-article>
    </sub-article>
</article>
