<?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="methods-article" 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.11622.3</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Method Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                    <subj-group>
                        <subject>Bioinformatics</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Biomacromolecule-Ligand Interactions</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Cell Signaling</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Cell Signaling &amp; Trafficking Structures</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Chemical Biology of the Cell</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Membranes &amp; Sorting</subject>
                    </subj-group>
                    <subj-group>
                        <subject>Nuclear Structure &amp; Function</subject>
                    </subj-group>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>CyTOF workflow: differential discovery in high-throughput high-dimensional cytometry datasets</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 3; peer review: 2 approved]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Nowicka</surname>
                        <given-names>Malgorzata</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Visualization</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>
                    <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>Krieg</surname>
                        <given-names>Carsten</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a3">3</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Crowell</surname>
                        <given-names>Helena L.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Visualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-4801-1767</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>Weber</surname>
                        <given-names>Lukas M.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Visualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-3282-1730</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>Hartmann</surname>
                        <given-names>Felix J.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-4174-2276</uri>
                    <xref ref-type="aff" rid="a3">3</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Guglietta</surname>
                        <given-names>Silvia</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <xref ref-type="aff" rid="a4">4</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Becher</surname>
                        <given-names>Burkhard</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <xref ref-type="aff" rid="a3">3</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Levesque</surname>
                        <given-names>Mitchell P.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Resources</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a5">5</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/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Project Administration</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Visualization</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>Institute for Molecular Life Sciences, University of Zurich, Zurich, 8057, Switzerland</aff>
                <aff id="a2">
                    <label>2</label>SIB Swiss Institute of Bioinformatics, University of Zurich, Zurich, 8057, Switzerland</aff>
                <aff id="a3">
                    <label>3</label>Institute of Experimental Immunology, University of Zurich, Zurich, 8057, Switzerland</aff>
                <aff id="a4">
                    <label>4</label>Department of Experimental Oncology, European Institute of Oncology, Via Adamello 16, Milan, I-20139, Italy</aff>
                <aff id="a5">
                    <label>5</label>Department of Dermatology, University Hospital Zurich, Zurich, CH-8091, Switzerland</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="con">
                    <p>MN and MDR designed methodology and designed and ran analyses. MN drafted the manuscript with input from MDR. HLC implemented code and contributed to drafting. CK and SG performed experiments, analyzed data and gave feedback on clinical applications. CK performed the cluster merging. LMW implemented code, contributed ideas for analyses, and contributed to drafting. FJH contributed code and ideas for analyses. MPL interpreted data and provided clinical perspective. BB gave feedback on the manuscript and the bioinformatics. All authors read and approved the final manuscript and have agreed to the content.</p>
                </fn>
                <fn fn-type="conflict">
                    <p>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>24</day>
                <month>5</month>
                <year>2019</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2017</year>
            </pub-date>
            <volume>6</volume>
            <elocation-id>748</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>15</day>
                    <month>4</month>
                    <year>2019</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2019 Nowicka M et al.</copyright-statement>
                <copyright-year>2019</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/6-748/pdf"/>
            <abstract>
                <p>High-dimensional mass and flow cytometry (HDCyto) experiments have become a method of choice for high-throughput interrogation and characterization of cell populations. Here, we present an updated R-based pipeline for differential analyses of HDCyto data, largely based on Bioconductor packages. We computationally define cell populations using FlowSOM clustering, and facilitate an optional but reproducible strategy for manual merging of algorithm-generated clusters. Our workflow offers different analysis paths, including association of cell type abundance with a phenotype or changes in signaling markers within specific subpopulations, or differential analyses of aggregated signals. Importantly, the differential analyses we show are based on regression frameworks where the HDCyto data is the response; thus, we are able to model arbitrary experimental designs, such as those with batch effects, paired designs and so on. In particular, we apply generalized linear mixed models or linear mixed models to analyses of cell population abundance or cell-population-specific analyses of signaling markers, allowing overdispersion in cell count or aggregated signals across samples to be appropriately modeled. To support the formal statistical analyses, we encourage exploratory data analysis at every step, including quality control (e.g., multi-dimensional scaling plots), reporting of clustering results (dimensionality reduction, heatmaps with dendrograms) and differential analyses (e.g., plots of aggregated signals).</p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>CyTOF</kwd>
                <kwd>flow cytometry</kwd>
                <kwd>differential analysis</kwd>
            </kwd-group>
            <funding-group>
                <award-group id="fund-1">
                    <funding-source>Swiss National Science Foundation</funding-source>
                    <award-id>310030_175841</award-id>
                </award-group>
                <award-group id="fund-2">
                    <funding-source>University of Zurich</funding-source>
                    <award-id>FK-17-100</award-id>
                </award-group>
                <award-group id="fund-3">
                    <funding-source>Swiss Institute of Bioinformatics</funding-source>
                </award-group>
                <funding-statement>MN acknowledges funding from a Swiss Institute of Bioinformatics (SIB) Fellowship. LMW was supported by a Forschungskredit (Candoc) grant from the University of Zurich (FK-17-100). MDR acknowledges support from the University Research Priority Program Evolution in Action at the University of Zurich and from the Swiss National Science Foundation (310030_175841).</funding-statement>
                <funding-statement>
                    <italic>The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</italic>
                </funding-statement>
            </funding-group>
        </article-meta>
        <notes>
            <sec sec-type="version-changes">
                <label>Revised</label>
                <title>Amendments from Version 2</title>
                <p>This update provides a simplified and more flexible version of our workflow. We have implemented the set of data visualizations proposed in the previous version in the CATALYST package. To facilitate exploration of the data, different clustering resolutions, and differential testing results, all data used throughout differential analysis (measurement data, experiment metadata, and panel) are now organized in a single daFrame object. &#x00a0; The workflow now leverages the diffcyt package for differential testing, which provides an easier user interface, as well as additional choices for testing. The CATALYST and diffcyt packages are fully compatible. In addition, dimension reduction plots have been updated to use the UMAP algorithm (t-SNE and other methods are also available). &#x00a0; We have added and updated a number of references, and significantly shortened the comparison of manual and algorithmic cluster merging (sections &#x201c;Reducing the number of clusters in ConsensusClusterPlus&#x201d; and &#x201c;Comparison of automated and manual merging&#x201d;). Otherwise, there are relatively minor changes to the text. &#x00a0; Helena L. Crowell has been added as an author for implementing software in the CATALYST package and revising the article text for the new version. &#x00a0; Additional funding from the&#x00a0;University of Zurich and the&#x00a0;Swiss National Science Foundation has been listed in the Grant information section.</p>
            </sec>
        </notes>
    </front>
    <body>
        <sec sec-type="intro">
            <title>Introduction</title>
            <p>Flow cytometry and the more recently introduced CyTOF (cytometry by time-of-flight mass spectrometry or mass cytometry) are high-throughput technologies that measure protein abundance on the surface or within cells. In flow cytometry, antibodies are labeled with fluorescent dyes and fluorescence intensity is measured using lasers and photodetectors. CyTOF utilizes antibodies tagged with metal isotopes from the lanthanide series, which have favorable chemistry and do not occur in biological systems; abundances per cell are recorded with a time-of-flight mass spectrometer. In either case, fluorescence intensities (flow cytometry) or ion counts (mass cytometry) are assumed to be proportional to the expression level of the antibody-targeted antigens of interest.</p>
            <p>Due to the differences in acquisition, further distinct characteristics should be noted. Conventional fluorophore-based flow cytometry is non-destructive and can be used to sort cells for further analysis. However, because of the spectral overlap between fluorophores, 
                <italic toggle="yes">compensation</italic> of the data needs to be performed
                <sup>
                    <xref ref-type="bibr" rid="ref-1">1</xref>
                </sup>, which also limits the number of parameters that can be measured simultaneously. Thus, standard flow cytometry experiments measure 6&#x2013;12 parameters with modern systems measuring up to 20 channels
                <sup>
                    <xref ref-type="bibr" rid="ref-2">2</xref>
                </sup>, while new developments (e.g., BD FACSymphony) promise to increase this capacity towards 50. Moreover, flow cytometry offers the highest throughput with tens of thousands of cells measured per second at relatively low operating costs per sample.</p>
            <p>By using rare metal isotopes in CyTOF, cell autofluorescence can be avoided and spectral overlap is drastically reduced. However, the sensitivity of mass spectrometry results in the measurement of metal impurities and oxide formations, which need to be carefully considered in antibody panel design (e.g., through antibody concentrations and coupling of antibodies to neighboring metals). Leipold 
                <italic toggle="yes">et al.</italic> recently commented that 
                <italic toggle="yes">minimal spillover does not equal no spillover</italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-3">3</xref>
                </sup>. Nonetheless, CyTOF offers a high dimension of parameters measured per cell, with current panels using ~40 parameters and the promise of up to 100. Throughput of CyTOF is lower, at the rate of hundreds of cells per second, and cells are destroyed during ionization.</p>
            <p>The ability of flow cytometry and mass cytometry to analyze individual cells at high-throughput scales has resulted in a wide range of biological and medical applications. For example, immunophenotyping assays are used to detect and quantify cell populations of interest, to uncover new cell populations and compare abundance of cell populations between different conditions, for example between patient groups
                <sup>
                    <xref ref-type="bibr" rid="ref-4">4</xref>
                </sup>. Thus, it can be used as a biomarker discovery tool.</p>
            <p>Various methodological approaches aim for biomarker discovery
                <sup>
                    <xref ref-type="bibr" rid="ref-5">5</xref>
                </sup>. A common strategy, which we will refer to throughout this workflow as the &#x201c;classic&#x201d; approach, is to first identify cell populations of interest by manual gating or automated clustering
                <sup>
                    <xref ref-type="bibr" rid="ref-6">6</xref>,
                    <xref ref-type="bibr" rid="ref-7">7</xref>
                </sup>. Second, using statistical tests, one can determine which of the cell subpopulations or protein markers are associated with a phenotype (e.g., clinical outcome) of interest. Typically, cell subpopulation abundance expressed as cluster cell counts or median marker expression would be used in the statistical model to relate to the sample-level phenotype.</p>
            <p>Importantly, there are many alternatives to what we propose below, and several methods have emerged. For instance, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>
                </sup> tackles the differential discovery problem by strong over-clustering of the cells, and by building a hierarchy of clusters from very specific to general ones. Using model selection and regularization techniques, clusters and markers that associate with the outcome are identified. A further machine learning approach, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/eiriniar/CellCnn">CellCnn</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-9">9</xref>
                </sup>, learns the representation of clusters that are associated with the considered phenotype by means of convolutional neural networks, which makes it particularly applicable to detecting discriminating rare cell populations. Another approach, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/cydar.html">cydar</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-10">10</xref>
                </sup> performs differential abundance analysis on &#x201c;hypersphere&#x201d; counts, where hyperspheres are defined using all markers, and calculates differential tests using the the generalized linear modeling capabilities of 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/edgeR.html">edgeR</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-11">11</xref>
                </sup>.</p>
            <p>However, there are tradeoffs to consider. 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> performs feature selection but does not provide significance levels, such as p-values, for the strength of associations. Due to its computational requirements, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> cannot be run on entire mass cytometry datasets and one typically must analyze a subset of the data. The &#x201c;filters&#x201d; from 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/eiriniar/CellCnn">CellCnn</ext-link>
                </italic> may identify one or more cell subsets that distinguish experimental groups, while these groups may not necessarily correspond to any of the canonical cell types, since they are learned with a data-driven approach. Since the hyperspheres from 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/cydar.html">cydar</ext-link>
                </italic> are defined using all markers, interpretation of differential expression of specific markers (e.g., functional markers) within cell populations is difficult.</p>
            <p>A noticeable distinction between the machine-learning approaches and our classical regression approach is the configuration of the model. 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/eiriniar/CellCnn">CellCnn</ext-link>
                </italic> model the patient response as a function of the measured HDCyto values, whereas the classical approach models the HDCyto data itself as the response, thus putting the distributional assumptions on the experimental HDCyto data. This carries the distinct advantage that covariates (e.g., age, gender, batch) can be included, together with finding associations of the phenotype to the predictors of interest (e.g., cell type abundance). Specifically, neither 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> nor 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/eiriniar/CellCnn">CellCnn</ext-link>
                </italic> are able to directly account for covariates, such as paired experiments or presence of batches. Another recent approach, mixed-effects association testing for single cells (
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/immunogenomics/MASC">MASC</ext-link>
                </italic>) uses the same &#x201c;reverse&#x201d; association approach that we illustrate below
                <sup>
                    <xref ref-type="bibr" rid="ref-12">12</xref>
                </sup>. Recently, we have formalized and compared various regression approaches, resulting in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-13">13</xref>
                </sup>.</p>
            <p>Within the classical approach, hybrid methods are certainly possible, where discovery of interesting cell populations is done with one algorithm, and quantifications or signal aggregations are modeled in standard regression frameworks. For instance, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/eiriniar/CellCnn">CellCnn</ext-link>
                </italic> provides p-values from a t-test or Mann-Whitney U-test conducted on the frequencies of previously detected cell populations. Some caution is warranted here, in terms of using data twice &#x2013; so-called double dipping or circular analysis &#x2013; and making claims about the statistical evidence of a change in abundance where initial analyses of the same data were used to discover subpopulations. This topic has been discussed with respect to clustering other types of single cell data and then inferring the markers of such populations
                <sup>
                    <xref ref-type="bibr" rid="ref-14">14</xref>
                </sup>; however, it is less clear how much clustering affects cross-sample inferences.</p>
            <p>Step by step, this workflow presents differential discovery analyses assembled from a suite of tools and methods that, in our view, lead to a higher level of flexibility and robust, statistically-supported and interpretable results. Cell population identification is conducted by means of unsupervised clustering using the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                </italic> packages, which together were among the best performing clustering approaches for high-dimensional cytometry data
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>. Notably, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                </italic> scales easily to millions of cells and thus no subsetting of the data is required.</p>
            <p>To be able to analyze arbitrary experimental designs (e.g., batch effects, paired experiments, etc.), we show how to conduct differential analysis of cell population abundances using generalized linear mixed models (GLMM) and of marker intensities using linear models (LM) and linear mixed models (LMM).  For  both differential abundance and expression analysis, we use methods implemented in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-13">13</xref>
                </sup>. Internally, model fitting is performed with packages 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/web/packages/lme4/index.html">lme4</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://stat.ethz.ch/R-manual/R-patched/library/stats/html/00Index.html">stats</ext-link>
                </italic>, and hypothesis testing with the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/web/packages/multcomp/index.html">multcomp</ext-link>
                </italic> package.</p>
            <p>For visualization, we use new plotting functions from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                </italic> package that employ 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/web/packages/ggplot2/index.html">ggplot2</ext-link>
                </italic> as their graphical engine. Notably, 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                </italic> delivers a suite of useful visual representations of HDCyto data characteristics, such as an MDS (multidimensional scaling) plot of aggregated signal for exploring sample similarities. The obtained cell populations are visualized using dimension reduction techniques (e.g., UMAP via the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/web/packages/umap/index.html">umap</ext-link>
                </italic> package) and heatmaps (via the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ComplexHeatmap.html">ComplexHeatmap</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-16">16</xref>
                </sup>) to represent characteristics of the annotated cell populations and identified biomarkers. (Note that an alternative R implementation of the UMAP algorithm with additional functionality is also available in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/jlmelville/uwot">uwot</ext-link>
                </italic> package.)</p>
            <p>The workflow is intentionally not fully automatic. First, we strongly advocate for exploratory data analysis to get an understanding of data characteristics before formal statistical modeling. Second, the workflow involves an optional step where the user can manually merge and annotate clusters (see 
                <xref ref-type="other" rid="S6">Cluster merging and annotation section</xref>) but in a way that is easily reproducible. The CyTOF data used here (see 
                <xref ref-type="other" rid="S2">Data description section</xref>) is already preprocessed; i.e., the normalization and de-barcoding, as well as removal of doublets, debris and dead cells, were already performed; further details are available in the 
                <xref ref-type="other" rid="S11">Data preprocessing</xref> section.</p>
            <p>Notably, this workflow is equally applicable to flow or mass cytometry datasets, for which the preprocessing steps have already been performed. In addition, the workflow is modular and can be adapted as new algorithms or new knowledge about how to best use existing tools comes to light. Alternative clustering algorithms such as the popular PhenoGraph algorithm
                <sup>
                    <xref ref-type="bibr" rid="ref-17">17</xref>
                </sup> (e.g., via the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/JinmiaoChenLab/Rphenograph">Rphenograph</ext-link>
                </italic> package), dimensionality reduction techniques, such as diffusion maps
                <sup>
                    <xref ref-type="bibr" rid="ref-18">18</xref>
                </sup> via the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/destiny.html">destiny</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-19">19</xref>
                </sup>, t-SNE via the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/web/packages/Rtsne/index.html">Rtsne</ext-link>
                </italic> and SIMLR
                <sup>
                    <xref ref-type="bibr" rid="ref-20">20</xref>
                </sup> via the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/SIMLR.html">SIMLR</ext-link>
                </italic> package could be inserted into the workflow.</p>
            <p>
                <bold>
                    <italic toggle="yes">Note:</italic>
                </bold> 
                <italic toggle="yes">To cite this workflow, please refer to this F1000 article 
                    <ext-link ext-link-type="uri" xlink:href="https://f1000research.com/articles/6-748">https://f1000research.com/articles/6-748</ext-link>
                </italic>.</p>
        </sec>
        <sec>
            <title>Reproducibility</title>
            <p>To generate reproducible results, we set random seeds in several steps of the workflow. However, the default methods for random number generation in R were updated in R version 3.6.0 (released in April 2019; see 
                <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/doc/manuals/r-devel/NEWS.html">R News</ext-link>  for details). Therefore, for consistency with earlier versions of the workflow, we use the function 
                <monospace>RNGversion()</monospace> to use the random number generation methods from the previous version of R. Note that this step is not required when running a standard analysis on a new dataset; it is included here for reproducibility and backward compatibility only.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">RNGversion</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(</styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"3.5.3"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>
                </preformat>
            </p>
        </sec>
        <sec>
            <title>Data description</title>
            <p id="S2">We use a subset of CyTOF data originating from Bodenmiller 
                <italic toggle="yes">et al.</italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-21">21</xref>
                </sup> that was also used in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> paper
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>
                </sup>. In the original study, peripheral blood mononuclear cells (PBMCs) in unstimulated and after 11 different stimulation conditions were measured for 8 healthy donors. For each sample, expression of 10 cell surface markers and 14 signaling markers was recorded. We perform our analysis on samples from the reference and one stimulated condition where cells were crosslinked for 30 minutes with B cell receptor/Fc receptor known as BCR/FcR-XL, resulting in 16 samples in total (8 patients, unstimulated and stimulated for each).</p>
            <p>The original data is available from the 
                <ext-link ext-link-type="uri" xlink:href="http://reports.cytobank.org/105/v2">Cytobank report</ext-link>. The subset used here can be downloaded from the 
                <ext-link ext-link-type="uri" xlink:href="https://community.cytobank.org/cytobank/experiments/15713/">Citrus Cytobank repository</ext-link> (files with 
                <monospace>_BCR-XL.fcs</monospace> or 
                <monospace>_Reference.fcs</monospace> endings) or from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/data/experiment/html/HDCytoData.html">HDCytoData</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-13">13</xref>
                </sup> package via 
                <monospace>Bodenmiller_BCR_XL_flowSet()</monospace> (see 
                <xref ref-type="other" rid="S3">Data import</xref> section).</p>
            <p>In both the Bodenmiller 
                <italic toggle="yes">et al.</italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> manuscripts, the 10 lineage markers were used to identify cell subpopulations. These were then investigated for differences between reference and stimulated cell subpopulations separately for each of the 14 functional markers. The same strategy is used in this workflow; 10 lineage markers are used for cell clustering and 14 functional markers are tested for differential expression between the reference and BCR/FcR-XL stimulation. Even though differential analysis of cell abundance was not in the scope of the Bodenmiller 
                <italic toggle="yes">et al.</italic> experiment, we present it here to highlight the generality of the discovery.</p>
        </sec>
        <sec>
            <title>Data preprocessing</title>
            <p id="S11">Conventional flow cytometers and mass cytometers produce .fcs files that can be manually analyzed using programs such as FlowJo [TriStar] or Cytobank
                <sup>
                    <xref ref-type="bibr" rid="ref-22">22</xref>
                </sup>, or using R/Bioconductor packages, such as 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/flowWorkspace.html">flowWorkspace</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-23">23</xref>
                </sup> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/openCyto.html">openCyto</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-24">24</xref>
                </sup>. During this initial analysis step, dead cells are removed, compensation is checked and with simple two dimensional scatter plots (e.g., marker intensity versus time), marker expression patterns are checked. Often, modern experiments are barcoded in order to remove analytical biases due to individual sample variation or acquisition time. Preprocessing steps including normalization using bead standards
                <sup>
                    <xref ref-type="bibr" rid="ref-25">25</xref>
                </sup>, de-barcoding
                <sup>
                    <xref ref-type="bibr" rid="ref-26">26</xref>
                </sup> and compensation can be completed with the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-27">27</xref>
                </sup>, which also provides a 
                <ext-link ext-link-type="uri" xlink:href="https://catalyst-project.github.io/">Shiny app</ext-link> for interactive analysis. Of course, preprocessing steps can occur using custom scripts within R or outside of R (e.g., 
                <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/bead-normalization/releases/tag/v0.3">Normalizer</ext-link>
                <sup>
                    <xref ref-type="bibr" rid="ref-25">25</xref>
                </sup>).</p>
        </sec>
        <sec>
            <title>Data import</title>
            <p id="S3">We recommend as standard practice to keep an independent record of all samples collected, with additional information about the experimental condition, including sample or patient identifiers, processing batch and so on. That is, we recommend having a trail of metadata for each experiment. In our example, the metadata file, 
                <monospace>PBMC8_metadata.xlsx,</monospace> can be downloaded from the Robinson Lab server with the 
                <monospace>download.file()</monospace> function. For the workflow, the user should place it in the current working directory (
                <monospace>getwd()</monospace>). Here, we load it into R with the 
                <monospace>read_excel()</monospace> function from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/web/packages/readxl/index.html">readxl</ext-link>
                </italic> package and save it into a variable called 
                <monospace>md</monospace>, but other file types and interfaces to read them in are also possible.</p>
            <p>The data frame 
                <monospace>md</monospace> contains the following columns:</p>
            <list list-type="bullet">
                <list-item>
                    <p>
                        <monospace>file_name</monospace> with names of the .fcs files corresponding to the reference (suffix &#x201c;Reference&#x201d;) and BCR/FcR-XL stimulation (suffix &#x201c;BCR-XL&#x201d;) samples,</p>
                </list-item>
                <list-item>
                    <p>
                        <monospace>sample_id</monospace> with shorter unique names for each sample containing information about conditions and patient IDs. These will be used to label samples throughout the entire workflow.</p>
                </list-item>
                <list-item>
                    <p>
                        <monospace>condition</monospace> describes whether samples originate from the reference (
                        <monospace>Ref</monospace>) or stimulated (
                        <monospace>BCRXL</monospace>) condition,</p>
                </list-item>
                <list-item>
                    <p>
                        <monospace>patient_id</monospace> defines the IDs of patients.</p>
                </list-item>
            </list>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">library</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(readxl)                                                </styled-content>

                    <styled-content style="font-size:12px;color:#000000">url &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"http://imlspenticton.uzh.ch/robinson_lab/cytofWorkflow"</styled-content>

                    <styled-content style="font-size:12px;color:#000000">md &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"PBMC8_metadata.xlsx"                                    </styled-content>

                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">download.file</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(</styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">file.path</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(url, md), </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">destfile = </styled-content>
                    <styled-content style="font-size:12px;color:#000000">md, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">mode = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"wb"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)  </styled-content>

                    <styled-content style="font-size:12px;color:#000000">md &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">read_excel</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(md)                                           </styled-content>

                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">head</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(</styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">data.frame</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(md))                                           </styled-content>


                    <styled-content style="font-size:12px;color:#000000;">##                            file_name sample_id condition patient_id</styled-content>

                    <styled-content style="font-size:12px;color:#000000;">## 1    PBMC8_30min_patient1_BCR-XL.fcs    BCRXL1     BCRXL   Patient1</styled-content>

                    <styled-content style="font-size:12px;color:#000000;">## 2 PBMC8_30min_patient1_Reference.fcs      Ref1       Ref   Patient1</styled-content>

                    <styled-content style="font-size:12px;color:#000000;">## 3    PBMC8_30min_patient2_BCR-XL.fcs    BCRXL2     BCRXL   Patient2</styled-content>

                    <styled-content style="font-size:12px;color:#000000;">## 4 PBMC8_30min_patient2_Reference.fcs      Ref2       Ref   Patient2</styled-content>

                    <styled-content style="font-size:12px;color:#000000;">## 5    PBMC8_30min_patient3_BCR-XL.fcs    BCRXL3     BCRXL   Patient3</styled-content>

                    <styled-content style="font-size:12px;color:#000000;">## 6 PBMC8_30min_patient3_Reference.fcs      Ref3       Ref   Patient3</styled-content>
                </preformat>
            </p>
            <p>In our example, the data from the .fcs files listed in the metadata can be loaded from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/data/experiment/html/HDCytoData.html">HDCytoData</ext-link>
                </italic> package
                <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:12px;color:#214A87; font-weight:bold">library</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(HDCytoData)                                                               </styled-content>

                    <styled-content style="font-size:12px;color:#000000">fs &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">Bodenmiller_BCR_XL_flowSet</styled-content>
                    <styled-content style="font-size:12px;color:#000000">()                                                </styled-content>
                </preformat>
            </p>
            <p>Alternatively, the files can be downloaded manually from the 
                <ext-link ext-link-type="uri" xlink:href="https://community.cytobank.org/cytobank/login">Citrus Cytobank repository</ext-link> and loaded into R as a 
                <monospace>flowSet</monospace>  using  
                <monospace>read.flowSet()</monospace>  from  the  
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/flowCore.html">flowCore</ext-link>
                </italic>  package
                <sup>
                    <xref ref-type="bibr" rid="ref-28">28</xref>
                </sup>.  Importantly,  
                <monospace>read.flowSet()</monospace> and the underlying 
                <monospace>read.FCS()</monospace> functions, by default, may transform the marker intensities and remove cells with extreme positive values. This behavior can be controlled with arguments 
                <monospace>transformation</monospace> and 
                <monospace>truncate_max_range</monospace>, respectively.</p>
            <p>In our example, information about the panel is also available in a file called 
                <monospace>PBMC8_panel.xlsx,</monospace> and can be downloaded from the 
                <ext-link ext-link-type="uri" xlink:href="http://imlspenticton.uzh.ch/robinson_lab/cytofWorkflow/">Robinson Lab server</ext-link> and loaded into a variable called 
                <monospace>panel</monospace>. It contains columns for 
                <monospace>Isotope</monospace> and 
                <monospace>Metal</monospace> that define the atomic mass number and the symbol of the chemical element conjugated to the antibody, respectively, and 
                <monospace>Antigen</monospace>, which specifies the protein marker that was targeted; two additional columns specify whether a channel belongs to the lineage or functional type of marker.</p>
            <p>The isotope, metal and antigen information that the instrument receives is also stored in the 
                <monospace>flowFrame</monospace> (container for one sample) or 
                <monospace>flowSet</monospace> (container for multiple samples) objects. One can type 
                <monospace>fs[[1]]</monospace> to see the first 
                <monospace>flowFrame</monospace>, which contains a table with columns 
                <monospace>name</monospace> and 
                <monospace>desc</monospace>. Their content can be retrieved with accessors 
                <monospace>pData(parameters(fs[[1]]))</monospace>. The variable 
                <monospace>name</monospace> corresponds to the column names in the 
                <monospace>flowSet</monospace> object, and can be viewed in R via 
                <monospace>colnames(fs)</monospace>.</p>
            <p>It should be checked that elements from 
                <monospace>panel</monospace> can be matched to their corresponding entries in the 
                <monospace>flowSet</monospace> object. Specifically, the entries in 
                <monospace>panel$Antigen</monospace> must have an equivalent in the 
                <monospace>desc</monospace> columns of the 
                <monospace>flowFrame</monospace> objects. In the following analysis, we will often use marker IDs as column names in the tables containing expression values. As a cautionary note, during object conversion from one type to another (e.g., in the creation of data.frame from a matrix), some characters (e.g., dashes) in the dimension names are replaced with dots, which may cause problems in matching. To avoid this problem, we will replace problematic characters (dashes with underscores; colons with dots) when organizing all data (measurement data, panel, and experimental metadata) into a so-called 
                <monospace>daFrame</monospace> (Differential Analysis Frame; see 
                <xref ref-type="other" rid="S4">below</xref>).</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#000000">panel &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"PBMC8_panel_v3.xlsx"                                     </styled-content>

                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">download.file</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(</styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">file.path</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(url, panel), </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">destfile = </styled-content>
                    <styled-content style="font-size:12px;color:#000000">panel, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">mode = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"wb"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>

                    <styled-content style="font-size:12px;color:#000000">panel &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">read_excel</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(panel)                                         </styled-content>

                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">head</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(</styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">data.frame</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(panel))                                            </styled-content>
</preformat>
            </p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#000000">##      fcs_colname antigen marker_class
## 1 CD3(110:114)Dd     CD3         type
## 2  CD45(In115)Dd    CD45         type
## 3 pNFkB(Nd142)Dd   pNFkB        state
## 4  pp38(Nd144)Dd    pp38        state
## 5   CD4(Nd145)Dd     CD4         type
## 6  CD20(Sm147)Dd    CD20         type</styled-content>
                </preformat>
            </p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># spot check that all panel columns are in the flowSet object</styled-content>

                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">all</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(panel</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">fcs_colname </styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">%in% </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">colnames</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(fs))</styled-content>
                </preformat>
            </p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#000000">## [1] TRUE</styled-content>
                </preformat>
            </p>
        </sec>
        <sec>
            <title>Data transformation</title>
            <p>Usually, the raw marker intensities read by a cytometer have strongly skewed distributions with varying ranges of expression, thus making it difficult to distinguish between the negative and positive cell populations. It is common practice to transform CyTOF marker intensities using, for example, arcsinh (inverse hyperbolic sine) with cofactor 5
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>,
                    <xref ref-type="bibr" rid="ref-29">29</xref>
                </sup> to make the distributions more symmetric and to map them to a comparable range of expression, which is important for clustering. A cofactor of 150 has been promoted for flow cytometry, but users are free to implement alternative transformations, some of which are available from the 
                <monospace>transform()</monospace> function of the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/flowCore.html">flowCore</ext-link>
                </italic> package. By default, the 
                <monospace>daFrame()</monospace> constructor (see 
                <xref ref-type="other" rid="S4">next section</xref>) arcsinh transforms marker expressions with a cofactor of 5.</p>
            <p>As the ranges of marker intensities can vary substantially, for visualization, we apply another transformation that scales the expression of all markers to values between 0 and 1 using low (e.g., 1%) and high (e.g., 99%) percentiles as the boundary. This additional transformation of the arcsinh-transformed data can sometimes give better visual representation of relative differences in marker expression between annotated cell populations. However, all computations (differential testing, hierarchical clustering etc.) are still performed on arcsinh-transformed not scaled expressions. Whether scaled expression values should be plotted is specified with argument 
                <monospace>scale = TRUE</monospace> or 
                <monospace>FALSE</monospace> in the respective visualizations (e.g., 
                <monospace>plotExprHeatmap()</monospace> and 
                <monospace>plotClusterHeatmap()</monospace>).</p>
        </sec>
        <sec>
            <title>Data organization</title>
            <p id="S4">We will store all data used and returned throughout differential analysis in an object of class 
                <monospace>daFrame</monospace> from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                </italic> package. The 
                <monospace>daFrame</monospace> requires the following inputs:</p>
            <list list-type="bullet">
                <list-item>
                    <p>
                        <monospace>x:</monospace> a 
                        <monospace>flowSet</monospace> containing the raw measurement data, or a character string that specifies the path to a set of .fcs files.</p>
                </list-item>
                <list-item>
                    <p>
                        <monospace>panel:</monospace> a 
                        <monospace>data.frame</monospace> containing, for each marker, i) its column name in the input raw data, ii) its targeted protein markers, and, optionally, iii) its class (type, state, or none).</p>
                </list-item>
                <list-item>
                    <p>
                        <monospace>md:</monospace> a 
                        <monospace>data.frame</monospace> with columns describing the experimental design.</p>
                </list-item>
            </list>
            <p>Argument 
                <monospace>cols_to_use</monospace> specifies which columns (channels) to retain from the input data. By default, all measurement parameters will be kept (
                <monospace>cols_to_use = NULL</monospace>). Here, we only keep the channels listed in 
                <monospace>panel</monospace>.</p>
            <p>It is important to carefully check whether variables are of the desired type (factor, numeric, character), since input methods may convert columns into different data types. This is taken care of by the 
                <monospace>daFrame()</monospace> constructor. For the statistical modeling, we want to make the condition variable a factor with the reference (
                <monospace>Ref</monospace>) being the reference level. The order of factor levels can be defined with the 
                <monospace>levels</monospace> parameter of the 
                <monospace>factor</monospace> function  or  via  
                <monospace>relevel()</monospace>.</p>
            <p>As a final note, the 
                <monospace>daFrame()</monospace> constructor requires the filenames listed in the 
                <monospace>md$file_name</monospace> column to match those in the 
                <monospace>flowSet</monospace>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># specify levels for conditions &amp; sample IDs to assure desired ordering </styled-content>

                    <styled-content style="font-size:12px;color:#000000">md</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">condition &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">factor</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(md</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">condition, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">levels = </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">c</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(</styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"Ref"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"BCRXL"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">))        </styled-content>

                    <styled-content style="font-size:12px;color:#000000">md</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">sample_id &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">factor</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(md</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">sample_id,                                    </styled-content>

                    <styled-content style="font-size:12px;color:#214A87">    levels = </styled-content>
                    <styled-content style="font-size:12px;color:#000000">md</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">sample_id[</styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">order</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(md</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">condition)])                          </styled-content>

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

                    <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># construct daFrame                                                     </styled-content>

                    <styled-content style="font-size:12px;color:#000000">daf &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">daFrame</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(fs, panel, md, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">cols_to_use = </styled-content>
                    <styled-content style="font-size:12px;color:#000000">panel</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">fcs_colname)          </styled-content>
                </preformat>
            </p>
        </sec>
        <sec>
            <title>Diagnostic plots</title>
            <p>We propose some quick checks to verify whether the data we analyze globally represents what we expect; for example, whether samples that are replicates of one condition are more similar and are distinct from samples from another condition. Another important check is to verify that marker expression distributions do not have any abnormalities such as having different ranges or distinct distributions for a subset of the samples. This could highlight problems with the sample collection or data acquisition, or batch effects that were unexpected. Depending on the situation, one can then consider removing problematic markers or samples from further analysis; in the case of batch effects, a covariate column could be added to the metadata table and used below in the statistical analyses.</p>
            <p>The step below generates a plot with per-sample marker expression distributions, colored by condition (
                <xref ref-type="fig" rid="f1">Figure 1</xref>). Here, we can already see distinguishing markers, such  as pNFkB and CD20, between stimulated and unstimulated conditions.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#000000">p &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotExprs</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>

                    <styled-content style="font-size:12px;color:#000000">p</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">facet</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">params</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">ncol &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#0000CF">6                   </styled-content>

                    <styled-content style="font-size:12px;color:#000000">p                                          </styled-content>
                </preformat>
            </p>
            <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                <label>Figure 1. </label>
                <caption>
                    <title>Per-sample smoothed densities of marker expression (arcsinh-transformed) of 10 lineage markers and 14 functional markers in the PBMC dataset.</title>
                    <p>Two conditions: unstimulated (Ref) and stimulated with BCR/FcR-XL (BCRXL) for each of the 8 healthy donors are presented and colored by experimental condition.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure1.gif"/>
            </fig>
            <p>Another spot check is the number of cells per sample (
                <xref ref-type="fig" rid="f2">Figure 2</xref>). This plot can be used as a guide together with other readouts to identify samples where not enough cells were assayed. The number of cells measured in each sample is also stored in the 
                <monospace>experiment_info</monospace> slot of the 
                <monospace>daFrame&#x2019;s metadata</monospace>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">metadata</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf)</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">experiment_info</styled-content>
                    <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                    <styled-content style="font-size:12px;color:#000000">n_cells </styled-content>


                    <styled-content style="font-size:12px;color:#000000">##  [1]  2838  2739 16675 16725 12252  9434  8990  6906  8543 11962  8622
## [12] 11038 14770 15974 11653 13670</styled-content>
                </preformat>
            </p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotCounts</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>
                </preformat>
            </p>
            <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                <label>Figure 2. </label>
                <caption>
                    <title>Barplot showing the number of cells measured for each sample in the PBMC dataset.</title>
                    <p>Bars are colored by experimental condition: unstimulated (Ref) and stimulated with BCR/FcR-XL (BCRXL). Numbers in the names on the x-axis indicate patient IDs. Numbers on top of the bars indicate the cell counts.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure2.gif"/>
            </fig>
        </sec>
        <sec>
            <title>MDS plot</title>
            <p id="S7">In transcriptomics applications, one of the most utilized exploratory plots is the multi-dimensional scaling (MDS) plot or a principal component analysis (PCA) plot. Such plots show similarities between samples measured in an unsupervised way and give a sense of how much differential expression can be detected before conducting any formal tests. In transcriptomics, distances between samples are calculated based on the expression of the top varying genes. We propose a similar plot for HDCyto data using median marker expression over all cells to calculate dissimilarities between samples (other aggregations are also possible, and one could reduce the number of top varying markers to include in the calculation). Ideally, samples should cluster well within the same condition, although this depends on the magnitude of the difference between experimental conditions. With this diagnostic, one can identify outlier samples and eliminate them if the circumstances warrant it. An MDS plot on the median marker expressions can be generated with 
                <monospace>plotMDS()</monospace>, which internally calls the same-named 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/limma.html">limma</ext-link>
                </italic> function. </p>
            <p>In our MDS plot on median marker expression values (
                <xref ref-type="fig" rid="f3">Figure 3</xref>), we can also see that the first dimension (MDS1) separates the unstimulated and stimulated samples reasonably well. The second dimension (MDS2) represents, to some degree, differences between patients. Most of the samples that originate from the same patient are placed at a similar point along the y-axis, for example, samples from patients 7, 5, and 8 are at the bottom of the plot, while samples from patient 4 are located at the top of the plot. This also indicates that the marker expression of individual patients is driving similarity and perhaps should be formally accounted for in the downstream statistical modeling.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotMDS</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>
                </preformat>
            </p>
            <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                <label>Figure 3. </label>
                <caption>
                    <title>MDS plot for the unstimulated (Ref) and stimulated with BCR/FcR-XL (BCRXL) samples obtained for each of the 8 healthy donors in the PBMC dataset.</title>
                    <p>Calculations are based on the median (arcsinh-transformed) marker expression of 10 lineage markers and 14 functional markers across all cells measured for each sample. Distances between samples in the plot approximate the typical change in medians. Numbers in the label names indicate patient IDs.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure3.gif"/>
            </fig>
            <p>In contrast to genomic applications, the number of variables measured for each sample is much lower in HDCyto data.  In the former, thousands of genes are surveyed, whereas in the latter, ~20-50 antigens are typically targeted.  Similar to the MDS plot above, a heatmap of the same data also gives insight into the structure of the data.   The heatmap shows median marker intensities with clustered columns (markers) and rows (samples). We have used hierarchical clustering with average linkage and Euclidean distance, but also Ward&#x2019;s linkage could be used
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>
                </sup>, and in CyTOF applications, a cosine distance shows good performance
                <sup>
                    <xref ref-type="bibr" rid="ref-30">30</xref>
                </sup>. In this plot, we can see which markers drive the observed clustering of samples (
                <xref ref-type="fig" rid="f4">Figure 4</xref>).</p>
            <fig fig-type="figure" id="f4" orientation="portrait" position="float">
                <label>Figure 4. </label>
                <caption>
                    <title>Heatmap of the median (arcsinh-transformed) marker expression of 10 lineage markers and 14 functional markers across all cells measured for each sample in the PBMC dataset.</title>
                    <p>Color-coded with yellow for lower expression and blue for higher expression. The numbers in the heatmap represent the actual expression values. Dendrograms present clustering of samples (rows) and markers (columns) which is based on hierarchical clustering with Euclidean distance metric and average linkage. Row annotations on the left of the heatmap represent the two conditions: unstimulated (Ref) and stimulated with BCR/FcR-XL (BCRXL), and patient IDs for each of the 8 healthy donors.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure4.gif"/>
            </fig>
            <p>As with the MDS plot, the dendrogram separates the reference and stimulated samples very well. Also, similar groupings of patients within experimental conditions are observed.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotExprHeatmap</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">bin_anno = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">row_anno = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>
                </preformat>
            </p>
        </sec>
        <sec>
            <title>Marker ranking based on the non-redundancy score</title>
            <p>In this step, we identify the ability of markers to explain the variance observed in each sample. In particular, we calculate the PCA-based non-redundancy score (NRS)
                <sup>
                    <xref ref-type="bibr" rid="ref-17">17</xref>
                </sup>.  Markers with higher score explain a larger portion of variability present in a given sample.</p>
            <p>The average NRS can be used to select a subset of markers that are non-redundant in each sample but at the same time capture the overall diversity between samples. Such a subset of markers can then be used for cell population identification analysis (i.e., clustering). We note that there is no precise rule on how to choose the right cutoff for marker inclusion, but one option is to select a suitable number of the top-scoring markers. The number can be chosen by analyzing the plot with the NR scores (
                <xref ref-type="fig" rid="f5">Figure 5</xref>), where the markers are sorted by the decreasing average NRS. Based on prior biological knowledge, one can refine the marker selection and remove markers that are not likely to distinguish cell populations of interest, even if they have high scores, and add in markers with low scores but known to be important in discerning cell subgroups
                <sup>
                    <xref ref-type="bibr" rid="ref-17">17</xref>
                </sup>. Thus, the NRS analysis serves more as a guide to marker selection and is not meant as a hard rule.</p>
            <fig fig-type="figure" id="f5" orientation="portrait" position="float">
                <label>Figure 5. </label>
                <caption>
                    <title>Non-redundancy scores for each of the 10 lineage markers and all samples in the PBMC dataset.</title>
                    <p>The full points represent the per-sample NR scores (colored by experimental conditions), while empty black circles indicate the mean NR scores from all the samples. Markers on the x-axis are sorted according to the decreasing average NRS.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure5.gif"/>
            </fig>
            <p>In the dataset considered here
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>,
                    <xref ref-type="bibr" rid="ref-21">21</xref>
                </sup>, we want to use all the 10 lineage markers, so there is no explicit need to restrict the set of cell surface markers, and the NRS serve as another quality control step. There may be other situations where this feature selection step would be of interest, for example, in panel design
                <sup>
                    <xref ref-type="bibr" rid="ref-17">17</xref>
                </sup>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotNRS</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">markers = </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">type_markers</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf), </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>
                </preformat>
            </p>
        </sec>
        <sec>
            <title>Cell population identification with FlowSOM and ConsensusClusterPlus</title>
            <p>Cell population identification typically has been carried out by manual gating, a method based on visual inspection of a series of two-dimensional scatterplots. At each step, a subset of cells, either positive or negative for the two visualized markers, is selected and further stratified in the subsequent iterations until populations of interest across a range of marker combinations are captured. However, manual gating has drawbacks, such as subjectivity, bias toward well-known cell types, and inefficiency when analyzing large datasets, which also contribute to a lack of reproducibility
                <sup>
                    <xref ref-type="bibr" rid="ref-5">5</xref>
                </sup>.</p>
            <p>Considerable effort has been made to improve and automate cell population identification, such as unsupervised clustering
                <sup>
                    <xref ref-type="bibr" rid="ref-31">31</xref>
                </sup>. However, not all methods scale well in terms of performance and speed from the lower dimensionality flow cytometry data to the higher dimensionality mass cytometry data
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>, since clustering in higher dimensions can suffer the &#x201c;curse of dimensionality&#x201d;.</p>
            <p>Beside the mathematical and algorithmic challenges of clustering, cell population identification may be difficult due to the chemical and biological aspects of the cytometry experiment itself. Therefore, caution should be taken when designing panels aimed at detecting rare cell populations by assigning higher sensitivity metals to rare markers. The right choice of a marker panel used for clustering can also be important. For example, it should include all markers that are relevant for cell type identification.</p>
            <p>In this workflow, we conduct cell clustering with 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-32">32</xref>
                </sup> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-33">33</xref>
                </sup>, which appeared amongst the fastest and best performing clustering approaches in a recent study of HDCyto datasets
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>. This ensemble showed strong performance in detecting both high and low frequency cell populations and is one of the fastest methods to run, which enables its interactive usage. We use a slight modification of the original workflow presented in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                </italic> vignette, which we find more flexible. In particular, we directly call the 
                <monospace>ConsensusClusterPlus()</monospace> function that is embedded in 
                <monospace>metaClustering_consensus()</monospace>. Thus, we are able to access all the functionality of the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                </italic> package to explore the number of clusters.</p>
            <p>The 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                </italic> workflow consists of three steps: i) building a self-organizing map (SOM), where cells are assigned according to their similarities to 100 (by default) grid points (or, so-called codebook vectors or codes) of the SOM; ii) building a minimal spanning tree, which is mainly used for graphical representation of the clusters, is skipped in this pipeline; and iii) 
                <italic toggle="yes">metaclustering</italic> of the SOM codes, is performed with the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                </italic> package. These are wrapped in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                </italic> function 
                <monospace>cluster()</monospace>. Additionally, we add an optional round of manual expert-based merging of the metaclusters and allow this to be done in a reproducible fashion.</p>
            <p>It is important to point out that we cluster all cells from all samples together. This strategy is beneficial, since we directly obtain cluster assignment for each cell, we label cell populations only once and the mapping of cell types between samples is automatically consistent. For a list of alternative approaches and their advantages and disadvantages, please refer to the 
                <xref ref-type="other" rid="S12">Discussion</xref> section, where we consider: clustering per sample, clustering of data from different measurement batches and down-sampling in case of widely varying numbers of cells per sample.</p>
            <p>
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                </italic> provides the wrapper function 
                <monospace>cluster()</monospace> to perform both 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                </italic> clustering and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                </italic> metaclustering. The clustering IDs obtained after the first high-dimensional clustering step are added to the input 
                <monospace>daFrame&#x2019;s rowData</monospace> in the 
                <monospace>cluster_id column</monospace>. The cluster codes for the lower dimensional metaclusterings to 2 through 
                <monospace>maxK</monospace> clusters are stored as list element 
                <monospace>cluster_codes</monospace> in the 
                <monospace>metadata</monospace>. In this way, all levels of clustering are computed once and kept accessible for further investigation, visualization, and differential analysis.</p>
            <p>The subset of markers to use for clustering is specified with argument 
                <monospace>cols_to_use</monospace>. For future reference, the specified markers will be assigned class 
                <monospace>"type"</monospace>, and the remainder of markers will be assigned to be 
                <monospace>"state"</monospace> markers. The sets of type and state markers can be accessed at any point with the 
                <monospace>type_markers()</monospace> and 
                <monospace>state_markers()</monospace> accessor functions, respectively.</p>
            <p>In our example, we have specified marker classes in the input 
                <monospace>panel</monospace>, and 
                <monospace>cluster()</monospace> will default to using 
                <monospace>"type"</monospace> markers for clustering. For clarity, we specify this explicitly via 
                <monospace>cols_to_use = type_markers(daf)</monospace>. We call 
                <monospace>ConsensusClusterPlus()</monospace> with maximum number of clusters 
                <monospace>maxK = 20</monospace>.</p>
            <p>
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/FlowSOM">FlowSOM</ext-link>
                </italic> output can be sensitive to random starts
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>. To make results reproducible, 
                <monospace>cluster()</monospace> takes a 
                <monospace>seed</monospace> argument that is passed to 
                <monospace>set.seed</monospace> for random number generation, prior to calling 
                <monospace>BuildSOM()</monospace>. It is advisable to rerun analyses with multiple random seeds, for two reasons. First, one can see how robust the detected clusters are, and second, when the goal is to find smaller cell populations, it may happen that, in some runs, random starting points do not represent rare cell populations, as the chance of selecting starting cells from them is low and they are merged into a larger cluster.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#000000">daf &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">cluster</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">cols_to_use = </styled-content>
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">type_markers</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf), </styled-content>

                    <styled-content style="font-size:12px;color:#214A87">    xdim = </styled-content>
                    <styled-content style="font-size:12px;color:#0000CF">10</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">ydim = </styled-content>
                    <styled-content style="font-size:12px;color:#0000CF">10</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">maxK = </styled-content>
                    <styled-content style="font-size:12px;color:#0000CF">20</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">seed = </styled-content>
                    <styled-content style="font-size:12px;color:#0000CF">1234</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)    </styled-content>
                </preformat>
            </p>
            <p>Automatic approaches for selecting the number of clusters in HDCyto data do not always succeed
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>. In general, we therefore recommend some level of over-clustering, and if desired, manual merging of clusters. Such a hierarchical approach is especially suited when the goal is to detect smaller cell populations.</p>
            <p>The SPADE clustering analysis performed by Bodenmiller 
                <italic toggle="yes">et al.</italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-21">21</xref>
                </sup> identified 6 main cell types (T-cells, monocytes, dendritic cells, B-cells, NK cells and surface- cells) that were further stratified into 14 more specific subpopulations (CD4+ T-cells, CD8+ T-cells, CD14+ HLA-DR high monocytes, CD14+ HLA-DR med monocytes, CD14+ HLA-DR low monocytes, CD14- HLA-DR high monocytes, CD14- HLA-DR med monocytes, CD14- HLA-DR low monocytes, dendritic cells, IgM+ B-cells, IgM- B-cells, NK cells, surface- CD14+ cells and surface- CD14- cells). In our analysis, we are interested in identifying the 6 main PBMC populations, including: CD4+ T-cells, CD8+ T-cells, monocytes, dendritic cells, NK cells and B-cells. Following the concept of over-clustering, we perform the metaclustering of the (by default) 100 SOM codes into more than expected number of groups. For example, stratification into 20 groups should give enough resolution to detect these main clusters. We can explore the clustering in a wide variety of visualizations: UMAP plots, heatmaps and the &#x201c;delta area&#x201d; from 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/ConsensusClusterPlus">ConsensusClusterPlus</ext-link>
                </italic>.</p>
            <p>When the interest is in studying more specific subpopulations at higher detail, one can follow a strategy of reclustering as described in the 
                <xref ref-type="other" rid="S13">Obtaining higher resolution</xref> section, where we propose to repeat the workflow (clustering and differential analyses) after gating out a selected subpopulation (e.g., one of the large populations).</p>
            <p>We can then investigate characteristics of identified clusters with heatmaps that illustrate median marker expression in each cluster (
                <xref ref-type="fig" rid="f6">Figure 6</xref>). As the range of marker expression can vary substantially from marker to marker, we use the 0-1 transformed data for some visualizations (argument 
                <monospace>scale = TRUE</monospace> in the respective plotting functions). However, to stay consistent with 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/FlowSOM">FlowSOM</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/ConsensusClusterPlus">ConsensusClusterPlus</ext-link>
                </italic>, we use the (arcsinh-transformed) unscaled data to generate the dendrogram of the hierarchical structure of metaclusters.</p>
            <fig fig-type="figure" id="f6" orientation="portrait" position="float">
                <label>Figure 6. </label>
                <caption>
                    <title>Heatmap of the median marker intensities of the 10 lineage markers across the 20 cell populations obtained with FlowSOM after the metaclustering step with ConsensusClusterPlus (PBMC data).</title>
                    <p>The color in the heatmap represents the median of the arcsinh, 0-1 transformed marker expression calculated over cells from all the samples, varying from blue for lower expression to red for higher expression. The dendrogram on the left represents the hierarchical similarity between the 20 metaclusters (metric: Euclidean distance; linkage: average). Each cluster has a unique color assigned (bar on the left) which is identical in other visualizations of these 20 clusters (e.g., the UMAP shown in 
                        <xref ref-type="fig" rid="f10">Figure 10</xref>) facilitating the figure interpretation. Barplot along the rows (clusters) and values in brackets on the right indicate the relative sizes of clusters.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure6.gif"/>
            </fig>
            <p>Instead of using only medians, which do not give a full representation of cluster specifics, one can plot the entire marker expression distribution in each cluster (
                <xref ref-type="fig" rid="f7">Figure 7</xref>). Such a plot gives more detailed profile of each cluster, but represents a larger amount of information to interpret. Heatmaps give an overall overview of clusters, are quicker and easier to interpret, and together with the dendrogram can be a good basis for further cluster merging (see 
                <xref ref-type="other" rid="S6">Cluster merging and annotation</xref> section).</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotClusterHeatmap</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf,                               </styled-content>

                    <styled-content style="font-size:12px;color:#214A87">    hm2 = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">NULL</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">m = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">NULL</styled-content>
                    <styled-content style="font-size:12px;color:#000000">,               </styled-content>

                    <styled-content style="font-size:12px;color:#214A87">    cluster_anno = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">draw_freqs = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)           </styled-content>
                   

                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotClusterExprs</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">markers = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"type"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)  </styled-content>
                </preformat>
            </p>
            <fig fig-type="figure" id="f7" orientation="portrait" position="float">
                <label>Figure 7. </label>
                <caption>
                    <title>Distributions of marker intensities (arcsinh-transformed) of the 10 lineage markers in the 20 cell populations obtained with FlowSOM after the metaclustering step with ConsensusClusterPlus (PBMC data).</title>
                    <p>Red densities represent marker expression for cells in a given cluster. Blue densities are calculated over all the cells and serve as a reference.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure7.gif"/>
            </fig>
            <p>In addition to investigating expression of the lineage markers, we can also have a look at expression of the functional markers. We propose a heatmap that depicts median expression of functional markers in each sample (
                <xref ref-type="fig" rid="f8">Figure 8</xref>) such that the potential differential expression can be investigated already at this data exploration step before the formal testing is done. In order to plot all the heatmaps in one panel, we use the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/ComplexHeatmap">ComplexHeatmap</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-16">16</xref>
                </sup>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotClusterHeatmap</styled-content>
                    <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">hm2 = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"pS6"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                    <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                    <styled-content style="font-size:12px;color:#000000">, </styled-content>
                    <styled-content style="font-size:12px;color:#214A87">draw_freqs = </styled-content>
                    <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                    <styled-content style="font-size:12px;color:#000000">)</styled-content>
                </preformat>
            </p>
            <fig fig-type="figure" id="f8" orientation="portrait" position="float">
                <label>Figure 8. </label>
                <caption>
                    <title>Heatmap of the median marker intensities of the 10 lineage markers and one signaling marker (pS6) across the 20 cell populations obtained with FlowSOM after the metaclustering step with ConsensusClusterPlus (PBMC data).</title>
                    <p>The left panel presents a heatmap analogous to the one in 
                        <xref ref-type="fig" rid="f6">Figure 6</xref>. Heatmap on the right represents the median of the arcsinh, 0-1 transformed marker expression for a signaling marker pS6 calculated over cells in each sample (columns) individually.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure8.gif"/>
            </fig>
            <sec>
                <title>Visual representation with UMAP</title>
                <p>One of the most popular plots for representing single cell data are t-SNE plots, where each cell is represented in a lower, usually two-dimensional, space computed using t-stochastic neighbor embedding (t-SNE)
                    <sup>
                        <xref ref-type="bibr" rid="ref-34">34</xref>,
                        <xref ref-type="bibr" rid="ref-35">35</xref>
                    </sup>. More generally, dimensionality reduction techniques represent the similarity of points in 2 or 3 dimensions, such that similar objects in high-dimensional space are also similar in lower dimensional space. Mathematically, there are a myriad of ways to define this similarity. For example, principal component analysis (PCA) uses linear combinations of the original features to find orthogonal dimensions that show the highest levels of variability; the top 2 or 3 principal components can then be visualized.</p>
                <p>Nevertheless, there are a few notes of caution when using t-SNE or any other dimensionality reduction technique. Since they are based on preserving similarities between cells, those that are similar in the original space will be close in the 2D/3D representation, but the opposite does not always hold. In our experience, t-SNE with default parameters for HDCyto data is often suitable (for more guidance on the specifics of t-SNE, see 
                    <ext-link ext-link-type="uri" xlink:href="https://distill.pub/2016/misread-tsne/">How to Use t-SNE Effectively</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-36">36</xref>
                    </sup>).</p>
                <p>Another nonlinear dimensionality reduction technique, uniform manifold approximation and projection (UMAP), has recently been directly compared to t-SNE, and shown to outperform t-SNE in runtime, reproducibility, and its ability to organize cells into meaningful clusters
                    <sup>
                        <xref ref-type="bibr" rid="ref-37">37</xref>,
                        <xref ref-type="bibr" rid="ref-38">38</xref>
                    </sup>. Throughout this workflow, we use UMAP as our dimensionality reduction method of choice, but other techniques, such as PCA, diffusion maps
                    <sup>
                        <xref ref-type="bibr" rid="ref-19">19</xref>
                    </sup>, SIMLR
                    <sup>
                        <xref ref-type="bibr" rid="ref-20">20</xref>
                    </sup>, isomaps or t-SNE could be applied. Alternative algorithms, such as 
                    <italic toggle="yes">largeVis</italic>
                    <sup>
                        <xref ref-type="bibr" rid="ref-39">39</xref>
                    </sup> (available via the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://github.com/elbamos/largeVis">largeVis</ext-link>
                    </italic> package) or hierarchical stochastic neighbor embedding (HSNE)
                    <sup>
                        <xref ref-type="bibr" rid="ref-40">40</xref>
                    </sup>, can also be used for dimensionality reduction of very large datasets without downsampling. Alternatively, the dimensionality reduction can be performed on the 
                    <italic toggle="yes">codes</italic> of the SOM, at a resolution (size of the SOM) specified by the user (
                    <xref ref-type="fig" rid="f13">Figure 13</xref>).</p>
                <p>
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/CATALYST">CATALYST</ext-link>
                    </italic> provides a flexible wrapper, 
                    <monospace>runDR()</monospace>, to perform the set of dimensionality reduction methods available in the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/scater.html">scater</ext-link>
                    </italic> package. To make results reproducible, the random seed should be set via 
                    <monospace>set.seed</monospace> 
                    <italic toggle="yes">prior</italic> to calling 
                    <monospace>runDR()</monospace>. The subset of markers to use for computing reduced dimensions is specified via 
                    <monospace>cols_to_use</monospace>, but will default to the set of type-markers defined in the input 
                    <monospace>daFrame</monospace> if unspecified (
                    <monospace>type_markers(daf)</monospace>); the cells to use are specified with 
                    <monospace>rows_to_use</monospace>. When a single numeric value N is provided, 
                    <monospace>runDR()</monospace> will draw a random subset of N cells per sample.</p>
                <p>Most dimensionality reduction techniques require significant computational time to process the data. To keep running times reasonable for larger CyTOF datasets, one may use a subset of cells. The methods in 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/CATALYST">CATALYST</ext-link>
                    </italic> have been implemented in a way that allows using different sets of cells for different algorithms. For example, here we use 500 and 1000 cells from each sample to run t-SNE and UMAP, respectively.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># run t-SNE &amp; UMAP                           </styled-content>

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

                        <styled-content style="font-size:12px;color:#000000">daf &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">runDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"TSNE"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">rows_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">500</styled-content>
                        <styled-content style="font-size:12px;color:#000000">) </styled-content>

                        <styled-content style="font-size:12px;color:#000000">daf &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">runDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">rows_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">1000</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <p>The UMAP map below is colored according to the expression level of the CD4 marker, highlighting the position of CD4+ T-cells (
                    <xref ref-type="fig" rid="f9">Figure 9</xref>). In this way, one can use a set of markers to highlight where cell types of interest are located on the map. If one is loosely interpreting 
                    <italic toggle="yes">density</italic> of points in the map, it is recommended to select a fixed number of cells per sample.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"CD4"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f9" orientation="portrait" position="float">
                    <label>Figure 9. </label>
                    <caption>
                        <title>UMAP based on the arcsinh-transformed expression of the 10 lineage markers in the cells from the PBMC dataset.</title>
                        <p>UMAP was run with no PCA step. From each of the 16 samples, 1000 cells were randomly selected. Cells are colored according to the expression level of the CD4 marker.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure9.gif"/>
                </fig>
                <p>Alternatively, we can color the cells by any resolution of clustering available in the codes. Here, we compare the t-SNE and UMAP projections of cells colored by the 20 metaclusters. Ideally, cells of the same color should be close to each other (
                    <xref ref-type="fig" rid="f10">Figure 10</xref>). When the plots are further stratified by sample (
                    <xref ref-type="fig" rid="f11">Figure 11</xref>), we can verify whether similar cell populations are present in all replicates, which can help in identifying outlying samples. Optionally, stratification can be done by condition (
                    <xref ref-type="fig" rid="f12">Figure 12</xref>). With such a spot-check plot, we can inspect whether differences in cell abundance are strong between conditions, and we can visualize and identify distinguishing clusters before applying formal statistical testing. A similar approach of data exploration was proposed in studies of treatment-specific differences of polyfunctional antigen-specific T-cells
                    <sup>
                        <xref ref-type="bibr" rid="ref-41">41</xref>
                    </sup>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">p1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"TSNE"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">) </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">+             </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">    theme</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87">legend.position = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"none"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)                          </styled-content>

                        <styled-content style="font-size:12px;color:#000000">p2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)               </styled-content>

                        <styled-content style="font-size:12px;color:#000000">lgd &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">get_legend</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(p2)                                        </styled-content>

                        <styled-content style="font-size:12px;color:#000000">p2 &lt;- p2 </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">+ </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">theme</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87">legend.position = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"none"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)                   </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plot_grid</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(p1, p2, lgd, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">nrow = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">1</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">rel_widths = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">c</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">5</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">5</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">2</styled-content>
                        <styled-content style="font-size:12px;color:#000000">))    </styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic">## Facet per sample                                          </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">facet = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"sample_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>


                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic">## Facet per condition                                       </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">facet = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f10" orientation="portrait" position="float">
                    <label>Figure 10. </label>
                    <caption>
                        <title>t-SNE and UMAP based on the arcsinh-transformed expression of the 10 lineage markers in the cells from the PBMC dataset.</title>
                        <p>From each of the 16 samples, 500 (t-SNE) and 1000 (UMAP) cells were randomly selected. Cells are colored according to the 20 cell populations obtained with FlowSOM after the metaclustering step with ConsensusClusterPlus.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure10.gif"/>
                </fig>
                <fig fig-type="figure" id="f11" orientation="portrait" position="float">
                    <label>Figure 11. </label>
                    <caption>
                        <title>UMAP as in 
                            <xref ref-type="fig" rid="f10">Figure 10</xref>, but stratified by sample.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure11.gif"/>
                </fig>
                <fig fig-type="figure" id="f12" orientation="portrait" position="float">
                    <label>Figure 12. </label>
                    <caption>
                        <title>UMAP as in 
                            <xref ref-type="fig" rid="f10">Figure 10</xref>, but stratified by condition.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure12.gif"/>
                </fig>
                <p>The SOM codes represent characteristics of the 100 (by default) clusters generated in the first step of the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                    </italic> pipeline. Their visualization can also be helpful in understanding the cell population structure and determining the number of clusters. Ultimately, the metaclustering step uses the codes and not the original cells. We treat the codes as new representative cells and apply the t-SNE dimension reduction to visualize them in 2D (
                    <xref ref-type="fig" rid="f13">Figure 13</xref>). The size of the points corresponds to the number of cells that were assigned to a given code. The points are colored according to the results of metaclustering. Since we have only 100 data points, the t-SNE analysis is fast.</p>
                <fig fig-type="figure" id="f13" orientation="portrait" position="float">
                    <label>Figure 13. </label>
                    <caption>
                        <p>The 100 SOM codes in the PBMC dataset colored according to the metaclustering with Consen-susClusterPlus into 20 cell populations presented after the dimension reduction with (
                            <bold>A</bold>) t-SNE and (
                            <bold>B</bold>) PCA. The SOM codes represent characteristics of the 100 (by default) clusters generated in the first step of the FlowSOM pipeline. The size of the points corresponds to the number of cells that were assigned to a given code.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure13.gif"/>
                </fig>
                <p>As there are multiple ways to mathematically define similarity in high-dimensional space, it is always good practice visualizing projections from other methods to see how consistent the observed patterns are. For instance, we also represent the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                    </italic> codes via the first two principal components (
                    <xref ref-type="fig" rid="f13">Figure 13</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotCodes</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <p>Using heatmaps,  we can also visualize median marker expression in the 100 SOM codes as in 
                    <xref ref-type="fig" rid="f14">Figure 14</xref>. Of note, the clustering presented with the dendrogram does not completely agree with the clustering depicted by the 20 colors because the first one is based on the hierarchical clustering with average linkage and Euclidean distance, while the second one results from the consensus clustering.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotClusterHeatmap</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf,                     </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    hm2 = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"pS6"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"som100"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">m = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,</styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    cluster_anno = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">draw_freqs = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f14" orientation="portrait" position="float">
                    <label>Figure 14. </label>
                    <caption>
                        <title>Heatmap of the median marker intensities of the 10 lineage markers (left panel) and one signaling marker pS6 (right panel) across the 100 SOM codes in the PBMC dataset.</title>
                        <p>The color in the heatmap represents The color in the heatmap represents the median of the arcsinh, 0-1 transformed marker expression calculated over cells from all the samples, for the lineage markers, and over cells in each sample individually, for the signaling marker. The heat varies from blue for lower expression to red for higher expression. The dendrogram on the left represents the hierarchical similarity between the 100 codes (metric: Euclidean distance; linkage: average). The annotation bar on the left is colored according to the code metaclustering with ConsensusClusterPlus into 20 cell populations. The relative size of the codes is shown in parentheses next to the cluster numbers.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure14.gif"/>
                </fig>
                <fig fig-type="figure" id="f15" orientation="portrait" position="float">
                    <label>Figure 15. </label>
                    <caption>
                        <title>UMAP plot for the PBMC dataset, where cells are colored according to the manual merging of the 20 cell populations, obtained with FlowSOM, into 8 PBMC populations.</title>
                        <p>As in 10, UMAP uses the arcsinh-transformed expression of the 10 lineage markers in 1000 randomly selected cells from each of the 16 samples.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure15.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Cluster merging and annotation</title>
                <p id="S6">In our experience, manual merging of clusters leads to slightly different results compared to an algorithm with a specified number of clusters. In order to detect somewhat rare populations, some level of over-clustering is necessary so that the more subtle populations become separated from the main populations. In addition, merging can always follow an over-clustering step, but splitting of existing clusters is not generally feasible.</p>
                <p>In our setup, over-clustering is also useful when the interest is identifying the &#x201c;natural&#x201d; number of clusters present in the data. In addition to heatmaps and UMAP plots, one could investigate the delta area plot from the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                    </italic> package and the hierarchical clustering dendrogram of the over-clustered subpopulations, as shown in 
                    <xref ref-type="fig" rid="f16">Figure 16</xref> and 
                    <xref ref-type="fig" rid="f18">Figure 18</xref>.</p>
                <fig fig-type="figure" id="f16" orientation="portrait" position="float">
                    <label>Figure 16. </label>
                    <caption>
                        <title>Heatmap as in 
                            <xref ref-type="fig" rid="f6">Figure 6</xref>, where the additional color bar on the left indicates how the 20 metaclusters, obtained with FlowSOM, are merged into the 8 PBMC populations.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure16.gif"/>
                </fig>
                <p>In our example, we expect around 6 specific cell types, and we have performed 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/FlowSOM.html">FlowSOM</ext-link>
                    </italic> clustering into 20 groups as a reasonable over-estimate. After analyzing the heatmaps (
                    <xref ref-type="fig" rid="f6">Figure 6</xref>) and UMAP plots (
                    <xref ref-type="fig" rid="f10">Figure 10</xref>), we can clearly see that stratification of the data into 20 clusters may be too strong. In the UMAP plot, many clusters are placed very close to each other, indicating that they could be merged together. The same can be deduced from the heatmaps, highlighting that marker expression patterns for some neighboring clusters are very similar. Cluster merging and annotation is somewhat manual, based partially on visual inspection of UMAP plots and heatmaps and thus, benefits from expert knowledge of the cell types.</p>
                <p>
                    <bold>
                        <italic toggle="yes">Manual cluster merging and annotation based on heatmaps.</italic>
                    </bold> Our main reference for manual merging of clusters is the heatmap of marker characteristics across metaclusters (e.g., 
                    <xref ref-type="fig" rid="f6">Figure 6</xref>), with dendrograms showing the hierarchy of similarities. Such plots show cluster- or cluster-sample level information, and thus aggregate marker expression across many cells. Together with dimensionality reduction, these plots give good insight into the relationships between clusters and the marker levels within each cluster. Given expert knowledge of the cell types and markers, it is then left to the researcher to decide how exactly to merge clusters (e.g., with higher weight given to some markers). The dendrogram highlights the similarity between the metaclusters and can be used explicitly for the merging. However, there are reasons why we would not always follow the dendrogram exactly. In general, when it comes to clustering, blindly following the hierarchy of codes will lead to identification of populations of similar cells, but it does not necessarily mean that they are of biological interest. The distances between metaclusters are calculated across all the markers, and it may be that some markers carry higher weight for certain cell types. In addition, different linkage methods may lead to a different hierarchy, especially when clusters are not fully distinct. Another aspect to consider in cluster merging is the cluster size, represented in the parentheses next to the cluster label in our plots. If the cluster size is very small, but the cluster seems relevant and distinct, one can keep it as separate. However, if it is small and different from the neighboring clustering only in a somewhat unimportant marker, it could be merged. And, if some of the metaclusters do not represent any specific cell types, they could be dropped out of the downstream analysis instead of being merged. However, in case an automated solution for cluster merging is truly needed, one could use the 
                    <monospace>cutree()</monospace> function applied to the dendrogram.</p>
                <p>Based on the set random seed, a manual merging of the 20 metaclusters is defined in 
                    <monospace>PBMC8_cluster_merging1.xlsx</monospace> available at the 
                    <ext-link ext-link-type="uri" xlink:href="http://imlspenticton.uzh.ch/robinson_lab/cytofWorkflow/">Robinson Lab server</ext-link>. This merging table contains, for each of the original clusters, an ID to newly assign to cells assigned to the given cluster. Clusters may be merged with the 
                    <monospace>mergeClusters()</monospace> function from 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/CATALYST.html">CATALYST</ext-link>
                    </italic>. For future reference, each manual merging is assigned an ID specified with argument id. Note that, if multiple old clusters are given the same new label, the respective clusters will be merged.</p>
                <p>In this example, our expert has annotated 8 cell populations: CD8 T-cells, CD4 T-cells, B-cells IgM-, B-cells IgM+, NK cells, dendritic cells (DCs), monocytes and surface negative cells; monocytes could be further subdivided based on HLA-DR into high, medium and low subtypes.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">merging_table1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"PBMC8_cluster_merging1.xlsx"       </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">download.file</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">file.path</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(url, merging_table1),         </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    destfile = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">merging_table1, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">mode = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"wb"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)           </styled-content>

                        <styled-content style="font-size:12px;color:#000000">merging_table1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">read_excel</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(merging_table1)          </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">head</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">data.frame</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(merging_table1))                      </styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">##   original_cluster  new_cluster
## 1                1 B-cells IgM+
## 2                2     surface-
## 3                3     NK cells
## 4                4  CD8 T-cells
## 5                5 B-cells IgM-
## 6                6    monocytes</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># convert to factor with merged clusters in desired order                </styled-content>

                        <styled-content style="font-size:12px;color:#000000">merging_table1</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">new_cluster &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">factor</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(merging_table1</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">new_cluster,         </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    levels = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">c</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"B-cells IgM+"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"B-cells IgM-"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"CD4 T-cells"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,             </styled-content>

                        <styled-content style="font-size:12px;color:#4F9905">       "CD8 T-cells"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"DC"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"NK cells"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"monocytes"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"surface-"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">))        </styled-content>

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

                        <styled-content style="font-size:12px;color:#000000">daf &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">mergeClusters</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,                                  </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    table = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">merging_table1, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">id = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)                             </styled-content>
                    </preformat>
                </p>
                <p>We can view the UMAP plot with the new annotated cell populations by specifying 
                    <monospace>color_by = "merging1"</monospace> (
                    <xref ref-type="fig" rid="f15">Figure  15</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <p>One of the useful representations of merging is a heatmap of median marker expression in each of the original clusters, which are labeled according to the proposed merging, 
                    <xref ref-type="fig" rid="f16">Figure 16</xref>. As before, the clustering to use for computing cluster medians is specified with 
                    <monospace>k = "meta20"</monospace>. For visualization, we can specify a second layer of cluster annotations with 
                    <monospace>m = "merging1"</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotClusterHeatmap</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">m = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <p>To get a final summary of the annotated cell types, we can plot a heatmap of median marker expressions that are calculated based on the manual merging&#x2019;s cluster annotations (
                    <xref ref-type="fig" rid="f17">Figure 17</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotClusterHeatmap</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f17" orientation="portrait" position="float">
                    <label>Figure 17. </label>
                    <caption>
                        <title>Heatmap of the median marker intensities of the 10 lineage markers in the 8 PBMC cell populations obtained by manual merging of the 20 metaclusters generated by FlowSOM.</title>
                        <p>As in 
                            <xref ref-type="fig" rid="f6">Figure 6</xref>, the heat represents the median of arcsinh and 0-1 transformed marker expression calculated over cells from all the samples. The dendrogram on the left represents the hierarchical similarity between the 8 populations calculated using Euclidean distance and average linkage.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure17.gif"/>
                </fig>
                <p>
                    <bold>
                        <italic toggle="yes">Reducing the number of clusters in ConsensusClusterPlus.</italic>
                    </bold> The 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/ConsensusClusterPlus.html">ConsensusClusterPlus</ext-link>
                    </italic> package provides visualizations that can help to understand the metaclustering process and the characteristics of the analyzed data. For example, the delta area plot (
                    <xref ref-type="fig" rid="f18">Figure 18</xref>) highlights the amount of extra cluster stability gained when clustering into k groups as compared to k-1 groups (from k=2 to k=20). It can be expected that high stability of clusters can be reached when clustering into the number of groups that best fits the data. Thus, using the delta area plot could help finding the &#x201c;natural&#x201d; number of clusters present in the data, which would correspond to the value of k where there is no appreciable increase in stability. This strategy can be referred as the &#x201c;elbow criterion&#x201d;. For more details about the meaning of this plot, the user can refer to the original description of the consensus clustering method
                    <sup>
                        <xref ref-type="bibr" rid="ref-42">42</xref>
                    </sup>.</p>
                <fig fig-type="figure" id="f18" orientation="portrait" position="float">
                    <label>Figure 18. </label>
                    <caption>
                        <title>The delta area plot generated in the metaclustering step by the ConsensusClusterPlus function.</title>
                        <p>The delta area score (y-axis) indicates the relative increase in cluster stability obtained when clustering the 100 SOM codes generated by FlowSOM into k groups (x-axis).</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure18.gif"/>
                </fig>
                <p>The elbow criterion is quite subjective since the &#x201c;appreciable&#x201d; increase is not defined exactly. For example, in the delta plot below, we could say that the last point before plateau is for k=6, or for k=5, or for k=3, depending on our perception of sufficient decrease of the delta area score. Moreover, the exact point where a plateau is reached may vary for runs with different random seeds, the drop may not always be so sharp and the function is not guaranteed to be decreasing. It is advisable to investigate more of these plots and the resulting UMAP and heatmaps before drawing any conclusions about the final number of &#x201c;natural&#x201d; clusters.</p>
                <p>Manual merging of up to 20 clusters can be laborious. To simplify this task, one could reduce the strength of over-clustering and allow the metaclustering method to do a part of the merging, which then can be completed manually. Analyzing the delta plot from the right side, we can see how much we can reduce the strength of over-clustering while still obtaining stable clusters. In parallel, one should check the heatmaps to see whether the less stringent stratification is able to capture cell populations of interest.</p>
                <p>As an example, we consider the metaclustering to 12 groups. Clustering into as few as 12 groups still allows us to identify the same 8 cell populations as when merging 20 clusters, but these are simpler to define since fewer profiles need to be manually scanned. The expert-based merging of the 12 metaclusters into 8 PBMC cell populations is saved in the 
                    <monospace>PBMC8_cluster_merging2_v3.xlsx</monospace> file on the 
                    <ext-link ext-link-type="uri" xlink:href="http://imlspenticton.uzh.ch/robinson_lab/cytofWorkflow/">Robinson Lab server</ext-link>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">merging_table2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"PBMC8_cluster_merging2_v3.xlsx"     </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">download.file</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">file.path</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(url, merging_table2),          </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    destfile = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">merging_table2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">mode = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"wb"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)            </styled-content>

                        <styled-content style="font-size:12px;color:#000000">merging_table2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">read_excel</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(merging_table2)           </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">data.frame</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(merging_table2)                             </styled-content>


                        <styled-content style="font-size:12px;color:#000000">##   original_cluster   new_cluster
## 1                1  B-cells IgM+
## 2                2      surface-
## 3                3      NK cells
## 4                4   CD8 T-cells
## 5                5  B-cells IgM-
## 6                6     monocytes
## 7                7   CD8 T-cells
## 8                8     monocytes
## 9                9   CD4 T-cells
## 10              10            DC
## 11              11   CD4 T-cells
## 12              12   CD4 T-cells</styled-content>


                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># convert to factor with merged clusters in desired order       </styled-content>

                        <styled-content style="font-size:12px;color:#000000">merging_table2</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">new_cluster &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">factor</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(                           </styled-content>

                        <styled-content style="font-size:12px;color:#000000">    merging_table2</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">new_cluster,                                 </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    levels = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">levels</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(merging_table1</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">new_cluster))                </styled-content>

                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic">                                                                </styled-content>

                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># apply 2nd manual merging                                      </styled-content>

                        <styled-content style="font-size:12px;color:#000000">daf &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">mergeClusters</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta12"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,                         </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    table = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">merging_table2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">id = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging2"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)                    </styled-content>
                    </preformat>
                </p>
                <p>
                    <bold>
                        <italic toggle="yes">Comparison of automated and manual merging.</italic>
                    </bold> The manual merging of 20 (or 12) clusters by an expert resulted in identification of 8 cell populations. To highlight the impact of manual merging versus algorithm-defined subpopulations, we compare to the results of an automated cluster merging that is set to stratify the data also into 8 clusters. Out of interest, we can see which clusters are split by tabulating the cell labels.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic"># tabular comparison of algorithmic &amp; manual merging             </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">table</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87">manual = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">cluster_codes</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf)[</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">cluster_ids</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf), </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging2"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">], </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    algorithm = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">cluster_codes</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf)[</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">cluster_ids</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf), </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta8"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">] )  </styled-content>


                        <styled-content style="font-size:12px;color:#000000">##               algorithm
## manual             1     2     3     4     5     6    7    8
##   B-cells IgM+  6651     0     0     0     0     0    0    0
##   B-cells IgM-  3265     0     0     0     0     0    0    0
##   CD4 T-cells      0     0  1203     0  2603 59174    0 1113
##   CD8 T-cells      0     0 32112     0 19038     0    0    0
##   DC               0     0     0     0     0     0 1980    0
##   NK cells         0     0 23315     0     0     0    0    0
##   monocytes        0     0     0 18436     0     0    0    0
##   surface-         0  3901     0     0     0     0    0    0</styled-content>
                    </preformat>
                </p>
                <p>In the UMAP plot (
                    <xref ref-type="fig" rid="f19">Figure 19</xref>), we can see that part of the new cell populations (cluster 6, 1, 2, 4 and 7) overlap substantially with populations obtained by the means of manual merging (CD4 T-cells, B-cells, surface-, monocytes and DC). However, cells that belong to clusters 3 and 5 are subdivided in a different manner according to the manual merging. Cluster 1 consists of both B-cells IgM+ and IgM- and is not further subdivided, whereas cluster 8 is altogether unidentifiable.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">p1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,</styled-content> 
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging2"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)              </styled-content>

                        <styled-content style="font-size:12px;color:#000000">p2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDR</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"UMAP"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">color_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"meta8"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)                 </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plot_grid</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(p1, p2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">ncol = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">1</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">align = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"v"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">labels = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">c</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"A"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"B"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">))</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f19" orientation="portrait" position="float">
                    <label>Figure 19. </label>
                    <caption>
                        <p>UMAP plot with cells colored according to (
                            <bold>A</bold>) the expert merging of 12 metaclusters obtained with FlowSOM into 8 PBMC populations; and (
                            <bold>B</bold>) the 8 automatically detected with FlowSOM metaclusters.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure19.gif"/>
                </fig>
                <p>The brief example above highlights the difference between automatic clustering and manual merging of algorithm-generated clusters in the search for biologically meaningful cell populations. Automated and manual merging may give different weight to marker importance and thus result in different populations being detected. However, in our view, the manual merging done here in a reproducible fashion results in a more biologically meaningful cell stratification.</p>
            </sec>
        </sec>
        <sec>
            <title>Differential analysis</title>
            <p>For the dataset used in this workflow
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>,
                    <xref ref-type="bibr" rid="ref-21">21</xref>
                </sup>, we perform three types of analyses that aim to identify subsets of PBMCs and signaling markers that respond to BCR/FcR-XL stimulation, by comparing stimulated samples to unstimulated samples. We first describe differential abundance of the defined cell populations, followed by differential analysis of marker expression within each cluster. Finally, differential analysis of the overall aggregated marker expression could also be of interest.</p>
            <p>The PBMC subsets analyzed in this workflow originate from a paired experiment, where samples from 8 patients were treated  with 12 different  stimulation conditions for 30  minutes, together with  unstimulated reference samples
                <sup>
                    <xref ref-type="bibr" rid="ref-21">21</xref>
                </sup>. This is a natural example where one would choose a mixed model to model the response (abundance or marker signal), and patients would be treated as a random effect. In this way, one can formally account for between-patient variability, observed to be quite strong in the MDS plot (
                <xref ref-type="other" rid="S7">MDS plot section</xref>), and this should give a gain in power to detect differences between conditions.</p>
            <p>We use the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/diffcyt">diffcyt</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-13">13</xref>
                </sup> to perform the differential analyses. This package includes implementations of various methods for differential testing, including linear mixed models. The mixed models methodology uses the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://stat.ethz.ch/R-manual/R-patched/library/stats/html/00Index.html">stats</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=lme4">lme4</ext-link>
                </italic> packages to fit the fixed and mixed models, respectively, and the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=multcomp">multcomp</ext-link>
                </italic> package for hypothesis testing.</p>
            <p>In all differential analyses here, we want to test for differences between the reference (
                <monospace>Ref</monospace>) and BCR/FcR-XL treatment (
                <monospace>BCRXL</monospace>). The fixed model formula is straightforward: 
                <monospace>~ condition,</monospace> where 
                <monospace>condition</monospace> indicates the treatment group. The corresponding full model design matrix consists of the intercept and dummy variable indicating the treated samples. In the presence of covariates (e.g., batch), one can include them in the model by using a formula 
                <monospace>~ condition + covariate</monospace>, or if they affect the treatment, a formula with interactions 
                <monospace>~ condition * covariate</monospace>. When using the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/diffcyt">diffcyt</ext-link>
                </italic> package, the model formula can be set up in the required format using the 
                <monospace>createFormula()</monospace> function.</p>
            <p>For testing, the mixed models methodology uses the general linear hypotheses function 
                <monospace>glht()</monospace> from the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://CRAN.R-project.org/package=multcomp">multcomp</ext-link>
                </italic> package, which allows testing of arbitrary hypotheses using t-tests. In our analysis, the contrast indicates a regression coefficient to be tested equal to zero; i.e., that there is no effect of the BCR/FcR-XL treatment. The result of the test is a p-value that indicates the probability of observing an as strong (or stronger) difference between the two conditions assuming the null hypothesis is true. The linear hypotheses to be tested are specified using a contrast matrix, where the number of rows of the contrast matrix equals the number of columns of the design matrix. When using the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/diffcyt">diffcyt</ext-link>
                </italic> package, the contrast matrix can be created in the required format using the 
                <monospace>createContrast()</monospace> function.</p>
            <p>Testing is performed on each cluster and marker separately, resulting in 8 tests for differential abundance (one for each merged population), 14 tests for overall differential marker expression analysis and 8 x 14 tests for differential marker expression within populations. Thus, to account for the multiple testing correction, we apply the Benjamini-Hochberg adjustment to each of them using a false discovery rate (FDR) cutoff of 5%.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#000000">FDR_cutoff &lt;- </styled-content>
                    <styled-content style="font-size:12px;color:#0000CF">0.05</styled-content>
                </preformat>
            </p>
            <sec>
                <title>Differential cell population abundance</title>
                <p>Differential analysis of cell population abundance compares the proportions of cell types across experimental conditions and aims to highlight populations that are present at different ratios. First, we calculate two tables: one that contains cell counts for each sample and population and one with the corresponding proportions of cell types by sample. The proportions are used only for plotting, since the statistical modeling takes the cell counts by cluster and sample as input.</p>
                <p>For each sample, we plot its PBMC cell type composition represented with colored bars, where the size of a given stripe reflects the proportion of the corresponding cell type in a given sample (
                    <xref ref-type="fig" rid="f20">Figure 20</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotAbundances</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"sample_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f20" orientation="portrait" position="float">
                    <label>Figure 20. </label>
                    <caption>
                        <title>Relative abundance of the 8 PBMC populations in each sample (x-axis), in the PBMC dataset, represented with a barplot.</title>
                        <p>The 8 cell populations are a result of manual merging of the 20 FlowSOM metaclusters.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure20.gif"/>
                </fig>
                <p>It may be quite hard to see the differences in cluster abundances in the plot above, especially for clusters with very low frequency. And, since boxplots cannot represent multimodal distributions, we show boxplots with jittered points of the sample-level cluster proportions overlaid (
                    <xref ref-type="fig" rid="f21">Figure 21</xref>). The y-axes are scaled to the range of data plotted for each cluster, to better visualize the differences in frequency of lower abundance clusters. For this experiment, it may be interesting to additionally depict the patient information. We do this by plotting a different point shape for each patient. Indeed, we can see that often the direction of abundance changes between the two conditions are concordant among the patients.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotAbundances</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"cluster_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">shape = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"patient_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f21" orientation="portrait" position="float">
                    <label>Figure 21. </label>
                    <caption>
                        <title>Relative abundance of the 8 PBMC populations in each sample, in the PBMC dataset, represented with boxplots.</title>
                        <p>Values for the two conditions are indicated with different colors: red for the unstimulated (Ref) and blue for the stimulated with BCR/FcR-XL (BCRXL) samples. Values for each patient are indicated with different shape. The 8 cell populations are a result of manual merging of the 20 FlowSOM metaclusters.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure21.gif"/>
                </fig>
                <p>Since our goal is to compare proportions, one could take these values, transform them (e.g., logit) and use them as a dependent variable in a linear model. However, this approach does not take into account the uncertainty of proportion estimates, which is higher when ratios are calculated for samples with lower total cell counts. A distribution that naturally accounts for such uncertainty is the binomial distribution (i.e., logistic regression), which takes the cell counts as input (relative to the total for each sample). Nevertheless, as in genomic data analysis, pure logistic regression is not able to capture the overdispersion that is present in HDCyto data. A natural extension to model the extra variation is the generalized linear mixed model (GLMM), where the random effect is defined by the sample ID (observation-level random effects
                    <sup>
                        <xref ref-type="bibr" rid="ref-43">43</xref>,
                        <xref ref-type="bibr" rid="ref-44">44</xref>
                    </sup>). Additionally, in our example the patient pairing could be accounted in the model by incorporating a random intercept for each patient. Thus, we present two GLMMs. Both of them comprise a random effect defined by the sample ID to model the overdispersion in proportions. The second model includes a random effect defined by the patient ID to account for the experiment pairing.</p>
                <p>In our model, the blocking variable is patient ID 
                    <italic toggle="yes">i</italic> = 1, ..., 
                    <italic toggle="yes">n</italic>, where 
                    <italic toggle="yes">n</italic> = 8. For each patient, there are 
                    <italic toggle="yes">n
                        <sub>i</sub>
                    </italic> samples measured, and 
                    <italic toggle="yes">j</italic> = 1, ..., 
                    <italic toggle="yes">n
                        <sub>i</sub>
                    </italic> indicates the sample ID. Here, 
                    <italic toggle="yes">n
                        <sub>i</sub>
                    </italic> = 2 for all 
                    <italic toggle="yes">i</italic> (one from reference and one from BCR/FcR-XL stimulated).</p>
                <p>We assume that for a given cell population, the cell counts 
                    <italic toggle="yes">Y
                        <sub>ij</sub>
                    </italic> follow a binomial distribution 
                    <italic toggle="yes">Y
                        <sub>ij</sub> &#x223c; Bin</italic>(
                    <italic toggle="yes">m
                        <sub>ij</sub>
                    </italic>, 
                    <italic toggle="yes">&#x03c0;
                        <sub>ij</sub>
                    </italic>), where 
                    <italic toggle="yes">m
                        <sub>ij</sub>
                    </italic> is a total number of cells in a sample corresponding to patient 
                    <italic toggle="yes">i</italic> and condition 
                    <italic toggle="yes">j</italic>.</p>
                <p>The GLMM with observation-level random effects 
                    <italic toggle="yes">&#x03be;
                        <sub>ij</sub>
                    </italic> is defined as follows:</p>
                <p>
                    <disp-formula id="e1">
                        <mml:math display="block" id="math1">
                            <mml:mrow>
                                <mml:mi>E</mml:mi>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>Y</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>|</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="false">)</mml:mo>
                                <mml:mo>=</mml:mo>
                                <mml:mi>l</mml:mi>
                                <mml:mi>o</mml:mi>
                                <mml:mi>g</mml:mi>
                                <mml:mi>i</mml:mi>
                                <mml:msup>
                                    <mml:mi>t</mml:mi>
                                    <mml:mrow>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:msup>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="false">)</mml:mo>
                                <mml:mo>,</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula>
                </p>
                <p>where 
                    <inline-formula>
                        <mml:math display="inline" id="math2">
                            <mml:mrow>
                                <mml:msub>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>&#x223c;</mml:mo>
                                <mml:mi>N</mml:mi>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:mn>0</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:msubsup>
                                    <mml:mi>&#x03c3;</mml:mi>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:msubsup>
                                <mml:mo stretchy="false">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </inline-formula> and 
                    <italic toggle="yes">x
                        <sub>ij</sub>
                    </italic> corresponds to the 
                    <monospace>conditionBCRXL</monospace> column in the design matrix and indicates whether a sample 
                    <italic toggle="yes">ij</italic> belongs to the reference (
                    <italic toggle="yes">x
                        <sub>ij</sub>
                    </italic> = 0) or treated condition (
                    <italic toggle="yes">x
                        <sub>ij</sub>
                    </italic> = 1). Since 
                    <italic toggle="yes">E</italic>(
                    <italic toggle="yes">Y
                        <sub>ij</sub>|&#x03b2;</italic>
                    <sub>0</sub>, 
                    <italic toggle="yes">&#x03b2;</italic>
                    <sub>1</sub>, 
                    <italic toggle="yes">&#x03be;
                        <sub>ij</sub>
                    </italic>) = 
                    <italic toggle="yes">&#x03c0;
                        <sub>ij</sub>
                    </italic>, the above formula can be written as follows:</p>
                <p>
                    <disp-formula id="e2">
                        <mml:math display="block" id="math3">
                            <mml:mrow>
                                <mml:mi>l</mml:mi>
                                <mml:mi>o</mml:mi>
                                <mml:mi>g</mml:mi>
                                <mml:mi>i</mml:mi>
                                <mml:mi>t</mml:mi>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03c0;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="false">)</mml:mo>
                                <mml:mo>=</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>.</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula>
                </p>
                <p>The GLMM that furthermore accounts for the patient pairing incorporates additionally a random intercept for each patient 
                    <italic toggle="yes">i</italic>:</p>
                <p>
                    <disp-formula id="e3">
                        <mml:math display="block" id="math4">
                            <mml:mrow>
                                <mml:mi>E</mml:mi>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>Y</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>|</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="false">)</mml:mo>
                                <mml:mo>=</mml:mo>
                                <mml:mi>l</mml:mi>
                                <mml:mi>o</mml:mi>
                                <mml:mi>g</mml:mi>
                                <mml:mi>i</mml:mi>
                                <mml:msup>
                                    <mml:mi>t</mml:mi>
                                    <mml:mrow>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:msup>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03be;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="false">)</mml:mo>
                                <mml:mo>,</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula> where 
                    <inline-formula>
                        <mml:math display="inline" id="math5">
                            <mml:mrow>
                                <mml:msub>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>&#x223c;</mml:mo>
                                <mml:mi>N</mml:mi>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:mn>0</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:msubsup>
                                    <mml:mi>&#x03c3;</mml:mi>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:msubsup>
                                <mml:mo stretchy="false">)</mml:mo>
                                <mml:mo>.</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </inline-formula>
                </p>
                <p>We set up the model formulas and contrast matrix using the 
                    <monospace>createFormula()</monospace> and 
                    <monospace>createContrast()</monospace> functions from the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                    </italic> package. These functions create the model formulas and contrast matrix in the required format for the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                    </italic> testing functions. For more details, see 
                    <monospace>?createFormula</monospace> and 
                    <monospace>?createContrast</monospace>, or refer to the extended documentation in the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                    </italic> vignette (
                    <ext-link ext-link-type="uri" xlink:href="http://bioconductor.org/packages/release/bioc/vignettes/diffcyt/inst/doc/diffcyt_workflow.html">diffcyt workflow</ext-link>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">ei &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">metadata</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">experiment_info</styled-content> 

                        <styled-content style="font-size:12px;color:#000000">(da_formula1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">createFormula</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(ei,  </styled-content>                   

                        <styled-content style="font-size:12px;color:#214A87">    cols_fixed = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,      </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    cols_random = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"sample_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">))    </styled-content>


                        <styled-content style="font-size:12px;color:#000000">## $formula
## y ~ condition + (1 | sample_id)
## &lt;environment: 0x7fab710b3b90&gt;</styled-content>

                        <styled-content style="font-size:12px;color:#000000">##
## $data
##    condition sample_id
## 1      BCRXL    BCRXL1
## 2        Ref      Ref1
## 3      BCRXL    BCRXL2
## 4        Ref      Ref2
## 5      BCRXL    BCRXL3
## 6        Ref      Ref3
## 7      BCRXL    BCRXL4
## 8        Ref      Ref4
## 9      BCRXL    BCRXL5
## 10       Ref      Ref5
## 11     BCRXL    BCRXL6
## 12       Ref      Ref6
## 13     BCRXL    BCRXL7
## 14       Ref      Ref7
## 15     BCRXL    BCRXL8
## 16       Ref      Ref8
##
## $random_terms
## [1] TRUE</styled-content>


                        <styled-content style="font-size:12px;color:#000000">(da_formula2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">createFormula</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(ei,               </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    cols_fixed = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,                   </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    cols_random = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">c</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"sample_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"patient_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)))</styled-content>


                        <styled-content style="font-size:12px;color:#000000">## $formula
## y ~ condition + (1 | sample_id) + (1 | patient_id)
## &lt;environment: 0x7fab7964e468&gt;</styled-content>

                        <styled-content style="font-size:12px;color:#000000">##
## $data
##    condition sample_id patient_id
## 1      BCRXL    BCRXL1   Patient1
## 2        Ref      Ref1   Patient1
## 3      BCRXL    BCRXL2   Patient2
## 4        Ref      Ref2   Patient2
## 5      BCRXL    BCRXL3   Patient3
## 6        Ref      Ref3   Patient3
## 7      BCRXL    BCRXL4   Patient4
## 8        Ref      Ref4   Patient4
## 9      BCRXL    BCRXL5   Patient5
## 10       Ref      Ref5   Patient5
## 11     BCRXL    BCRXL6   Patient6
## 12       Ref      Ref6   Patient6
## 13     BCRXL    BCRXL7   Patient7
## 14       Ref      Ref7   Patient7
## 15     BCRXL    BCRXL8   Patient8
## 16       Ref      Ref8   Patient8
##
## $random_terms
## [1] TRUE</styled-content>


                        <styled-content style="font-size:12px;color:#000000">contrast &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">createContrast</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">c</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">0</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">1</styled-content>
                        <styled-content style="font-size:12px;color:#000000">))</styled-content>
                    </preformat>
                </p>
                <p>The 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                    </italic> package provides three methods for differential abundance (DA) analyses, and two methods for differential state (DS) analyses. For an explanation and comparison of the different methods, see 
                    <xref ref-type="bibr" rid="ref-13">13</xref>. Here, we use the DA methodology based on mixed models, which is implemented in the method 
                    <monospace>diffcyt-DA-GLMM</monospace>. This method can be selected by providing the arguments 
                    <monospace>method = "DA" and method_DA = "diffcyt-DA-GLMM"</monospace> to the 
                    <monospace>diffcyt()</monospace> wrapper function (for more details, see 
                    <monospace>?diffcyt</monospace>). As our 
                    <monospace>daFrame</monospace> contains a total of 22 clusterings (1 high-resolution, 19 consensus mergings, and 2 manual mergings), we also specify the clustering of interest via 
                    <monospace>clustering_to_use   =   "merging1"</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">da_res1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">diffcyt</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf,                                            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    formula = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">da_formula1, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">contrast = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">contrast,                    </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    analysis_type = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"DA"</styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">method_DA =</styled-content> 
                        <styled-content style="font-size:12px;color:#4F9905">"diffcyt-DA-GLMM"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,           </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    clustering_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#214A87">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">verbose = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)               </styled-content>

                        <styled-content style="font-size:12px;color:#000000">da_res2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">diffcyt</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf,                                            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    formula = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">da_formula2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">contrast = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">contrast,</styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    analysis_type = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"DA"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">method_DA = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"diffcyt-DA-GLMM"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,           </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    clustering_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">verbose = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)               </styled-content>
                    </preformat>
                </p>
                <p>The 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                    </italic> output consists of a list containing several 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/SummarizedExperiment.html">SummarizedExperiment</ext-link>
                    </italic> objects. The differential test results are stored in the 
                    <monospace>rowData</monospace> slot of the results object 
                    <monospace>res</monospace>, and can be accessed using the 
                    <monospace>rowData()</monospace> accessor function from the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/SummarizedExperiment.html">SummarizedExperiment</ext-link>SummarizedExperiment</italic> package. The results include raw p-values (
                    <monospace>p_val</monospace>) and adjusted p-values (
                    <monospace>p_adj</monospace>) for each cluster (for DA tests) or cluster-marker combination (for DS tests), which can be used to rank the clusters or cluster-marker combinations by their evidence for differential abundance (DA tests) or differential states within cell populations (DS tests).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">names</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(da_res1)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">## [1] "res"                           "d_counts"
## [3] "d_medians"                     "d_medians_by_cluster_marker"
## [5] "d_medians_by_sample_marker"</styled-content>


                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(da_res1</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">res)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">## DataFrame with 8 rows and 3 columns
##                cluster_id                p_val                p_adj
##                  &lt;factor&gt;            &lt;numeric&gt;            &lt;numeric&gt;
## B-cells IgM+ B-cells IgM+   0.0134820784148451   0.0409234214313668
## B-cells IgM- B-cells IgM-  0.00554110806328434   0.0409234214313668
## CD4 T-cells   CD4 T-cells   0.0376717369512436   0.0753434739024872
## CD8 T-cells   CD8 T-cells   0.0153462830367626   0.0409234214313668
## DC                     DC    0.415414330818059    0.476379043464654
## NK cells         NK cells    0.416831663031572    0.476379043464654
## monocytes       monocytes    0.547254574996547    0.547254574996547
## surface-         surface-    0.371991525392299    0.476379043464654</styled-content>
                    </preformat>
                </p>
                <p>When we count the number of differential findings for both GLMMs specified above, we find that accounting for the patient pairing increases the sensitivity to detect differentially abundant cell populations.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weightbold">table</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(da_res1</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">res)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">p_adj </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">&lt; </styled-content>
                        <styled-content style="font-size:12px;color:#000000">FDR_cutoff)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">##
## FALSE TRUE
##     5    3</styled-content>


                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">table</styled-content>(
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(da_res2</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">res)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">p_adj </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">&lt; </styled-content>
                        <styled-content style="font-size:12px;color:#000000">FDR_cutoff)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">##
## FALSE TRUE
##     2    6</styled-content>
                    </preformat>
                </p>
                <p>A summary table displaying the results (raw and adjusted p-values) together with the observed cell population proportions by sample can be generated using 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/bioc/html/diffcyt.html">diffcyt</ext-link>
                    </italic> &#x2019;s 
                    <monospace>topTable()</monospace> function. For more details, see 
                    <monospace>?topTable</monospace>.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">topTable</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(da_res2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">show_props = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">format_vals = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">digits = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">2</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">## DataFrame with 8 rows and 19 columns
##                cluster_id     p_val     p_adj props_Ref1 props_Ref2
##                  &lt;factor&gt; &lt;numeric&gt; &lt;numeric&gt;  &lt;numeric&gt;  &lt;numeric&gt;
## NK cells         NK cells   4.5e-13   3.6e-12       14.3        9.7
## B-cells IgM- B-cells IgM-   2.2e-11   8.8e-11        1.9        1.3
## B-cells IgM+ B-cells IgM+   3.5e-08   9.2e-08        4.8        2.8
## DC                     DC   7.1e-05   0.00014        0.2        0.9
## CD8 T-cells   CD8 T-cells    0.0012    0.0019       23.7       23.8
## CD4 T-cells   CD4 T-cells    0.0019    0.0025       44.7       49.1
## surface-         surface-      0.22      0.26        2.8        2.5
## monocytes       monocytes      0.26      0.26        7.6        9.9
##              props_Ref3 props_Ref4 props_Ref5 props_Ref6 props_Ref7
##               &lt;numeric&gt;  &lt;numeric&gt;  &lt;numeric&gt;  &lt;numeric&gt;  &lt;numeric&gt;
## NK cells           15.1       14.5       10.2        6.7       22.5
## B-cells IgM-        3.3        1.4        2.5        2.3        2.8
## B-cells IgM+        8.3        4.7        4.4        5.7        4.3
## DC                  1.2        1.2        1.6        0.9        0.9
## CD8 T-cells        15.5       17.6         26       25.3       33.5
## CD4 T-cells        39.7       32.4       38.4       47.3       28.2
## surface-              2        1.4        2.3        3.3        2.1
## monocytes          14.9       26.9       14.5        8.5        5.6
##              props_Ref8 props_BCRXL1 props_BCRXL2 props_BCRXL3
##               &lt;numeric&gt;    &lt;numeric&gt;    &lt;numeric&gt;    &lt;numeric&gt;
## NK cells             11         15.6         11.7         16.6
## B-cells IgM-        2.2          1.1            1            2
## B-cells IgM+        3.8          3.9          1.4          4.1
## DC                  0.9          0.2          0.8          1.5
## CD8 T-cells        34.2         46.1         40.9         26.5
## CD4 T-cells        36.9         26.8         35.8         32.3
## surface-            2.4          1.8            2          2.3
## monocytes           8.5          4.5          6.4         14.7
##              props_BCRXL4 props_BCRXL5 props_BCRXL6 props_BCRXL7
##                 &lt;numeric&gt;    &lt;numeric&gt;    &lt;numeric&gt;    &lt;numeric&gt;
## NK cells             18.3         12.6          6.8         25.5
## B-cells IgM-          1.1          1.5          1.2          2.1
## B-cells IgM+          3.8          3.9            4          2.6
## DC                    1.4          2.1          1.4          1.2
## CD8 T-cells          25.9         28.2         24.6         34.3
## CD4 T-cells          31.8         36.7         44.1         26.8
## surface-              1.9          2.1          2.7          1.8
## monocytes            15.7         12.9         15.2          5.7
##              props_BCRXL8
##                 &lt;numeric&gt;
## NK cells             12.9
## B-cells IgM-          1.7
## B-cells IgM+          2.7
## DC                    1.2
## CD8 T-cells          39.7
## CD4 T-cells          31.5
## surface-              2.4
## monocytes             7.8</styled-content>
                    </preformat>
                </p>
                <p>We use a heatmap to report the differential cell populations (
                    <xref ref-type="fig" rid="f22">Figure 22</xref>). Proportions are first scaled with the arcsine-square-root transformation (as an alternative to logit that cannot be calculated on ratios of zero or one). Then, z-score normalization is applied to each population to better highlight the relative differences between compared conditions. In addition, the clusters are sorted according to adjusted p-values.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotDiffHeatmap</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, da_res2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">th = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">FDR_cutoff, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">normalize = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">hm1 = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f22" orientation="portrait" position="float">
                    <label>Figure 22. </label>
                    <caption>
                        <title>DA test results and normalized proportions for PBMC cell populations in BCR/FcR-XL stimulated and unstimulated conditions.</title>
                        <p>The heat represents arcsine-square-root transformed cell frequencies that were subsequently normalized per cluster (rows) to mean of zero and standard deviation of one. The color of the heat varies from blue indicating relative under-representation to orange indicating relative over-representation. Bars at the top of the heatmap indicate patient IDs and the condition the samples (columns) belong to: red for  the  unstimulated (Ref)  and  brown  for  the stimulated with  BCR/FcR-XL  (BCRXL)  condition.  Bar and numbers at the right indicate significant differentially abundant clusters (green) and adjusted p-values. Clusters are sorted according to adjusted p-values, so that the cluster at the top shows the most significant abundance changes between the two conditions.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure22.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Differential analysis of marker expression stratified by cell population</title>
                <p>For this part of the analysis, we calculate the median expression of the 14 signaling markers in each cell population (merged cluster) and sample. These will be used as the response variable 
                    <italic toggle="yes">Y
                        <sub>ij</sub>
                    </italic> in the linear model (LM) or linear mixed model (LMM), for which  we assume that the median marker expression follows a Gaussian distribution (on the already arcsinh-transformed scale). Analogous to the model above, the linear model is formulated as follows:</p>
                <p>
                    <disp-formula id="e4">
                        <mml:math display="block" id="math6">
                            <mml:mrow>
                                <mml:msub>
                                    <mml:mi>Y</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>=</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03f5;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula>
                </p>
                <p>where 
                    <italic toggle="yes">&#x2208;
                        <sub>ij</sub> &#x223c; N</italic>(0, 
                    <italic toggle="yes">&#x03c3;</italic>
                    <sup>2</sup>), and the mixed model includes a random intercept for each patient:</p>
                <p>
                    <disp-formula id="e5">
                        <mml:math display="block" id="math7">
                            <mml:mrow>
                                <mml:msub>
                                    <mml:mi>Y</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>=</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b2;</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>&#x03f5;</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mi>j</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula>
                </p>
                <p>where 
                    <inline-formula>
                        <mml:math display="inline" id="math8">
                            <mml:mrow>
                                <mml:msub>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>&#x223c;</mml:mo>
                                <mml:mi>N</mml:mi>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:mn>0</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:msubsup>
                                    <mml:mi>&#x03c3;</mml:mi>
                                    <mml:mi>&#x03b3;</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:msubsup>
                                <mml:mo stretchy="false">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
                    </inline-formula>. In the current experiment, we have an intercept (basal level) and a single covariate, 
                    <italic toggle="yes">x
                        <sub>ij</sub>
                    </italic>, which is represented as a binary (stimulated/unstimulated) variable. For more complicated designs or batch effects, additional columns of a design matrix can be used.</p>
                <p>One drawback of summarizing the protein marker intensity with a median over cells is that all the other characteristics of the distribution, such as bimodality, skewness and variance, are ignored. On the other hand, it results in a simple, easy to interpret approach, which in many cases will be able to detect interesting changes. Another issue that arises from using a summary statistic is the level of uncertainty, which increases as the number of cells used to calculate it decreases. In the statistical modeling, this problem could be partially handled by assigning observation weights (number of cells) to each cluster and sample (parameter 
                    <monospace>weights</monospace> in the 
                    <monospace>lm</monospace> and 
                    <monospace>lmer</monospace> functions used within the 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/diffcyt">diffcyt</ext-link>
                    </italic> testing functions). However, since each cluster is tested separately, these weights do not account for the differences in size between clusters.</p>
                <p>There might be instances of small cell populations for which no cells are observed in some samples or where the number of cells is very low. For clusters absent from a sample (e.g., due to biological variance or insufficient sampling), NAs are introduced because no median expression can be calculated; in the case of few cells, the median may be quite variable. Thus, we apply a filter to remove clusters with very low counts (by default, clusters are kept if they have at least 3 cells in at least half the total number of samples, which is appropriate for a two-group comparison with equal numbers of samples per condition).</p>
                <p>It is helpful to plot the median expression of all markers in each cluster for each sample colored by condition, to get a rough image of how strong the differences might be (
                    <xref ref-type="fig" rid="f23">Figure 23</xref>). We do this by combining boxplots and jitter.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">p &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">plotMedExprs</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">facet = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"cluster_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,</styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    shape_by =</styled-content> 
                        <styled-content style="font-size:12px;color:#4F9905">"patient_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)                                </styled-content>

                        <styled-content style="font-size:12px;color:#000000">p</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">facet</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">params</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">ncol &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF">2                                    </styled-content>

                        <styled-content style="font-size:12px;color:#000000">p                                                           </styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f23" orientation="portrait" position="float">
                    <label>Figure 23. </label>
                    <caption>
                        <title>Median (arcsinh-transformed) expression of 14 signaling markers (x-axis) across the 8 identified PBMC cell populations (individual panels).</title>
                        <p>Values for the two conditions are indicated with different colors: red for the unstimulated (Ref) and blue for the stimulated with BCR/FcR-XL (BCRXL) samples. Values for each patient are indicated with different shape. The 8 cell populations are a result of manual merging of the 20 FlowSOM metaclusters.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure23.gif"/>
                </fig>
                <p>To present how accounting for the between patient variability with the mixed model increases sensitivity, we also fit a regular linear model. The linear mixed model has a random intercept for each patient.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">ds_formula1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">createFormula</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(ei, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">cols_fixed = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)</styled-content>

                        <styled-content style="font-size:12px;color:#000000">ds_formula2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">createFormula</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(ei,                          </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    cols_fixed = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"condition"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">cols_random = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"patient_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">) </styled-content>
                    </preformat>
                </p>
                <p>Using 
                    <italic toggle="yes">
                        <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/diffcyt">diffcyt</ext-link>
                    </italic>, we calculate differential tests using method 
                    <monospace>diffcyt-DS-LMM</monospace>, which implements the DS methodology based on mixed models. This method can be selected by providing the arguments 
                    <monospace>method = "DS"</monospace> and 
                    <monospace>method_DS = "diffcyt-DS-LMM"</monospace> to the 
                    <monospace>diffcyt()</monospace> wrapper function. The remaining arguments are the same as for the DA tests.</p>
                <p>By accounting for the patient effect, we detect almost twice as many cases of differential signaling compared to the regular linear model.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000">ds_res1 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">diffcyt</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(daf,                                            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    formula = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">ds_formula1, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">contrast = </styled-content>
                        <styled-content style="font-size:12px;color:#000000">contrast,                    </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    analysis_type = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"DS"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">method_DS = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"diffcyt-DS-LMM"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">,            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87">    clustering_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87">verbose = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)               </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">table</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000">(ds_res1</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">res)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000">p_adj </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold">&lt; </styled-content>
                        <styled-content style="font-size:12px;color:#000000">FDR_cutoff)                     </styled-content>


                        <styled-content style="font-size:12px;color:#000000">##
## FALSE TRUE
##    68   44</styled-content>
                    </preformat>
                </p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ds_res2 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">diffcyt</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf,                                            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    formula = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ds_formula2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">contrast = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">contrast,                    </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    analysis_type = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"DS"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">method_DS = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"diffcyt-DS-LMM"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    clustering_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"merging1"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">verbose = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)               </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">table</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(ds_res2</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">res)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">p_adj </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">&lt; </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">FDR_cutoff)                     </styled-content>


                        <styled-content style="font-size:12px;color:#000000">##
## FALSE TRUE
##    28   84</styled-content>
                    </preformat>
                </p>
                <p>
                    <monospace>topTable()</monospace> is again used to assemble a summary table.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">topTable</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(ds_res2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">top_n = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">5</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">order_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"cluster_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,</styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    show_meds = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">format_vals = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">digits = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">3</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">## DataFrame with 5 rows and 20 columns
##                cluster_id marker_id     p_val     p_adj meds_Ref1
##                  &lt;factor&gt;  &lt;factor&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt;
## B-cells IgM+ B-cells IgM+     pNFkB  6.74e-11  3.43e-10     1.964
## B-cells IgM+ B-cells IgM+      pp38    0.0017   0.00355     0.889
## B-cells IgM+ B-cells IgM+    pStat5    0.0348    0.0464    -0.039
## B-cells IgM+ B-cells IgM+      pAkt  6.11e-14  4.56e-13     2.319
## B-cells IgM+ B-cells IgM+    pStat1    0.0714    0.0889    -0.006
##              meds_Ref2 meds_Ref3 meds_Ref4 meds_Ref5 meds_Ref6 meds_Ref7
##              &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt;
## B-cells IgM+     1.869     1.773     2.183     1.861     1.953     1.915
## B-cells IgM+     1.113     0.853     0.642     0.126      0.21     0.128
## B-cells IgM+    -0.049    -0.048    -0.024    -0.057    -0.061    -0.054
## B-cells IgM+      2.31     2.269     3.086     1.729     2.024     2.145
## B-cells IgM+     0.064     0.008     0.515    -0.047      0.03    -0.034
##              meds_Ref8 meds_BCRXL1 meds_BCRXL2 meds_BCRXL3 meds_BCRXL4
##              &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;
## B-cells IgM+     1.979       1.179        0.88       0.808       1.473
## B-cells IgM+     0.126       0.109      -0.012       0.044       0.245
## B-cells IgM+    -0.053      -0.037      -0.037      -0.029       0.056
## B-cells IgM+     2.603       3.247        2.96       2.951       3.257
## B-cells IgM+     0.191       0.343       0.126       0.242       0.333
##              meds_BCRXL5 meds_BCRXL6 meds_BCRXL7 meds_BCRXL8
##                &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;
## B-cells IgM+       1.361       1.725       1.436       1.575
## B-cells IgM+      -0.046       0.083      -0.039      -0.005
## B-cells IgM+      -0.067      -0.015      -0.051      -0.039
## B-cells IgM+       2.382       3.184       2.762       3.144
## B-cells IgM+       -0.01       0.616       -0.05       0.379</styled-content>
                    </preformat>
                </p>
                <p>We use a heatmap to report the differential signals (
                    <xref ref-type="fig" rid="f24">Figure 24</xref>). Instead of plotting the absolute expression, we display the normalized expression, which better highlights the direction of marker changes. In addition, the cluster-marker combinations are sorted according to adjusted p-value.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">plotDiffHeatmap</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf, ds_res2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">top_n = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">50</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">order = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,    </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    th = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">FDR_cutoff, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">normalize = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">hm1 = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)        </styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f24" orientation="portrait" position="float">
                    <label>Figure 24. </label>
                    <caption>
                        <title>DS test results and normalized expression of signaling markers in PBMC populations in BCR/FcR- XL stimulated and unstimulated conditions.</title>
                        <p>The heat represents median (arcsinh-transformed) marker expression that was subsequently normalized per cluster-marker combination (rows) to mean of zero and standard deviation of one. The color of the heat varies from blue representing relative under-expression to orange representing relative over-expression. Bars at the top of the heatmap indicate patient IDs and the condition the samples (columns) belong to: red for the unstimulated (Ref) and brown for the stimulated with BCR/FcR-XL (BCRXL) condition. Bar and numbers at the right indicate significant differential cluster-marker combinations (green) and adjusted p-values. Cluster-marker combinations are sorted according to adjusted p-value, so that the cluster-marker combinations at the top show the most significant differential signals between the two conditions. Shown are only the top 50 most highly significant cluster-marker combinations.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure24.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Differential analysis of overall marker expression</title>
                <p>The analysis of 
                    <italic toggle="yes">overall</italic> expression is analogous to the previous section, except that median marker expression is aggregated from all the cells in a given sample. For this, we generate an artificial clustering with all cells assigned to a single cluster.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">daf &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">mergeClusters</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">k = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"meta20"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">id = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"merging_all"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    table = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">data.frame</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">old_cluster = </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">seq_len</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(</styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">20</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">), </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">new_cluster = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"all"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">))</styled-content>
                    </preformat>
                </p>
                <p>As before, the median expression can be plotted (
                    <xref ref-type="fig" rid="f25">Figure 25</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">p &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">plotMedExprs</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf[, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">state_markers</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf)], </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">shape_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"patient_id"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)</styled-content>

                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">p</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">facet</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">params</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ncol &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">3                                             </styled-content>

                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">p                                                                    </styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f25" orientation="portrait" position="float">
                    <label>Figure 25. </label>
                    <caption>
                        <title>Median (arcsinh-transformed) expression of 14 signaling markers calculated from all the cells in a given sample in the PBMC dataset.</title>
                        <p>Values for the two conditions are indicated with different colors: red for the unstimulated (Ref) and blue for the stimulated with BCR/FcR-XL (BCRXL) samples. Values for each patient are indicated with different shape.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure25.gif"/>
                </fig>
                <p>Similar to the analysis above, we identify more markers being differentially expressed with the LMM, which accounts for the between patient variability.</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic; background-color:#F8F8F8"># fit linear model                                                 </styled-content>

                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ds_res3 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">diffcyt</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf,                                            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    formula = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ds_formula1, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">contrast = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">contrast,                    </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    analysis_type = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"DS"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">method_DS = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"diffcyt-DS-LMM"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    clustering_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"merging_all"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">verbose = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000">)            </styled-content>

                        <styled-content style="font-size:12px; background-color:#F8F8F8">                                                                   </styled-content>

                        <styled-content style="font-size:12px;color:#8F5903; font-style:italic; background-color:#F8F8F8"># fit linear mixed model with patient ID as random effect          </styled-content>

                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ds_res4 &lt;- </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">diffcyt</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf,                                            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    formula = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">ds_formula2, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">contrast = </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">contrast,                    </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    analysis_type = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905 ; background-color:#F8F8F8">"DS"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">method_DS = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"diffcyt-DS-LMM"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,            </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    clustering_to_use = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"merging_all"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">verbose = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)            </styled-content>

                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">                                                                   </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">table</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(ds_res3</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">res)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">p_adj </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">&lt; </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">FDR_cutoff)                     </styled-content>


                        <styled-content style="font-size:12px;color:#000000">##
## FALSE TRUE
##     9    5</styled-content>


                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">table</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(</styled-content>
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">rowData</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(ds_res4</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">res)</styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">$</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">p_adj </styled-content>
                        <styled-content style="font-size:12px;color:#CF5C00; font-weight:bold; background-color:#F8F8F8">&lt; </styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">FDR_cutoff)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">##
## FALSE TRUE
##     2   12</styled-content>
                    </preformat>
                </p>
                <p>As before, we create a summary table and heatmap displaying the results (
                    <xref ref-type="fig" rid="f26">Figure 26</xref>).</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">topTable</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(ds_res4, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">top_n = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">5</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">order_by = </styled-content>
                        <styled-content style="font-size:12px;color:#4F9905; background-color:#F8F8F8">"p_adj"</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">,     </styled-content>

                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">    show_meds = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">format_vals = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">digits = </styled-content>
                        <styled-content style="font-size:12px;color:#0000CF; background-color:#F8F8F8">3</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)</styled-content>


                        <styled-content style="font-size:12px;color:#000000">## DataFrame with 5 rows and 20 columns
##     cluster_id marker_id     p_val     p_adj meds_Ref1 meds_Ref2 meds_Ref3
##       &lt;factor&gt;  &lt;factor&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt;</styled-content>

                        <styled-content style="font-size:12px;color:#000000">## all        all      pBtk         0         0     0.566     0.615     0.323
## all        all    pSlp76  2.22e-09  1.56e-08     0.506     0.582     0.184
## all        all     pNFkB  1.33e-08  6.21e-08     2.392     2.469      2.67
## all        all      pAkt  3.55e-07  1.24e-06     2.416     2.122       2.3
## all        all       pS6   1.4e-06  3.92e-06    -0.055    -0.039    -0.002</styled-content>

                        <styled-content style="font-size:12px;color:#000000">##     meds_Ref4 meds_Ref5 meds_Ref6 meds_Ref7 meds_Ref8 meds_BCRXL1
##     &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt; &lt;numeric&gt;   &lt;numeric&gt;</styled-content>

                        <styled-content style="font-size:12px;color:#000000">## all     0.494      0.39     0.471     0.209     0.297      -0.041
## all     0.297     0.358     0.347      0.09     0.133      -0.051
## all      2.94     1.979     2.025      1.98     1.985        1.07
## all     3.273     1.443     1.573      1.68     2.114       3.053
## all     0.138    -0.025    -0.038    -0.032    -0.029       0.102</styled-content>

                        <styled-content style="font-size:12px;color:#000000">##     meds_BCRXL2 meds_BCRXL3 meds_BCRXL4 meds_BCRXL5 meds_BCRXL6
##       &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;   &lt;numeric&gt;</styled-content>

                        <styled-content style="font-size:12px;color:#000000">## all      -0.007      -0.055      -0.016      -0.054      -0.009
## all      -0.058      -0.062      -0.038      -0.071      -0.045
## all        0.52       1.144        1.74       1.143       1.695
## all       2.727       2.876       3.242       1.958       2.607
## all        0.09       0.534       0.373       0.454       0.356
##     meds_BCRXL7 meds_BCRXL8</styled-content>

                        <styled-content style="font-size:12px;color:#000000">##       &lt;numeric&gt;   &lt;numeric&gt;</styled-content>

                        <styled-content style="font-size:12px;color:#000000">## all       -0.07      -0.051
## all      -0.074      -0.063
## all       1.195       1.245
## all       2.075       2.416
## all       0.193        0.07</styled-content>


                        <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">plotDiffHeatmap</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">(daf, ds_res4, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">all = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">TRUE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">, </styled-content>
                        <styled-content style="font-size:12px;color:#214A87; background-color:#F8F8F8">hm1 = </styled-content>
                        <styled-content style="font-size:12px;color:#8F5903; background-color:#F8F8F8">FALSE</styled-content>
                        <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">)</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f26" orientation="portrait" position="float">
                    <label>Figure 26. </label>
                    <caption>
                        <title>DS test results and normalized expression of signaling markers calculated over all cells in PBMC populations in BCR/FcR-XL stimulated and unstimulated conditions.</title>
                        <p>The heat represents median (arcsinh-transformed) marker expression that was subsequently normalized per marker (rows) to mean of zero and standard deviation of one. The color of the heat varies from blue representing relative under-expression to orange representing relative over-expression. Bars at the top of the heatmap indicate patient IDs and the condition the samples (columns) belong to: red for the unstimulated (Ref) and brown for the stimulated with BCR/FcR-XL (BCRXL) condition. Bar and numbers at the  right  indicate  significant  differential  markers (green) and adjusted p-values. Markers are sorted according to adjusted p-value, so that the marker at the top shows the most significant change between the two conditions.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/20556/a2ddd681-3d3c-4434-bd24-616562ae76d6_figure26.gif"/>
                </fig>
            </sec>
        </sec>
        <sec>
            <title>Obtaining higher resolution</title>
            <p id="S13">In the proposed workflow, we concentrated on identification of the main cell types in PBMCs. Our goal was to identify around 6 main cell types. Following the over-clustering strategy, we have chosen to perform the SOM clustering into 100 (by default) groups followed by consensus clustering into 20 groups, from which we could annotate 8 cell types. These 8 cell types were then used in the differential analysis.</p>
            <p>If the number of expected cell types is higher, the user can increase the size of the SOM grid in 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/CATALYST">CATALYST</ext-link>
                </italic>&#x2019;s 
                <monospace>cluster()</monospace> function using the 
                <monospace>xdim</monospace> and 
                <monospace>ydim</monospace> arguments and increase the maximum number of consensus clusters via the 
                <monospace>maxK</monospace> argument.</p>
            <p>One could also use a strategy based on subsequent clustering of identified clusters, which we refer to as 
                <italic toggle="yes">reclustering</italic>. In the starting step, one uses the presented workflow to identify the main cell types. In the following steps, the same clustering workflow is applied individually to the cell populations for which more resolution is desired. Restricting to one subpopulation at a time results in easier cluster annotation. The differential analysis can be applied to the final clusters in the same way as described in the workflow assuming tables with cell counts and median marker expression are available.</p>
            <p>The differential analysis could also be conducted on the unmerged (20) consensus clusters and the manual annotation could be done at the end.</p>
        </sec>
        <sec sec-type="discussion">
            <title>Discussion</title>
            <p id="S12">In this workflow, we have presented a pipeline for diverse differential analyses of HDCyto datasets. First, we highlight quality control steps, where aggregate characteristics of the samples are visualized (e.g., an MDS plot), allowing for verification of the experimental design, detection of batch effects and outlying samples. Next, cell  population  identification  was carried  out  via clustering, which forms the basis for subsequent differential analyses of cell population abundance, differential marker expression  within  a  population  or overall marker expression differences. The approaches to differential analyses proposed here are very general and thus able to model complex experimental designs via design matrices, such as factorial experiments, paired experiments or adjustment for batch effects. We have presented a range of visualizations that help in understanding the data and reporting the results of clustering and differential analyses.</p>
            <p>Clustering is one of the most challenging steps in the workflow, and its accuracy is critical to the downstream differential analyses. Getting the right resolution of clusters is crucial, since there can be situations where a biologically meaningful cell population may be differentially enriched between conditions, but in an automatic clustering, was combined with another cell population that behaves differently. We have shown that some level of over-clustering is convenient for detecting meaningful cell populations, since automatic detection of the number of natural clusters is difficult
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>. However, there are tradeoffs between the resolution of clustering and the labor involved in aggregating them to biologically meaningful clusters. Overall, we take an interactive but flexible algorithm-guided approach together with subject-area experts to arrive at sensible cell populations. In particular, we rely on various visualizations, such as dendrograms, heatmaps, UMAP embeddings or other dimension reduction techniques to guide us in the process. Alternative strategies could be combined with the statistical inference we present, such as over-clustering combined with data-driven aggregation to the optimal resolution.</p>
            <p>While we have a good understanding of how computational algorithms recapitulate manual gating in high dimensions
                <sup>
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>, one of the open areas of research remains how to best cluster 
                <italic toggle="yes">across</italic> samples. The data analyzed here
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>,
                    <xref ref-type="bibr" rid="ref-21">21</xref>
                </sup> was generated using sample barcoding; this strategy reduces inter-sample variability, since all samples are exposed to the same antibody cocktail and measured in a single acquisition
                <sup>
                    <xref ref-type="bibr" rid="ref-26">26</xref>
                </sup>. Thus, the range of marker expression for each channel should, in principle, be within a similar range across samples.</p>
            <p>In our approach, we aggregated all cells together before clustering. Because of this aggregation, the clustering is blind to the sample labels, and thus in principle, does not bias the downstream statistical inferences. Moreover, we directly obtain consistent clustering between samples. However, some challenges may arise when there are substantial differences in numbers of cells in samples. There is a risk that larger samples may drive the final clustering results. A simple solution to this problem could be ensuring that each sample contributes an equal amount of cells into the clustering analysis. This could be done by sampling an equal number of cells from each sample. However, there are two main drawbacks of this strategy. First, a substantial amount of data (cells) may be removed from the analysis if there are samples with few cells, thus resulting in information loss. Second, during downsampling, some of the smaller populations may become under-represented or even skipped. An alternative would be to cluster within each sample and then aggregate a collection of metaclusters across samples
                <sup>
                    <xref ref-type="bibr" rid="ref-45">45</xref>
                </sup>. A recent approach, called PAC-MAN
                <sup>
                    <xref ref-type="bibr" rid="ref-46">46</xref>
                </sup>, uses a combination of high-dimensional density estimation, hierarchical clustering and network inference and comparison to extract clusters across samples, with a possibility to handle batch effects.</p>
            <p>Additional challenges may arise when combining data from different instrument acquisitions and additional preprocessing treatments may need to be applied. Despite adjustments through bead-based normalization
                <sup>
                    <xref ref-type="bibr" rid="ref-25">25</xref>
                </sup>, the observed marker expression may be affected by the varying efficiency of antibody binding in each batch and by the ion detection sensitivity after machine calibration. Beyond normalization, other strategies have been proposed, such as equalizing the dynamic range between batches for each marker (e.g., normalization to the 0&#x2013;1 range, z-scores, quantile normalization), the use of warping functions to eliminate non-linear distortions (see the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/cydar">cydar</ext-link>
                </italic> vignette), landmark-based normalization
                <sup>
                    <xref ref-type="bibr" rid="ref-47">47</xref>
                </sup>, or learning marker distribution shifts between the batches based on a manually gated reference cell type and using it to correct marker expression for the whole dataset
                <sup>
                    <xref ref-type="bibr" rid="ref-9">9</xref>
                </sup>.</p>
            <p>Alternatively, one could consider batch-wise clustering of samples. On the other hand, to be able to use those results, one still needs to match cell populations across batches. The matching could be done manually, or with automated approaches developed for flow cytometry
                <sup>
                    <xref ref-type="bibr" rid="ref-45">45</xref>
                </sup>. However, a comprehensive evaluation of these approaches and their effect on downstream analyses is still missing. Overall, we expect that as a general rule, including batch parameters (or other covariates) in the linear modeling helps to mitigate the problem. In single cell RNA sequencing data, several methods to &#x201c;align&#x201d; samples have been proposed
                <sup>
                    <xref ref-type="bibr" rid="ref-48">48</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-51">51</xref>
                </sup> and these strategies may have applications to cytometry data.</p>
            <p>We presented a classical statistical approach where preprocessing of the HDCyto data leads to tables of summaries (e.g., cell counts) or aggregated measurements (e.g., cluster-specific signals) for each sample, which become the input to a statistical model. Of course, there are a variety of alternative computational approaches available to the user. We have mentioned 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/nolanlab/Citrus">Citrus</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/eiriniar/CellCnn">CellCnn</ext-link>
                </italic>, which are both machine-learning approaches that fit a reverse model to ours (i.e., phenotype of interest as the response variable).</p>
            <p>Another set of methods (
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/MIMOSA">MIMOSA</ext-link>
                </italic> and 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/COMPASS">COMPASS</ext-link>
                </italic>), based on a Bayesian hierarchical framework, was proposed in the vaccine development field, where the antigen-specific T-cell response to stimulation for each subject is modeled using mixtures of beta-binomial or Dirichlet-multinomial distributions
                <sup>
                    <xref ref-type="bibr" rid="ref-52">52</xref>,
                    <xref ref-type="bibr" rid="ref-53">53</xref>
                </sup>. These strategies bear similarity to the mixed models applied for differential abundance in this workflow while handling over-dispersion due to subject-to-subject variability.</p>
            <p>Neither of these approaches are directly able to account for batch effects or complicated designs. However, they may have advantages in the search for rare distinguishing populations, which could be used together with our framework for formal statistical testing.</p>
            <p>One of the main goals of this workflow was to highlight how a model-based approach is able to handle complex experimental designs. This becomes important in many experimental situations where covariates (e.g., age, gender, batch) may affect the observed HDCyto data. Thus, the classical regression framework allows also to flexibly test situations well beyond two-group differences. Of course, alternatives exist for two group comparisons, such as the nonparametric Mann-Whitney-Wilcoxon test
                <sup>
                    <xref ref-type="bibr" rid="ref-6">6</xref>
                </sup>, which makes no assumptions about normality of the data, or the Student&#x2019;s t-test
                <sup>
                    <xref ref-type="bibr" rid="ref-7">7</xref>
                </sup> and its variations, such as the paired t-test.</p>
            <p>We note that the LM, LMM and GLMM may perform poorly for extremely small samples. Here, solutions similar to those widely accepted in transcriptomics that share information over variance parameters
                <sup>
                    <xref ref-type="bibr" rid="ref-54">54</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-56">56</xref>
                </sup> can instead be leveraged. We have recently implemented methods based on these ideas in the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/diffcyt">diffcyt</ext-link>
                </italic> package
                <sup>
                    <xref ref-type="bibr" rid="ref-13">13</xref>
                </sup>. Similarly, the 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/cydar">cydar</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-10">10</xref>
                </sup> package performs differential abundance analysis (on &#x201c;hypersphere&#x201d; counts) using the generalized linear modeling capabilities of 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/edgeR">edgeR</ext-link>
                </italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-11">11</xref>
                </sup>. For a detailed explanation and comparison of these alternative approaches, see 
                <xref ref-type="bibr" rid="ref-13">13</xref>.</p>
            <p>In the differential marker expression analysis, we compare the median marker expression between samples. While in many cases this approach is sufficient to detect interesting changes, by summarizing marker expression over cells to a single value we ignore all the other characteristics of the expression distribution, such as bimodality, skewness and variance, which may be relevant in some studies. Thus, it may be interesting to extend our comparisons to the whole marker distributions, instead of just changes in the medians.</p>
            <p>The approach presented in this workflow is not fully automated due to the cluster merging, annotating, and extensive exploratory data analysis steps. In general, our philosophy is that fully automated analyses are to be avoided, but rather a battery of diagnostic checks can be designed, as we have promoted here. Cluster annotation remains a manual step in many other approaches as well. Recently, a tool was proposed for consistent characterization of cell subsets using marker enrichment modeling (MEM)
                <sup>
                    <xref ref-type="bibr" rid="ref-57">57</xref>
                </sup>.</p>
            <p>To keep the analysis of this workflow reproducible, one needs to define a random seed when running 
                <italic toggle="yes">
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.org/packages/3.9/FlowSOM">FlowSOM</ext-link>
                </italic>, t-SNE and UMAP. This is especially important in the clustering step, where the order of clusters may change with different seeds, and the cluster merging needs to be matched to the seed used. (Note that as mentioned at the start of the workflow, we also use the function 
                <monospace>RNGversion()</monospace> to ensure backward compatibility with earlier versions of the workflow, due to changes to the default random number generation methods in R.)</p>
        </sec>
        <sec>
            <title>Software availability</title>
            <p>All software packages used in this workflow are publicly available from the Comprehensive R Archive Network (
                <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/">https://cran.r-project.org</ext-link>) or the Bioconductor project (
                <ext-link ext-link-type="uri" xlink:href="http://bioconductor.org/">http://bioconductor.org</ext-link>). The specific version numbers of the packages used are shown below, along with the version of the R installation.</p>
            <p>Version numbers of all the Bioconductor packages correspond to the release version 3.9 of the Bioconductor project. Note that Bioconductor releases new versions of packages every 6 months and it is generally good practice to use the latest versions.</p>
            <p>Users can install all required packages and execute the workflow by following the instructions at 
                <ext-link ext-link-type="uri" xlink:href="https://www.bioconductor.org/help/workflows/cytofWorkflow">https://www.bioconductor.org/help/workflows/cytofWorkflow</ext-link>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:12px;color:#214A87; font-weight:bold; background-color:#F8F8F8">sessionInfo</styled-content>
                    <styled-content style="font-size:12px;color:#000000; background-color:#F8F8F8">()</styled-content>


                    <styled-content style="font-size:12px;color:#000000">## R version 3.6.0 (2019-04-26)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS High Sierra 10.13.6
##
## Matrix products: default
## BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/
## LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
##
## Random number generation:
##  RNG:     Mersenne-Twister
##  Normal:  Inversion
##  Sample:  Rounding
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats4    parallel stats      graphics grDevices utils      datasets
## [8] methods   base
##
## other attached packages:
##  [1] HDCytoData_1.4.0              SummarizedExperiment_1.14.0
##  [3] DelayedArray_0.10.0           BiocParallel_1.18.0
##  [5] matrixStats_0.54.0            Biobase_2.44.0
##  [7] GenomicRanges_1.36.0          GenomeInfoDb_1.20.0
##  [9] IRanges_2.18.0                S4Vectors_0.22.0
## [11] ExperimentHub_1.10.0          AnnotationHub_2.16.0
## [13] BiocFileCache_1.8.0           dbplyr_1.4.0
## [15] BiocGenerics_0.30.0           readxl_1.3.1
## [17] flowCore_1.50.0               diffcyt_1.4.3
## [19] cowplot_0.9.4                 ggplot2_3.1.1
## [21] CATALYST_1.8.3                knitr_1.22
## [23] BiocStyle_2.12.0
##
## loaded via a namespace (and not attached):
##   [1] circlize_0.4.6                drc_3.0-1
##   [3] plyr_1.8.4                    igraph_1.2.4.1
##   [5] ConsensusClusterPlus_1.48.0   lazyeval_0.2.2
##   [7] shinydashboard_0.7.1          splines_3.6.0
##   [9] scater_1.12.0                 TH.data_1.0-10
##  [11] digest_0.6.18                 htmltools_0.3.6
##  [13] viridis_0.5.1                 memoise_1.1.0
##  [15] magrittr_1.5                  cluster_2.0.8
##  [17] openxlsx_4.1.0                limma_3.40.0
##  [19] ComplexHeatmap_2.0.0          RcppParallel_4.4.2
##  [21] sandwich_2.5-1                colorspace_1.4-1
##  [23] rappdirs_0.3.1                blob_1.1.1
##  [25] rrcov_1.4-7                   ggrepel_0.8.1
##  [27] haven_2.1.0                   xfun_0.7
##  [29] dplyr_0.8.0.1                 crayon_1.3.4
##  [31] RCurl_1.95-4.12               jsonlite_1.6
##  [33] graph_1.62.0                  lme4_1.1-21
##  [35] survival_2.44-1.1             zoo_1.8-5
##  [37] glue_1.3.1                    gtable_0.3.0
##  [39] nnls_1.4                      zlibbioc_1.30.0
##  [41] XVector_0.24.0                GetoptLong_0.1.7
##  [43] car_3.0-2                     BiocSingular_1.0.0
##  [45] shape_1.4.4                   SingleCellExperiment_1.6.0
##  [47] DEoptimR_1.0-8                abind_1.4-5
##  [49] scales_1.0.0                  mvtnorm_1.0-10
##  [51] DBI_1.0.0                     edgeR_3.26.1
##  [53] Rcpp_1.0.1                    plotrix_3.7-5
##  [55] viridisLite_0.3.0             xtable_1.8-4
##  [57] clue_0.3-57                   bit_1.1-14
##  [59] foreign_0.8-71                rsvd_1.0.0
##  [61] FlowSOM_1.16.0                tsne_0.1-3
##  [63] DT_0.6                        htmlwidgets_1.3
##  [65] httr_1.4.0                    RColorBrewer_1.1-2
##  [67] pkgconfig_2.0.2               XML_3.98-1.19
##  [69] uwot_0.1.3                    locfit_1.5-9.1
##  [71] labeling_0.3                  AnnotationDbi_1.46.0
##  [73] tidyselect_0.2.5              rlang_0.3.4
##  [75] reshape2_1.4.3                later_0.8.0
##  [77] munsell_0.5.0                 cellranger_1.1.0
##  [79] tools_3.6.0                   RSQLite_2.1.1
##  [81] ggridges_0.5.1                evaluate_0.13
##  [83] shinyBS_0.61                  stringr_1.4.0
##  [85] yaml_2.2.0                    bit64_0.9-7
##  [87] zip_2.0.1                     robustbase_0.93-5
##  [89] purrr_0.3.2                   nlme_3.1-139
##  [91] mime_0.6                      compiler_3.6.0
##  [93] interactiveDisplayBase_1.22.0 beeswarm_0.2.3
##  [95] plotly_4.9.0                  curl_3.3
##  [97] png_0.1-7                     tibble_2.1.1
##  [99] pcaPP_1.9-73                  stringi_1.4.3
## [101] highr_0.8                     RSpectra_0.14-0
## [103] forcats_0.4.0                 lattice_0.20-38
## [105] Matrix_1.2-17                 nloptr_1.2.1
## [107] shinyjs_1.0                   pillar_1.4.0
## [109] BiocManager_1.30.4            GlobalOptions_0.1.0
## [111] RcppAnnoy_0.0.12              BiocNeighbors_1.2.0
## [113] data.table_1.12.2             bitops_1.0-6
## [115] irlba_2.3.3                   corpcor_1.6.9
## [117] httpuv_1.5.1                  R6_2.4.0
## [119] bookdown_0.10                 promises_1.0.1
## [121] gridExtra_2.3                 rio_0.5.16
## [123] vipor_0.4.5                   codetools_0.2-16
## [125] boot_1.3-22                   MASS_7.3-51.4
## [127] gtools_3.8.1                  assertthat_0.2.1
## [129] rjson_0.2.20                  withr_2.1.2
## [131] multcomp_1.4-10               GenomeInfoDbData_1.2.1
## [133] hms_0.4.2                     grid_3.6.0
## [135] minqa_1.2.4                   tidyr_0.8.3
## [137] rmarkdown_1.12                DelayedMatrixStats_1.6.0
## [139] carData_3.0-2                 Rtsne_0.15
## [141] shiny_1.3.2                   tinytex_0.13
## [143] ggbeeswarm_0.6.0</styled-content>
                </preformat>
            </p>
        </sec>
    </body>
    <back>
        <ack>
            <title>Acknowledgments</title>
            <p>The authors wish to thank members of the Robinson, Bodenmiller and von Mering groups from the Institute of Molecular Life Sciences, University of Zurich for helpful discussions.</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>Roederer</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>Spectral compensation for flow cytometry: visualization artifacts, limitations, and caveats.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry.</italic>
</source>
                    <year>2001</year>;<volume>45</volume>(<issue>3</issue>):<fpage>194</fpage>&#x2013;<lpage>205</lpage>.
                    <pub-id pub-id-type="pmid">11746088</pub-id>
                    <pub-id pub-id-type="doi">10.1002/1097-0320(20011101)45:3&lt;194::AID-CYTO1163&gt;3.0.CO;2-C</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>Mahnke</surname>
                            <given-names>YD</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Roederer</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>Optimizing a multicolor immunophenotyping assay.</article-title>
                    <source>

                        <italic toggle="yes">Clin Lab Med.</italic>
</source>
                    <year>2007</year>;<volume>27</volume>(<issue>3</issue>):<fpage>469</fpage>&#x2013;<lpage>85</lpage>,<fpage>v</fpage>.
                    <pub-id pub-id-type="pmid">17658403</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.cll.2007.05.002</pub-id>
                    <pub-id pub-id-type="pmcid">2034273</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>Leipold</surname>
                            <given-names>MD</given-names>
                        </name>
</person-group>:
                    <article-title>Another step on the path to mass cytometry standardization.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry A.</italic>
</source>
                    <year>2015</year>;<volume>87</volume>(<issue>5</issue>):<fpage>380</fpage>&#x2013;<lpage>82</lpage>.
                    <pub-id pub-id-type="pmid">25904393</pub-id>
                    <pub-id pub-id-type="doi">10.1002/cyto.a.22661</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>van Unen</surname>
                            <given-names>V</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Li</surname>
                            <given-names>N</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Molendijk</surname>
                            <given-names>I</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Mass Cytometry of the Human Mucosal Immune System Identifies Tissue- and Disease-Associated Immune Subsets.</article-title>
                    <source>

                        <italic toggle="yes">Immunity.</italic>
</source>
                    <year>2016</year>;<volume>44</volume>(<issue>5</issue>):<fpage>1227</fpage>&#x2013;<lpage>39</lpage>.
                    <pub-id pub-id-type="pmid">27178470</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.immuni.2016.04.014</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>Saeys</surname>
                            <given-names>Y</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Lambrecht</surname>
                            <given-names>BN</given-names>
                        </name>
</person-group>:
                    <article-title>Computational flow cytometry: helping to make sense of high-dimensional immunology data.</article-title>
                    <source>

                        <italic toggle="yes">Nat Rev Immunol.</italic>
</source>
                    <year>2016</year>;<volume>16</volume>(<issue>7</issue>):<fpage>449</fpage>&#x2013;<lpage>62</lpage>.
                    <pub-id pub-id-type="pmid">27320317</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nri.2016.56</pub-id>
                </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>Hartmann</surname>
                            <given-names>FJ</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Qu&#x00e9;riault</surname>
                            <given-names>C</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>High-dimensional single-cell analysis reveals the immune signature of narcolepsy.</article-title>
                    <source>

                        <italic toggle="yes">J Exp Med.</italic>
</source>
                    <year>2016</year>;<volume>213</volume>(<issue>12</issue>):<fpage>2621</fpage>&#x2013;<lpage>33</lpage>.
                    <pub-id pub-id-type="pmid">27821550</pub-id>
                    <pub-id pub-id-type="doi">10.1084/jem.20160897</pub-id>
                    <pub-id pub-id-type="pmcid">5110028</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>Pejoski</surname>
                            <given-names>D</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Tchitchek</surname>
                            <given-names>N</given-names>
                        </name>

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

                        <etal/>
</person-group>:
                    <article-title>Identification of Vaccine-Altered Circulating B Cell Phenotypes Using Mass Cytometry and a Two-Step Clustering Analysis.</article-title>
                    <source>

                        <italic toggle="yes">J Immunol.</italic>
</source>
                    <year>2016</year>;<volume>196</volume>(<issue>11</issue>):<fpage>4814</fpage>&#x2013;<lpage>31</lpage>.
                    <pub-id pub-id-type="pmid">27183591</pub-id>
                    <pub-id pub-id-type="doi">10.4049/jimmunol.1502005</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>Bruggner</surname>
                            <given-names>RV</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Dill</surname>
                            <given-names>DL</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Automated identification of stratifying signatures in cellular subpopulations.</article-title>
                    <source>

                        <italic toggle="yes">Proc Natl Acad Sci U S A.</italic>
</source>
                    <year>2014</year>;<volume>111</volume>(<issue>26</issue>):<fpage>E2770</fpage>&#x2013;<lpage>7</lpage>.
                    <pub-id pub-id-type="pmid">24979804</pub-id>
                    <pub-id pub-id-type="doi">10.1073/pnas.1408792111</pub-id>
                    <pub-id pub-id-type="pmcid">4084463</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>Arvaniti</surname>
                            <given-names>E</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Claassen</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>Sensitive detection of rare disease-associated cell subsets via representation learning.</article-title>
                    <source>

                        <italic toggle="yes">Nat Commun.</italic>
</source>
                    <year>2017</year>;<volume>8</volume>: 14825.
                    <pub-id pub-id-type="pmid">28382969</pub-id>
                    <pub-id pub-id-type="doi">10.1038/ncomms14825</pub-id>
                    <pub-id pub-id-type="pmcid">5384229</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>Lun</surname>
                            <given-names>ATL</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Richard</surname>
                            <given-names>AC</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Marioni</surname>
                            <given-names>JC</given-names>
                        </name>
</person-group>:
                    <article-title>Testing for differential abundance in mass cytometry data.</article-title>
                    <source>

                        <italic toggle="yes">Nat Methods.</italic>
</source>
                    <year>2017</year>;<volume>14</volume>(<issue>7</issue>):<fpage>707</fpage>&#x2013;<lpage>9</lpage>.
                    <pub-id pub-id-type="pmid">28504682</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nmeth.4295</pub-id>
                    <pub-id pub-id-type="pmcid">6155493</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>McCarthy</surname>
                            <given-names>DJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Chen</surname>
                            <given-names>Y</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Smyth</surname>
                            <given-names>GK</given-names>
                        </name>
</person-group>:
                    <article-title>Differential expression analysis of multifactor RNA-Seq experiments with respect to biological variation.</article-title>
                    <source>

                        <italic toggle="yes">Nucleic Acids Res.</italic>
</source>
                    <year>2012</year>;<volume>40</volume>(<issue>10</issue>):<fpage>4288</fpage>&#x2013;<lpage>97</lpage>.
                    <pub-id pub-id-type="pmid">22287627</pub-id>
                    <pub-id pub-id-type="doi">10.1093/nar/gks042</pub-id>
                    <pub-id pub-id-type="pmcid">3378882</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>Fonseka</surname>
                            <given-names>CY</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Rao</surname>
                            <given-names>DA</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Teslovich</surname>
                            <given-names>NC</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Mixed-effects association of single cells identifies an expanded effector CD4
                        <sup>+</sup> T cell subset in rheumatoid arthritis.</article-title>
                    <source>

                        <italic toggle="yes">Sci Transl Med.</italic>
</source>
                    <year>2018</year>;<volume>10</volume>(<issue>463</issue>): pii: eaaq0305.
                    <pub-id pub-id-type="pmid">30333237</pub-id>
                    <pub-id pub-id-type="doi">10.1126/scitranslmed.aaq0305</pub-id>
                    <pub-id pub-id-type="pmcid">6448773</pub-id>
                </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>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-14">
                <label>14</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Zhang</surname>
                            <given-names>JM</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Kamath</surname>
                            <given-names>GM</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Tse</surname>
                            <given-names>DN</given-names>
                        </name>
</person-group>:
                    <article-title>Towards a Post-Clustering Test for Differential Expression.</article-title>
                    <source>

                        <italic toggle="yes">bioRxiv.</italic>
</source>
                    <year>2018</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.biorxiv.org/content/10.1101/463265v1">Reference Source</ext-link>
                </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>Weber</surname>
                            <given-names>LM</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Robinson</surname>
                            <given-names>MD</given-names>
                        </name>
</person-group>:
                    <article-title>Comparison of clustering methods for high-dimensional single-cell flow and mass cytometry data.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry A.</italic>
</source>
                    <year>2016</year>;<volume>89</volume>(<issue>12</issue>):<fpage>1084</fpage>&#x2013;<lpage>96</lpage>.
                    <pub-id pub-id-type="pmid">27992111</pub-id>
                    <pub-id pub-id-type="doi">10.1002/cyto.a.23030</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>Gu</surname>
                            <given-names>Z</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Schlesner</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>Complex heatmaps reveal patterns and correlations in multidimensional genomic data.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2016</year>;<volume>32</volume>(<issue>18</issue>):<fpage>2847</fpage>&#x2013;<lpage>9</lpage>.
                    <pub-id pub-id-type="pmid">27207943</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/btw313</pub-id>
                </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>Levine</surname>
                            <given-names>JH</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Simonds</surname>
                            <given-names>EF</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Bendall</surname>
                            <given-names>SC</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Data-Driven Phenotypic Dissection of AML Reveals Progenitor-like Cells that Correlate with Prognosis.</article-title>
                    <source>

                        <italic toggle="yes">Cell.</italic>
</source>
                    <year>2015</year>;<volume>162</volume>(<issue>1</issue>):<fpage>184</fpage>&#x2013;<lpage>97</lpage>.
                    <pub-id pub-id-type="pmid">26095251</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.cell.2015.05.047</pub-id>
                    <pub-id pub-id-type="pmcid">4508757</pub-id>
                </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>Haghverdi</surname>
                            <given-names>L</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Theis</surname>
                            <given-names>FJ</given-names>
                        </name>
</person-group>:
                    <article-title>Diffusion maps for high-dimensional single-cell analysis of differentiation data.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2015</year>;<volume>31</volume>(<issue>18</issue>):<fpage>2989</fpage>&#x2013;<lpage>98</lpage>.
                    <pub-id pub-id-type="pmid">26002886</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/btv325</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>Angerer</surname>
                            <given-names>P</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>B&#x00fc;ttner</surname>
                            <given-names>M</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>
                        <italic toggle="yes">destiny</italic>: diffusion maps for large-scale single-cell data in R.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2016</year>;<volume>32</volume>(<issue>8</issue>):<fpage>1241</fpage>&#x2013;<lpage>3</lpage>.
                    <pub-id pub-id-type="pmid">26668002</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/btv715</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>Wang</surname>
                            <given-names>B</given-names>
                        </name>
		
                        <name name-style="western">
                            <surname>Ramazzotti</surname>
                            <given-names>D</given-names>
                        </name>
		
                        <name name-style="western">
                            <surname>De Sano</surname>
                            <given-names>L</given-names>
                        </name>
		
                        <etal/>
	</person-group>:
                    <article-title>SIMLR: A Tool for Large-Scale Genomic Analyses by Multi-Kernel Learning.</article-title>
                    <source>
		
                        <italic toggle="yes">Proteomics.</italic>
	</source>
                    <year>2018</year>;<volume>18</volume>(<issue>2</issue>):<fpage>1700232</fpage>.
                    <pub-id pub-id-type="pmid">29265724</pub-id>
                    <pub-id pub-id-type="doi">10.1002/pmic.201700232</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>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>67</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-22">
                <label>22</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Kotecha</surname>
                            <given-names>N</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Krutzik</surname>
                            <given-names>PO</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Irish</surname>
                            <given-names>JM</given-names>
                        </name>
</person-group>:
                    <article-title>Web-based analysis and publication of flow cytometry experiments.</article-title>
                    <source>

                        <italic toggle="yes">Curr Protoc Cytom.</italic>
</source>
                    <year>2010</year>;<volume>Chapter 10</volume>:<fpage>Unit10.17</fpage>.
                    <pub-id pub-id-type="pmid">20578106</pub-id>
                    <pub-id pub-id-type="doi">10.1002/0471142956.cy1017s53</pub-id>
                    <pub-id pub-id-type="pmcid">4208272</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>Finak</surname>
                            <given-names>G</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Jiang</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>FlowWorkspace: Infrastructure for Representing and Interacting with the Gated Cytometry</article-title>.<year>2011</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://bioconductor.riken.jp/packages/3.3/bioc/html/flowWorkspace.html">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-24">
                <label>24</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

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

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

                        <etal/>
</person-group>:
                    <article-title>OpenCyto: an open source infrastructure for scalable, robust, reproducible, and automated, end-to-end flow cytometry data analysis.</article-title>
                    <source>

                        <italic toggle="yes">PLoS Comput Biol.</italic>
</source>
                    <year>2014</year>;<volume>10</volume>(<issue>8</issue>):<fpage>e1003806</fpage>.
                    <pub-id pub-id-type="pmid">25167361</pub-id>
                    <pub-id pub-id-type="doi">10.1371/journal.pcbi.1003806</pub-id>
                    <pub-id pub-id-type="pmcid">4148203</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-25">
                <label>25</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Simonds</surname>
                            <given-names>EF</given-names>
                        </name>

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

                        <etal/>
</person-group>:
                    <article-title>Normalization of mass cytometry data with bead standards.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry A.</italic>
</source>
                    <year>2013</year>;<volume>83</volume>(<issue>5</issue>):<fpage>483</fpage>&#x2013;<lpage>94</lpage>.
                    <pub-id pub-id-type="pmid">23512433</pub-id>
                    <pub-id pub-id-type="doi">10.1002/cyto.a.22271</pub-id>
                    <pub-id pub-id-type="pmcid">3688049</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-26">
                <label>26</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <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>

                        <name name-style="western">
                            <surname>Behbehani</surname>
                            <given-names>GK</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Palladium-based mass tag cell barcoding with a doublet-filtering scheme and single-cell deconvolution algorithm.</article-title>
                    <source>

                        <italic toggle="yes">Nat Protoc.</italic>
</source>
                    <year>2015</year>;<volume>10</volume>(<issue>2</issue>):<fpage>316</fpage>&#x2013;<lpage>33</lpage>.
                    <pub-id pub-id-type="pmid">25612231</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nprot.2015.020</pub-id>
                    <pub-id pub-id-type="pmcid">4347881</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-27">
                <label>27</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Crowell</surname>
                            <given-names>HL</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Zanotelli</surname>
                            <given-names>VRT</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Compensation of Signal Spillover in Suspension and Imaging Mass Cytometry.</article-title>
                    <source>

                        <italic toggle="yes">Cell Syst.</italic>
</source>
                    <year>2018</year>;<volume>6</volume>(<issue>5</issue>):<fpage>612</fpage>&#x2013;<lpage>620.e5</lpage>.
                    <pub-id pub-id-type="pmid">29605184</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.cels.2018.02.010</pub-id>
                    <pub-id pub-id-type="pmcid">5981006</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-28">
                <label>28</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>LeMeur</surname>
                            <given-names>N</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Brinkman</surname>
                            <given-names>RR</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>flowCore: a Bioconductor package for high throughput flow cytometry.</article-title>
                    <source>

                        <italic toggle="yes">BMC Bioinformatics.</italic>
</source>
                    <year>2009</year>;<volume>10</volume>(<issue>1</issue>):<fpage>106</fpage>.
                    <pub-id pub-id-type="pmid">19358741</pub-id>
                    <pub-id pub-id-type="doi">10.1186/1471-2105-10-106</pub-id>
                    <pub-id pub-id-type="pmcid">2684747</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-29">
                <label>29</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bendall</surname>
                            <given-names>SC</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Simonds</surname>
                            <given-names>EF</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Qiu</surname>
                            <given-names>P</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Single-cell mass cytometry of differential immune and drug responses across a human hematopoietic continuum.</article-title>
                    <source>

                        <italic toggle="yes">Science.</italic>
</source>
                    <year>2011</year>;<volume>332</volume>(<issue>6030</issue>):<fpage>687</fpage>&#x2013;<lpage>96</lpage>.
                    <pub-id pub-id-type="pmid">21551058</pub-id>
                    <pub-id pub-id-type="doi">10.1126/science.1198704</pub-id>
                    <pub-id pub-id-type="pmcid">3273988</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-30">
                <label>30</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bendall</surname>
                            <given-names>SC</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Davis</surname>
                            <given-names>KL</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Amir</surname>
                            <given-names>el-AD</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Single-cell trajectory detection uncovers progression and regulatory coordination in human B cell development.</article-title>
                    <source>

                        <italic toggle="yes">Cell.</italic>
</source>
                    <year>2014</year>;<volume>157</volume>(<issue>3</issue>):<fpage>714</fpage>&#x2013;<lpage>25</lpage>.
                    <pub-id pub-id-type="pmid">24766814</pub-id>
                    <pub-id pub-id-type="doi">10.1016/j.cell.2014.04.005</pub-id>
                    <pub-id pub-id-type="pmcid">4045247</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-31">
                <label>31</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Aghaeepour</surname>
                            <given-names>N</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Finak</surname>
                            <given-names>G</given-names>
                        </name>
</person-group>,
                    <collab>FlowCAP Consortium</collab>,
                    <italic toggle="yes">et al.</italic>:
                    <article-title>Critical assessment of automated flow cytometry data analysis techniques.</article-title>
                    <source>

                        <italic toggle="yes">Nat Methods.</italic>
</source>
                    <year>2013</year>;<volume>10</volume>(<issue>3</issue>):<fpage>228</fpage>&#x2013;<lpage>38</lpage>.
                    <pub-id pub-id-type="pmid">23396282</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nmeth.2365</pub-id>
                    <pub-id pub-id-type="pmcid">3906045</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-32">
                <label>32</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>45</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-33">
                <label>33</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Wilkerson</surname>
                            <given-names>MD</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Hayes</surname>
                            <given-names>DN</given-names>
                        </name>
</person-group>:
                    <article-title>ConsensusClusterPlus: a class discovery tool with confidence assessments and item tracking.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2010</year>;<volume>26</volume>(<issue>12</issue>):<fpage>1572</fpage>&#x2013;<lpage>3</lpage>.
                    <pub-id pub-id-type="pmid">20427518</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/btq170</pub-id>
                    <pub-id pub-id-type="pmcid">2881355</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-34">
                <label>34</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 high-dimensional data using t-sne.</article-title>
                    <source>

                        <italic toggle="yes">J Mach Learn Res.</italic>
</source>
                    <year>2008</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.jmlr.org/papers/volume9/vandermaaten08a/vandermaaten08a.pdf">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-35">
                <label>35</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>
</person-group>:
                    <article-title>Accelerating t-SNE Using Tree-Based Algorithms.</article-title>
                    <source>

                        <italic toggle="yes">J Mach Learn Res.</italic>
</source>
                    <year>2014</year>;<volume>15</volume>:<fpage>3221</fpage>&#x2013;<lpage>45</lpage>.
                    <ext-link ext-link-type="uri" xlink:href="http://jmlr.org/papers/volume15/vandermaaten14a/vandermaaten14a.pdf">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-36">
                <label>36</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Vi&#x00e9;gas</surname>
                            <given-names>F</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Johnson</surname>
                            <given-names>I</given-names>
                        </name>
</person-group>:
                    <article-title>How to Use t-SNE Effectively.</article-title>
                    <source>

                        <italic toggle="yes">Distill.</italic>
</source>
                    <year>2016</year>.
                    <pub-id pub-id-type="doi">10.23915/distill.00002</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-37">
                <label>37</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>arXiv: 1802.03426.<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-38">
                <label>38</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <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>

                        <etal/>
</person-group>:
                    <article-title>Dimensionality reduction for visualizing single-cell data using UMAP.</article-title>
                    <source>

                        <italic toggle="yes">Nat Biotechnol.</italic>
</source>
                    <year>2019</year>;<volume>37</volume>:<fpage>38</fpage>&#x2013;<lpage>44</lpage>.
                    <pub-id pub-id-type="pmid">30531897</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nbt.4314</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-39">
                <label>39</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

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

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

                        <etal/>
</person-group>:
                    <article-title>Visualizing Large-scale and High-dimensional Data</article-title>.
                    <italic toggle="yes">arXiv</italic>, arxiv:1602.00370.<year>2016</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://arxiv.org/pdf/1602.00370.pdf">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-40">
                <label>40</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>H&#x00f6;llt</surname>
                            <given-names>T</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Pezzotti</surname>
                            <given-names>N</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Visual analysis of mass cytometry data by hierarchical stochastic neighbour embedding reveals rare cell types.</article-title>
                    <source>

                        <italic toggle="yes">Nat Commun.</italic>
</source>
                    <year>2017</year>;<volume>8</volume>(<issue>1</issue>):<fpage>1740</fpage>.
                    <pub-id pub-id-type="pmid">29170529</pub-id>
                    <pub-id pub-id-type="doi">10.1038/s41467-017-01689-9</pub-id>
                    <pub-id pub-id-type="pmcid">5700955</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-41">
                <label>41</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

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

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

                        <etal/>
</person-group>:
                    <article-title>Identification and visualization of multidimensional antigen-specific T-cell populations in polychromatic cytometry data.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry A.</italic>
</source>
                    <year>2015</year>;<volume>87</volume>(<issue>7</issue>):<fpage>675</fpage>&#x2013;<lpage>82</lpage>.
                    <pub-id pub-id-type="pmid">25908275</pub-id>
                    <pub-id pub-id-type="doi">10.1002/cyto.a.22623</pub-id>
                    <pub-id pub-id-type="pmcid">4482785</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-42">
                <label>42</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Tamayo</surname>
                            <given-names>P</given-names>
                        </name>

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

                        <etal/>
</person-group>:
                    <article-title>Consensus Clustering: A Resampling-Based Method for Class Discovery and Visualization of Gene Expression Microarray Data.</article-title>
                    <source>

                        <italic toggle="yes">Mach Learn.</italic>
</source>
                    <year>2003</year>;<volume>52</volume>(<issue>1&#x2013;2</issue>):<fpage>91</fpage>&#x2013;<lpage>118</lpage>.
                    <pub-id pub-id-type="doi">10.1023/A:1023949509487</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-43">
                <label>43</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Lu</surname>
                            <given-names>ZX</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Park</surname>
                            <given-names>JW</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>GLiMMPS: robust statistical model for regulatory variation of alternative splicing using RNA-seq data.</article-title>
                    <source>

                        <italic toggle="yes">Genome Biol.</italic>
</source>
                    <year>2013</year>;<volume>14</volume>(<issue>7</issue>):<fpage>R74</fpage>.
                    <pub-id pub-id-type="pmid">23876401</pub-id>
                    <pub-id pub-id-type="doi">10.1186/gb-2013-14-7-r74</pub-id>
                    <pub-id pub-id-type="pmcid">4054007</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-44">
                <label>44</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Hu</surname>
                            <given-names>Y</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Liu</surname>
                            <given-names>Y</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Mapping Splicing Quantitative Trait Loci in RNA-Seq.</article-title>
                    <source>

                        <italic toggle="yes">Cancer Inform.</italic>
</source>
                    <year>2014</year>;<volume>13</volume>(<issue>Suppl 4</issue>):<fpage>35</fpage>&#x2013;<lpage>43</lpage>.
                    <pub-id pub-id-type="pmid">25452687</pub-id>
                    <pub-id pub-id-type="doi">10.4137/CIN.S13971</pub-id>
                    <pub-id pub-id-type="pmcid">4218654</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-45">
                <label>45</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Hu</surname>
                            <given-names>X</given-names>
                        </name>

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

                        <etal/>
</person-group>:
                    <article-title>Automated high-dimensional flow cytometric data analysis.</article-title>
                    <source>

                        <italic toggle="yes">Proc Natl Acad Sci U S A.</italic>
</source>
                    <year>2009</year>;<volume>106</volume>(<issue>21</issue>):<fpage>8519</fpage>&#x2013;<lpage>24</lpage>.
                    <pub-id pub-id-type="pmid">19443687</pub-id>
                    <pub-id pub-id-type="doi">10.1073/pnas.0903028106</pub-id>
                    <pub-id pub-id-type="pmcid">2682540</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-46">
                <label>46</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Li</surname>
                            <given-names>YH</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Samusik</surname>
                            <given-names>N</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Scalable multi-sample single-cell data analysis by Partition-Assisted Clustering and Multiple Alignments of Networks.</article-title>
                    <source>

                        <italic toggle="yes">PLoS Comput Biol.</italic>
</source>
                    <year>2017</year>;<volume>13</volume>(<issue>12</issue>):<fpage>e1005875</fpage>.
                    <pub-id pub-id-type="pmid">29281633</pub-id>
                    <pub-id pub-id-type="doi">10.1371/journal.pcbi.1005875</pub-id>
                    <pub-id pub-id-type="pmcid">5760091</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-47">
                <label>47</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

                        <name name-style="western">
                            <surname>Khodabakhshi</surname>
                            <given-names>AH</given-names>
                        </name>

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

                        <etal/>
</person-group>:
                    <article-title>Per-channel basis normalization methods for flow cytometry data.</article-title>
                    <source>

                        <italic toggle="yes">Cytometry A.</italic>
</source>
                    <year>2010</year>;<volume>77</volume>(<issue>2</issue>):<fpage>121</fpage>&#x2013;<lpage>31</lpage>.
                    <pub-id pub-id-type="pmid">19899135</pub-id>
                    <pub-id pub-id-type="doi">10.1002/cyto.a.20823</pub-id>
                    <pub-id pub-id-type="pmcid">3648208</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-48">
                <label>48</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

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

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

                        <etal/>
</person-group>:
                    <article-title>Characterizing the replicability of cell types defined by single cell RNA-sequencing data using MetaNeighbor.</article-title>
                    <source>

                        <italic toggle="yes">Nat Commun.</italic>
</source>
                    <year>2018</year>;<volume>9</volume>(<issue>1</issue>):<fpage>884</fpage>.
                    <pub-id pub-id-type="pmid">29491377</pub-id>
                    <pub-id pub-id-type="doi">10.1038/s41467-018-03282-0</pub-id>
                    <pub-id pub-id-type="pmcid">5830442</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-49">
                <label>49</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

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

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

                        <etal/>
</person-group>:
                    <article-title>Batch effects in single-cell RNA-sequencing data are corrected by matching mutual nearest neighbors.</article-title>
                    <source>

                        <italic toggle="yes">Nat Biotechnol.</italic>
</source>
                    <year>2018</year>;<volume>36</volume>(<issue>5</issue>):<fpage>421</fpage>&#x2013;<lpage>27</lpage>.
                    <pub-id pub-id-type="pmid">29608177</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nbt.4091</pub-id>
                    <pub-id pub-id-type="pmcid">6152897</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-50">
                <label>50</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Korsunsky</surname>
                            <given-names>I</given-names>
                        </name>

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

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

                        <etal/>
</person-group>:
                    <article-title>Fast, Sensitive, and Flexible Integration of Single Cell Data with Harmony.</article-title>
                    <source>

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

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

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

                        <name name-style="western">
                            <surname>Hoffman</surname>
                            <given-names>P</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Comprehensive Integration of Single Cell Data.</article-title>
                    <source>

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

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

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

                        <name name-style="western">
                            <surname>Chattopadhyay</surname>
                            <given-names>P</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Mixture models for single-cell assays with applications to vaccine studies.</article-title>
                    <source>

                        <italic toggle="yes">Biostatistics.</italic>
</source>
                    <year>2014</year>;<volume>15</volume>(<issue>1</issue>):<fpage>87</fpage>&#x2013;<lpage>101</lpage>.
                    <pub-id pub-id-type="pmid">23887981</pub-id>
                    <pub-id pub-id-type="doi">10.1093/biostatistics/kxt024</pub-id>
                    <pub-id pub-id-type="pmcid">3862207</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-53">
                <label>53</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

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

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

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

                        <etal/>
</person-group>:
                    <article-title>COMPASS identifies T-cell subsets correlated with clinical outcomes.</article-title>
                    <source>

                        <italic toggle="yes">Nat Biotechnol.</italic>
</source>
                    <year>2015</year>;<volume>33</volume>(<issue>6</issue>):<fpage>610</fpage>&#x2013;<lpage>6</lpage>.
                    <pub-id pub-id-type="pmid">26006008</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nbt.3187</pub-id>
                    <pub-id pub-id-type="pmcid">4569006</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-54">
                <label>54</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Robinson</surname>
                            <given-names>MD</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Smyth</surname>
                            <given-names>GK</given-names>
                        </name>
</person-group>:
                    <article-title>Moderated statistical tests for assessing differences in tag abundance.</article-title>
                    <source>

                        <italic toggle="yes">Bioinformatics.</italic>
</source>
                    <year>2007</year>;<volume>23</volume>(<issue>21</issue>):<fpage>2881</fpage>&#x2013;<lpage>7</lpage>.
                    <pub-id pub-id-type="pmid">17881408</pub-id>
                    <pub-id pub-id-type="doi">10.1093/bioinformatics/btm453</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-55">
                <label>55</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Love</surname>
                            <given-names>MI</given-names>
                        </name>

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

                        <name name-style="western">
                            <surname>Anders</surname>
                            <given-names>S</given-names>
                        </name>
</person-group>:
                    <article-title>Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2.</article-title>
                    <source>

                        <italic toggle="yes">Genome Biol.</italic>
</source>
                    <year>2014</year>;<volume>15</volume>(<issue>12</issue>):<fpage>550</fpage>.
                    <pub-id pub-id-type="pmid">25516281</pub-id>
                    <pub-id pub-id-type="doi">10.1186/s13059-014-0550-8</pub-id>
                    <pub-id pub-id-type="pmcid">4302049</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-56">
                <label>56</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Ritchie</surname>
                            <given-names>ME</given-names>
                        </name>

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

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

                        <etal/>
</person-group>:
                    <article-title>
                        <italic toggle="yes">limma</italic> powers differential expression analyses for RNA-sequencing and microarray studies.</article-title>
                    <source>

                        <italic toggle="yes">Nucleic Acids Res.</italic>
</source>
                    <year>2015</year>;<volume>43</volume>(<issue>7</issue>):<fpage>e47</fpage>.
                    <pub-id pub-id-type="pmid">25605792</pub-id>
                    <pub-id pub-id-type="doi">10.1093/nar/gkv007</pub-id>
                    <pub-id pub-id-type="pmcid">4402510</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-57">
                <label>57</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Diggins</surname>
                            <given-names>KE</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Greenplate</surname>
                            <given-names>AR</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Leelatian</surname>
                            <given-names>N</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Characterizing cell subsets using marker enrichment modeling.</article-title>
                    <source>

                        <italic toggle="yes">Nat Methods.</italic>
</source>
                    <year>2017</year>;<volume>14</volume>(<issue>3</issue>):<fpage>275</fpage>&#x2013;<lpage>78</lpage>.
                    <pub-id pub-id-type="pmid">28135256</pub-id>
                    <pub-id pub-id-type="doi">10.1038/nmeth.4149</pub-id>
                    <pub-id pub-id-type="pmcid">5330853</pub-id>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report23051">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.12553.r23051</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Finak</surname>
                        <given-names>Greg</given-names>
                    </name>
                    <xref ref-type="aff" rid="r23051a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0003-4341-9090</uri>
                </contrib>
                <contrib contrib-type="author">
                    <name>
                        <surname>Gottardo</surname>
                        <given-names>Raphael</given-names>
                    </name>
                    <xref ref-type="aff" rid="r23051a1">1</xref>
                    <role>Co-referee</role>
                </contrib>
                <aff id="r23051a1">
                    <label>1</label>Vaccine and Infectious Disease Division (VIDD), Fred Hutchinson Cancer Research Center, Seattle, WA, USA</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>8</day>
                <month>6</month>
                <year>2017</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2017 Finak G and Gottardo R</copyright-statement>
                <copyright-year>2017</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="relatedArticleReport23051" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.11622.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>Nowicka and colleagues present a detailed workflow for analyzing high dimensional cytometry data using open source tools within the Bioconductor framework.&#x00a0;</p>
            <p> </p>
            <p> The paper provides a clear path for analyzing high dimensional cytometry data, with biomarker discovery in mind, starting from raw data, through preprocessing, population discovery, annotation, and differential abundance analysis.&#x00a0;</p>
            <p> </p>
            <p> Two particular strengths of the proposed approach are i) the decision to use expert-guided merging of cell populations, and ii) the model-based differential abundance analysis of cell populations.&#x00a0;</p>
            <p> </p>
            <p> The proposed visualization and summaries of the data make i) straightforward to follow and justify, and adequate alternatives are provided and shown to perform equally well&#x00a0;in instances where manual merging of many clusters would be cumbersome.&#x00a0;</p>
            <p> </p>
            <p> The modeling of cell population counts, rather than proportions, is an approach that we strongly support, and the use of logistic regression with mixed effects is a natural approach that is probably insufficiently appreciated by the community at large. That said, some of the methods proposed in the workflow have been in use in the vaccine development field for some time and should be appropriately cited.</p>
            <p> Specifically, in the section "Visual representation with tSNE", the authors promote coloring individual cells on a tSNE map by expression level, and later still, stratifying by condition (Fig. 11). We point the authors the article by Lin et al.
                <sup>
                    <xref ref-type="bibr" rid="rep-ref-23051-1">1</xref>
                </sup>,&#x00a0;&#x00a0;where a very similar approach, using bioconductor tools, is undertaken to identify and visualize polyfunctional Ag-specific T-cells.</p>
            <p> </p>
            <p> The discussion of existing methodological approaches to identify cytometry&#x00a0;biomarkers associated with outcome and the discussion of modeling cell counts in favor of modeling of proportions is important, but should also reference existing work in the vaccine development field. Our group has&#x00a0;done substantial work in this area, developing count-based models for antigen-specific T-cell&#x00a0;response to stimulation[ref-2
                <sup>,</sup>
                <sup>
                    <xref ref-type="bibr" rid="rep-ref-23051-3">3</xref>
                </sup>, the latter of which identified&#x00a0;a novel biomarker of infection risk in an HIV clinical trial.</p>
            <p> </p>
            <p> While these methods do not account for covariates, they are relevant to the discussion since&#x00a0;they utilize the Beta-binomial and Dirichlet-Multinomial distributions in a Bayesian formulation to handle over-dispersion due to subject-to-subject variability (an alternative to mixed effects modeling), and warrant mention here.</p>
            <p> </p>
            <p> Some additional minor points: the citation of flowCore (p5) should reference the journal publication describing the software
                <sup>
                    <xref ref-type="bibr" rid="rep-ref-23051-4">4</xref>
                </sup>, since it is available, rather than the software vignette.</p>
            <p> </p>
            <p> Finally, note that flowCore is not used for analysis (p4),&#x00a0;&#x00a0;which is this context we take to mean clustering or gating, but rather is an infrastructure package that will read, write and&#x00a0;transform cytometry data, as well as defining gate objects.</p>
            <p> </p>
            <p> The core infrastructure for actually performing data-driven gating in Bioconductor is implemented in packages like flowWorkspace (Finak G, Jiang M, Gottardo R. flowWorkspace: Infrastructure for representing and interacting with the gated cytometry. 2011.) and &#x00a0;openCyto
                <sup>
                    <xref ref-type="bibr" rid="rep-ref-23051-5">5</xref>
                </sup>.</p>
            <p> </p>
            <p> The citations above should be added and updated for completeness and clarity.</p>
            <p> </p>
            <p> Other than the above, the article is scientifically sound and the conclusions are justified by the data.</p>
            <p>Is the rationale for developing the new method (or application) clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the method technically sound?</p>
            <p>Yes</p>
            <p>Are the conclusions about the method and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>If any results are presented, are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>Yes</p>
            <p>Are sufficient details provided to allow replication of the method development and its use by others?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>NA</p>
            <p>We confirm that we have read this submission and believe that we have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <back>
            <ref-list>
                <title>References</title>
                <ref id="rep-ref-23051-1">
                    <label>1</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>Identification and visualization of multidimensional antigen-specific T-cell populations in polychromatic cytometry data.</article-title>
                        <source>
                            <italic>Cytometry A</italic>
                        </source>.<year>2015</year>;<volume>87</volume>(<issue>7</issue>) :
                        <elocation-id>10.1002/cyto.a.22623</elocation-id>
                        <fpage>675</fpage>-<lpage>82</lpage>
                        <pub-id pub-id-type="pmid">25908275</pub-id>
                        <pub-id pub-id-type="doi">10.1002/cyto.a.22623</pub-id>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-23051-2">
                    <label>2</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>Mixture models for single-cell assays with applications to vaccine studies.</article-title>
                        <source>
                            <italic>Biostatistics</italic>
                        </source>.<year>2014</year>;<volume>15</volume>(<issue>1</issue>) :
                        <elocation-id>10.1093/biostatistics/kxt024</elocation-id>
                        <fpage>87</fpage>-<lpage>101</lpage>
                        <pub-id pub-id-type="pmid">23887981</pub-id>
                        <pub-id pub-id-type="doi">10.1093/biostatistics/kxt024</pub-id>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-23051-3">
                    <label>3</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>COMPASS identifies T-cell subsets correlated with clinical outcomes.</article-title>
                        <source>
                            <italic>Nat Biotechnol</italic>
                        </source>.<year>2015</year>;<volume>33</volume>(<issue>6</issue>) :
                        <elocation-id>10.1038/nbt.3187</elocation-id>
                        <fpage>610</fpage>-<lpage>6</lpage>
                        <pub-id pub-id-type="pmid">26006008</pub-id>
                        <pub-id pub-id-type="doi">10.1038/nbt.3187</pub-id>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-23051-4">
                    <label>4</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>flowCore: a Bioconductor package for high throughput flow cytometry.</article-title>
                        <source>
                            <italic>BMC Bioinformatics</italic>
                        </source>.<year>2009</year>;<volume>10</volume>:
                        <elocation-id>10.1186/1471-2105-10-106</elocation-id>
                        <fpage>106</fpage>
                        <pub-id pub-id-type="pmid">19358741</pub-id>
                        <pub-id pub-id-type="doi">10.1186/1471-2105-10-106</pub-id>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-23051-5">
                    <label>5</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>OpenCyto: an open source infrastructure for scalable, robust, reproducible, and automated, end-to-end flow cytometry data analysis.</article-title>
                        <source>
                            <italic>PLoS Comput Biol</italic>
                        </source>.<year>2014</year>;<volume>10</volume>(<issue>8</issue>) :
                        <elocation-id>10.1371/journal.pcbi.1003806</elocation-id>
                        <fpage>e1003806</fpage>
                        <pub-id pub-id-type="pmid">25167361</pub-id>
                        <pub-id pub-id-type="doi">10.1371/journal.pcbi.1003806</pub-id>
                    </mixed-citation>
                </ref>
            </ref-list>
        </back>
        <sub-article article-type="response" id="comment3144-23051">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Robinson</surname>
                            <given-names>Mark</given-names>
                        </name>
                        <aff>University of Zurich, Switzerland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No competing interests.</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>31</day>
                    <month>10</month>
                    <year>2017</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Thank you for taking the time to read and review our paper. Following the suggestion of the reviewer, we have incorporated the missing references, including the reference to Lin et al. [1] in the "Visual representation with tSNE" section, and references to MIMOSA [2] and COMPASS [3] methods in the "Discussion" section. We have also fixed references in the "Data preprocessing" section, including the reference to the flowCore package [4]. We have clarified that the packages that can be used for cell gating are flowWorkspace [5] and openCyto [6].</p>
                <p> </p>
                <p> References</p>
                <p> [1] Lin Lin, Jacob Frelinger, Wenxin Jiang, Greg Finak, Chetan Seshadri, Pierre-Alexandre Bart, Giuseppe Pantaleo, Julie McElrath, Steve DeRosa, and Raphael Gottardo. 
                    <italic>Identification and visualization of multidimensional antigen-specific T-cell populations in polychromatic cytometry data</italic>.
                    <bold> Cytometry Part A</bold>, 87(7):675&#x2013;682, 2015.</p>
                <p> [2] Greg Finak, Andrew McDavid, Pratip Chattopadhyay, Maria Dominguez, Steve De Rosa, Mario Roederer, and Raphael Gottardo. 
                    <italic>Mixture models for single-cell assays with applications to vaccine studies</italic>. 
                    <bold>Biostatistics</bold>, 15(1):87&#x2013;101, 2014.</p>
                <p> [3] Lin Lin, Greg Finak, Kevin Ushey, Chetan Seshadri, Thomas R Hawn, Nicole Frahm, Thomas J Scriba, Hassan Mahomed, Willem Hanekom, Pierre-Alexandre Bart, Giuseppe Pantaleo, Georgia D Tomaras, Supachai Rerks-Ngarm, Jaranit Kaewkungwal, Sorachai Nitayaphan, Punnee Pitisuttithum, Nelson L Michael, Jerome H Kim, Merlin L Robb, Robert J O&#x2019;Connell, Nicos Karasavvas, Peter Gilbert, Stephen C De Rosa, M Juliana McElrath, and Raphael Gottardo. 
                    <italic>COMPASS identifies T-cell subsets correlated with clinical outcomes</italic>. 
                    <bold>Nat Biotech</bold>, 33(6):610&#x2013;616, jun 2015.</p>
                <p> [4] Florian Hahne, Nolwenn LeMeur, Ryan R Brinkman, Byron Ellis, Perry Haaland, Deepayan Sarkar, Josef Spidlen, Errol Strain, and Robert Gentleman. 
                    <italic>flowCore: a Bioconductor package for high throughput flow cytometry</italic>. 
                    <bold>BMC Bioinformatics</bold>, 10(1):106, apr 2009.</p>
                <p> [5] Greg Finak and Mike Jiang. 
                    <italic>flowWorkspace: Infrastructure for representing and interacting with the gated cytometry</italic>, 2011. R package version 3.24.4.</p>
                <p> [6] Greg Finak, Jacob Frelinger, Wenxin Jiang, Evan W EW Newell, John Ramey, Mark MM Davis, SA Spyros a Kalams, SC Stephen C De Rosa, and Raphael Gottardo. OpenCyto: An 
                    <italic>Open Source Infrastructure for Scalable, Robust, Reproducible, and Automated, End-to-End Flow Cytometry Data Analysis</italic>. 
                    <bold>PLoS Computational Biology</bold>, 10(8):e1003806, 2014.</p>
            </body>
        </sub-article>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report23055">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.12553.r23055</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Lun</surname>
                        <given-names>Aaron T. L.</given-names>
                    </name>
                    <xref ref-type="aff" rid="r23055a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-3564-4813</uri>
                </contrib>
                <contrib contrib-type="author">
                    <name>
                        <surname>Marioni</surname>
                        <given-names>John C.</given-names>
                    </name>
                    <xref ref-type="aff" rid="r23055a2">2</xref>
                    <xref ref-type="aff" rid="r23055a1">1</xref>
                    <xref ref-type="aff" rid="r23055a3">3</xref>
                    <role>Co-referee</role>
                </contrib>
                <aff id="r23055a1">
                    <label>1</label>CRUK (Cancer Research UK) Cambridge Institute, University of Cambridge, Cambridge, UK</aff>
                <aff id="r23055a2">
                    <label>2</label>Wellcome Trust Sanger Institute, Wellcome Genome Campus, Cambridge, UK</aff>
                <aff id="r23055a3">
                    <label>3</label>EMBL-European Bioinformatics Institute (EMBL-EBI), Wellcome Genome Campus, 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>6</day>
                <month>6</month>
                <year>2017</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2017 Lun ATL and Marioni JC</copyright-statement>
                <copyright-year>2017</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="relatedArticleReport23055" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.11622.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>Nowicka et al. describe a comprehensive workflow for a multi-sample analysis of a mass cytometry data set.&#x00a0;They provide methods and guidelines for data processing and quality control, clustering and interpretation/visualization of the clusters.&#x00a0;They also describe the application of statistical methods for differential analyses within clusters.&#x00a0;The article is clear and well-written, with some opportunities for improvement that we have listed below.&#x00a0;Overall, this will be useful resource for people looking to use R/Bioconductor for cytometry data analysis.</p>
            <p> </p>
            <p> 
                <bold>MAJOR COMMENTS:</bold> 
                <list list-type="order">
                    <list-item>
                        <p>The principle of pooling samples prior to clustering is important to ensure that the clustering is blind to the sample labels, and thus does not bias the downstream statistical inferences. However, in data sets where the number of cells is highly variable across samples, larger samples may drive the final clustering result. The authors may consider downweighting cells from larger samples during the clustering procedure, to ensure that each sample contributes equally to the outcome.</p>
                    </list-item>
                    <list-item>
                        <p>In what scenarios is the NRS useful? In a mass cytometry experiment, the panel is explicitly designed to interrogate markers of interest, so outside of quality control it makes little sense to discard them in the analysis. Indeed, low variance contributions in PCA does not mean that the marker is not relevant, e.g., if it marks a small population.</p>
                    </list-item>
                    <list-item>
                        <p>If the expected number of cell types is not known in advance, how many metaclusters should be chosen? In very heterogeneous populations, it is easy to imagine that there may well be more than 20 distinct cell subpopulations.</p>
                    </list-item>
                    <list-item>
                        <p>In the discussion, the authors state that "Overall, we expect that as a general rule, including batch parameters (or other covariates) in the linear modeling largely mitigates the problem." This is true to some extent, but will not protect the clustering from batch effects. If the batch effect shifts the intensity distribution between batches, it is possible that a subpopulation in samples of one batch is clustered with the wrong subpopulation in samples of another batch. The counts or median intensities of the cluster are inherently compromised and cannot be fixed by blocking on the batch effect in the model. In other words; when testing for changes in abundance in mass cytometry, the cells are analogous to individual reads in a transcriptomics experiment, while the vector of intensities is analogous to the genic region in which reads are counted. If the batch effect is affecting the intensities, it is analogous to changes in the definition of the genes between batches.</p>
                    </list-item>
                    <list-item>
                        <p>The authors mention using observation weights to describe the uncertainty of the median intensities when testing for differential expression of markers. We note that we have also used this approach in cydar, and it seems to work well. For differential expression of markers within each cluster, the differences in size between clusters are largely irrelevant - all else being equal, if clusters are small, the medians should be more variable, and this should be considered by the inference machinery when computing p-values.</p>
                    </list-item>
                </list> </p>
            <p> 
                <bold>MINOR COMMENTS:</bold> 
                <list list-type="bullet">
                    <list-item>
                        <p>A mention should be made of the fact that fsApply combines the intensity matrices from all data sets; this was not obvious from the code.</p>
                    </list-item>
                    <list-item>
                        <p>There are many ways to do hypothesis testing in GLMMs, with options ranging from Wald Z-tests, LRTs and parametric bootstrapping/MCMC. Some words on what glht actually does would be useful.</p>
                    </list-item>
                    <list-item>
                        <p>Some of the figure captions could be explained in more detail. For example, the numbers and colouring of the entries of the heatmap in Figure 4 are presumably the median marker intensities, but this should be explicitly stated.</p>
                    </list-item>
                    <list-item>
                        <p>Some minor typographical errors: " (Angerer et al., 2016))", "use the flowCore [package]."</p>
                    </list-item>
                    <list-item>
                        <p>The PBMC data set is described as "12 different stimulation conditions", but presumably only one was actually used (BCR/FcR-XL). This could be clarified.</p>
                    </list-item>
                </list>
            </p>
            <p>Is the rationale for developing the new method (or application) clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the method technically sound?</p>
            <p>Yes</p>
            <p>Are the conclusions about the method and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>If any results are presented, are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>Yes</p>
            <p>Are sufficient details provided to allow replication of the method development and its use by others?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>NA</p>
            <p>We confirm that we have read this submission and believe that we have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <sub-article article-type="response" id="comment3145-23055">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Robinson</surname>
                            <given-names>Mark</given-names>
                        </name>
                        <aff>University of Zurich, Switzerland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No competing interests</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>31</day>
                    <month>10</month>
                    <year>2017</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Thank you for taking the time to read and review our paper.</p>
                <p> </p>
                <p> MAJOR POINTS: 
                    <list list-type="order">
                        <list-item>
                            <p>As far as we understand, downweighting of cells (e.g., from larger samples) is not currently possible with FlowSOM. We think that, in general, it may be difficult to incorporate down- weighting into existing clustering algorithms that are tailored for cytometry data, but indeed it is worth considering.</p>
                            <p> One of the easy solutions to ensure that each sample contributes equally to the outcome could be down-sampling so that equal amount of cells from each sample is used in clustering. However, there are two main drawbacks of this strategy. First, a substantial amount of data (cells) may be removed from the analysis resulting in information loss. Second, during down-sampling, some of the rarer populations may become underrepresented or even skipped. Overall, it is also hard to know exactly what "drive the clustering" really means. We highlight these issues now in the "Discussion" section.</p>
                        </list-item>
                        <list-item>
                            <p>NRS can be used to define new panels as it was done in Levine et al. [1]. Indeed, when there is no need for redefining the panel, it can be used as a quality control step. We mention that now in the "Marker ranking based on the non-redundancy score" section.</p>
                            <p> In Levine et al., the NRS score was used to identify a set of surface markers that is "sufficient" to detect the main clusters in the AML data. As the number of markers that can be measured is limited, they could use only 16 channels for surface markers, while the remaining 15 channels were used for signaling markers. Based on average NRS, they identified the 16 surface markers, among 42, that explained the highest amount of variance in their data. The final set was slightly redefined (two markers with high scores were excluded and two markers with low scores were included) based on the biological knowledge, which agrees with the reviewer&#x2019; statement that low variance contributions in PCA do not mean that the marker is not relevant and vice versa. However, we think that NRS can still serve as a relevant guide in marker selection. The final set was then used in the panels in the following experiments.</p>
                        </list-item>
                        <list-item>
                            <p>In general, as rule of thumb, we would suggest setting the number of consensus clusters (parameter maxK in ConsensusClusterPlus) to at least twice the number of expected cell populations. As this number increases, it is necessary to also increase the size of the grid in the SOM step (parameters xdim and ydim in BuildSOM).&#x00a0; It is not necessary to know the exact number of cell types but rather the upper boundary for this number and treat that as the expected number. We also propose a strategy of re-clustering, where first main cell types are identified and extracted and then reclustered in a secondary analysis.&#x00a0; In the updated version of our workflow, we have also added a section called "Obtaining higher resolution" where we describe solutions using a higher amount of clusters for higher resolution.</p>
                        </list-item>
                        <list-item>
                            <p>Yes, we fully agree that including batch effects into the linear modeling does not fully protect the clustering from the batch effect. That is why it is important to account for batches already at the clustering step if possible, although this is itself still a rather open (methodological research) question. Current approaches rely on, for example, equalizing the dynamic range between batches for each marker (e.g. normalization to the 0-1 range, z-scores, quantile normalization), the use of warping functions to eliminate non-linear distortions (cydar [2]), or learning marker distribution shifts between the batches based on a manually gated reference cell type and using it to correct marker expression for the whole dataset (CellCnn [3]). A recent method called MASC [4] that, similarly to our workflow, employs mixed models for the differential abundance analysis deals with batches by identifying and excluding from the clustering analysis markers with high between-batch variability and poorly recorded cells, such as cells with extreme expression values. One could also consider, batch-wise clustering and aggregation, but these strategies also require further study. However, the effectiveness of these approaches has not been sufficiently studied, yet. We still recommend including batch information in the differential analysis as it may further help to mitigate the problem.</p>
                        </list-item>
                        <list-item>
                            <p>Indeed, we agree that the size of clusters should be built into in the inference. This happens automatically in the differential abundance analysis, since we use (over-dispersed) logistic regression. In the differential marker expression analysis, where the medians are compared, one could account for the variability of medians calculated over clusters by assigning lower weights to clusters with lower cell counts. We have not done this in the current workflow, as we are still assessing the effect of it on the power and error control of the methods.</p>
                        </list-item>
                    </list> </p>
                <p> MINOR POINTS: 
                    <list list-type="bullet">
                        <list-item>
                            <p>We now mention that the fsApply function, by default, combines intensity matrices from all data sets.</p>
                        </list-item>
                        <list-item>
                            <p>We have now added some text explaining that the glht function uses t-tests to test the hypothesis.</p>
                        </list-item>
                        <list-item>
                            <p>We have now updated the figure captions, especially those that correspond to Figures 4, 6, 7, 8, 14, 28, 30, and 32.</p>
                        </list-item>
                        <list-item>
                            <p>We have fixed the identified typos.</p>
                        </list-item>
                        <list-item>
                            <p>We have updated the description of the PBMC dataset.</p>
                        </list-item>
                    </list> </p>
                <p> References</p>
                <p> </p>
                <p> [1] &#x00a0;Jacob H. Levine, Erin F. Simonds, Sean C. Bendall, Kara L. Davis, El-ad D. Amir, Michelle D. Tadmor, Oren Litvin, Harris G. Fienberg, Astraea Jager, Eli R. Zunder, Rachel Finck, Amanda L. Gedman, Ina Radtke, James R. Downing, Dana Pe&#x2019;er, and Garry P. Nolan. 
                    <italic>Data-Driven Phenotypic Dissection of AML Reveals Progenitor-like Cells that Correlate with Prognosis</italic>. 
                    <bold>Cell</bold>, 162(1):184&#x2013;97, jun 2015.</p>
                <p> [2] &#x00a0;Aaron T L Lun, Arianne C Richard, and John C Marioni. 
                    <italic>Testing for differential abundance in mass cytometry data</italic>. 
                    <bold>Nat Meth</bold>, 14(7):707&#x2013;709, jul 2017.</p>
                <p> [3] &#x00a0;Eirini Arvaniti and Manfred Claassen. 
                    <italic>Sensitive detection of rare disease-associated cell subsets via representation learning</italic>. 
                    <bold>Nature Communications</bold>, 8:14825, apr 2017.</p>
                <p> [4] &#x00a0;Chamith Y Fonseka, Deepak A Rao, Nikola C Teslovich, Susan K Hannes, Kamil Slowikowski, Michael F Gurish, Laura T Donlin, Michael E Weinblatt, Elena M Massarotti, Jonathan S Coblyn, Simon M Helf- gott, Derrick J Todd, Vivian P Bykerk, Elizabeth W Karlson, Joerg Ermann, Yvonne C Lee, Michael B Brenner, and Soumya Raychaudhuri. 
                    <italic>Reverse Association Of Single Cells To Rheumatoid Arthritis Accounting For Mixed Effects Identifies An Expanded CD27- HLA-DR+ Effector Memory CD4+ T Cell Population</italic>. 
                    <bold>bioRxiv</bold>, 2017.</p>
            </body>
        </sub-article>
    </sub-article>
</article>
