<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.232">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">


<title>analycyte: simplify your post-analysis reporting for cytometry - 12&nbsp; QC - control quality of features</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
  width: 0.8em;
  margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ 
  vertical-align: middle;
}
</style>


<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
<script src="../site_libs/quarto-nav/headroom.min.js"></script>
<script src="../site_libs/clipboard/clipboard.min.js"></script>
<script src="../site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="../site_libs/quarto-search/fuse.min.js"></script>
<script src="../site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="../">
<link href="../qmd/sec_mod_da.html" rel="next">
<link href="../qmd/sec_mod_recurrent_element.html" rel="prev">
<script src="../site_libs/quarto-html/quarto.js"></script>
<script src="../site_libs/quarto-html/popper.min.js"></script>
<script src="../site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="../site_libs/quarto-html/anchor.min.js"></script>
<link href="../site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="../site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="../site_libs/quarto-html/quarto-syntax-highlighting-dark.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<script src="../site_libs/bootstrap/bootstrap.min.js"></script>
<link href="../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="../site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="../site_libs/bootstrap/bootstrap-dark.min.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<script id="quarto-search-options" type="application/json">{
  "location": "sidebar",
  "copy-button": false,
  "collapse-after": 3,
  "panel-placement": "start",
  "type": "textbox",
  "limit": 20,
  "keyboard-shortcut": [
    "f",
    "/",
    "s"
  ],
  "language": {
    "search-no-results-text": "No results",
    "search-matching-documents-text": "matching documents",
    "search-copy-link-title": "Copy link to search",
    "search-hide-matches-text": "Hide additional matches",
    "search-more-match-text": "more match in this document",
    "search-more-matches-text": "more matches in this document",
    "search-clear-button-title": "Clear",
    "search-detached-cancel-button-title": "Cancel",
    "search-submit-button-title": "Submit",
    "search-label": "Search"
  }
}</script>


<link rel="stylesheet" href="../custom.css">
</head>

<body class="nav-sidebar floating">

<div id="quarto-search-results"></div>
  <header id="quarto-header" class="headroom fixed-top">
  <nav class="quarto-secondary-nav">
    <div class="container-fluid d-flex">
      <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
        <i class="bi bi-layout-text-sidebar-reverse"></i>
      </button>
        <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="../qmd/html_files.html">Content Exemple</a></li><li class="breadcrumb-item"><a href="../qmd/sec_mod_qc.html"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">QC - control quality of features</span></a></li></ol></nav>
        <a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">      
        </a>
      <button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
        <i class="bi bi-search"></i>
      </button>
    </div>
  </nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
  <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal sidebar-navigation floating overflow-auto">
    <div class="pt-lg-2 mt-2 text-left sidebar-header">
    <div class="sidebar-title mb-0 py-0">
      <a href="../">analycyte: simplify your post-analysis reporting for cytometry</a> 
        <div class="sidebar-tools-main">
    <a href="https://gitcrcm.marseille.inserm.fr/lohmann/analycyte.book" rel="" title="Source Code" class="quarto-navigation-tool px-1" aria-label="Source Code"><i class="bi bi-git"></i></a>
  <a href="" class="quarto-color-scheme-toggle quarto-navigation-tool  px-1" onclick="window.quartoToggleColorScheme(); return false;" title="Toggle dark mode"><i class="bi"></i></a>
</div>
    </div>
      </div>
        <div class="mt-2 flex-shrink-0 align-items-center">
        <div class="sidebar-search">
        <div id="quarto-search" class="" title="Search"></div>
        </div>
        </div>
    <div class="sidebar-menu-container"> 
    <ul class="list-unstyled mt-1">
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../index.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Welcome</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/preface.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Preface</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/summary.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Key Features</span></a>
  </div>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">
 <span class="menu-text">User’s Guide</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true" aria-label="Toggle section">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">  
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/install.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Installation</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/users_how_to_start.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">How to Start</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/users_shiny_file_type.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">File types terms</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/users_shiny_action_list.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Action list</span></span></a>
  </div>
</li>
      </ul>
  </li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true">
 <span class="menu-text">Import</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true" aria-label="Toggle section">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">  
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_import_concat.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Import Concatened .fcs</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_import_feature.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">Import Features tables</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_import_rds.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">7</span>&nbsp; <span class="chapter-title">Import R files</span></span></a>
  </div>
</li>
      </ul>
  </li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="true">
 <span class="menu-text">Export</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="true" aria-label="Toggle section">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">  
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_project_to_export.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">8</span>&nbsp; <span class="chapter-title">Export Analysis to disk</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_export_ph.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">9</span>&nbsp; <span class="chapter-title">Phantasus Table</span></span></a>
  </div>
</li>
      </ul>
  </li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true">
 <span class="menu-text">Content Exemple</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true" aria-label="Toggle section">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">  
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/html_files.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">10</span>&nbsp; <span class="chapter-title">Dataset description</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_recurrent_element.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">11</span>&nbsp; <span class="chapter-title">Recurrent element</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_qc.html" class="sidebar-item-text sidebar-link active">
 <span class="menu-text"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">QC - control quality of features</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_da.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">13</span>&nbsp; <span class="chapter-title">DA - analyse abundancy of clusters - univar</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/sec_mod_ds.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">14</span>&nbsp; <span class="chapter-title">DS - analyse intensity of clusters - univar</span></span></a>
  </div>
</li>
      </ul>
  </li>
        <li class="sidebar-item sidebar-item-section">
      <span class="sidebar-item-text sidebar-link text-start">
 <span class="menu-text">Reproduce analysis with command lines</span></span>
  </li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/glossary.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Glossary</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/references.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">References</span></a>
  </div>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true">
 <span class="menu-text">Appendices</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true" aria-label="Toggle section">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth1 show">  
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/a4-sec_mod_deploy_ifb.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">A</span>&nbsp; <span class="chapter-title">Deploying with IFB</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/a1-flowjo.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">B</span>&nbsp; <span class="chapter-title">Import data from Flowjo</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/a2-omiq.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">C</span>&nbsp; <span class="chapter-title">Import data from OmiQ</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/a3-analycyte-verse.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">D</span>&nbsp; <span class="chapter-title">analycyte-verse</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="../qmd/a5-yaml-parameters.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">E</span>&nbsp; <span class="chapter-title">YAML Parameters</span></span></a>
  </div>
</li>
      </ul>
  </li>
    </ul>
    </div>
</nav>
<div id="quarto-sidebar-glass" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass"></div>
<!-- margin-sidebar -->
    <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
        
    </div>
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="../qmd/html_files.html">Content Exemple</a></li><li class="breadcrumb-item"><a href="../qmd/sec_mod_qc.html"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">QC - control quality of features</span></a></li></ol></nav>
<div class="quarto-title">
<h1 class="title"><span id="sec-QC" class="quarto-section-identifier"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">QC - control quality of features</span></span></h1>
</div>



<div class="quarto-title-meta">

    
  
    
  </div>
  

</header>

<div class="justify">
<p>The quality control (QC) report evaluates whether the extracted features are linked to experimental groups or attended effects, but can also detect unattended effects (clustering problem, etc.).</p>
<table class="table">
<thead>
<tr class="header">
<th style="text-align: center;">Analysis Feature</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;"><a href="#sec-qc-num-cell-bar"><strong>Number of Cells Barplot</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Displays cell counts per <code>.fcs</code> file, highlighting potential batch effects and identifying samples with low cell counts.</td>
</tr>
<tr class="even">
<td style="text-align: center;"><a href="#sec-qc-num-cell-quantile"><strong>Number of Cells Per Quantiles</strong></a></td>
<td style="text-align: center;">table</td>
<td>Summarizes the distribution of cell counts across <code>.fcs</code> files using quantiles, aiding in identifying outliers and general data trends.</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><a href="#sec-qc-num-cell-hist"><strong>Number of Cells per <code>.fcs</code> Histogram</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Visualizes the distribution of cell counts across <code>.fcs</code> files, marking key quantiles to illustrate significant statistical boundaries.</td>
</tr>
<tr class="even">
<td style="text-align: center;"><a href="#sec-qc-num-cell-bar-clust"><strong>Barplot Number of Cells per Clusters</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Illustrates the distribution of cells across manually gated clusters, showing the percentage and cumulative percentage of cells per cluster.</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><a href="#sec-qc-density-heat"><strong>Density Heatmap</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Visually checks the standardization method and ensures similar abundance ranges across samples using a special distance method.</td>
</tr>
<tr class="even">
<td style="text-align: center;"><a href="#sec-mfi-heat"><strong>MFI’s Heatmap</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Displays the median fluorescence intensity (MFI) of markers across clusters, allowing for comparison of MFI patterns across experimental conditions or sample groups.</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><a href="#sec-mfi-abu-heat"><strong>Mfi x Abundance Heatmap</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Combines information about marker expression and cluster abundance, helping users understand expression patterns and cluster distribution.</td>
</tr>
<tr class="even">
<td style="text-align: center;"><a href="#sec-abu-heat"><strong>Abundance Heatmap</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Shows the percentage of cells in each cluster for each sample, helping identify outliers and check if experimental conditions have distinct cluster abundance patterns.</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><a href="#sec-pca-abu"><strong>PCA of Samples Using Percentages per Cluster</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Visualizes samples in a reduced dimensional space based on cluster percentages, assessing sample homogeneity, identifying outliers, and determining if experimental conditions can be separated.</td>
</tr>
<tr class="even">
<td style="text-align: center;"><a href="#sec-pca-bar"><strong>Barplot of Variance of Each PC</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Shows the percentage of explained variance for each principal component in the PCA analysis.</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><a href="#sec-tables-more"><strong>Contribution and Correlation of Variables to Each Axis</strong></a></td>
<td style="text-align: center;">tables</td>
<td>Provides tables to analyze PCA results, including contribution, correlation, and R2 tables, helping identify key variables driving sample distribution and variability.</td>
</tr>
<tr class="even">
<td style="text-align: center;"><a href="#sec-pca-mfi-heat"><strong>Heatmap Top 10 cos2 for Each First 3 Dimensions Combination</strong></a></td>
<td style="text-align: center;">graphic</td>
<td>Shows the top 10 markers with the highest cos2 values for each combination of the first three dimensions in the MFI PCA analysis, helping interpret key markers driving sample separation or clustering.</td>
</tr>
</tbody>
</table>
<section id="sec-qc-num-cell-bar" class="level2" data-number="12.1">
<h2 data-number="12.1" class="anchored" data-anchor-id="sec-qc-num-cell-bar"><span class="header-section-number">12.1</span> Number of Cells Barplot</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/figure-html/fig-barplot-QC-1.svg" class="img-fluid figure-img"></p>
<figcaption class="figure-caption">Number of cell per fcs</figcaption>
</figure>
</div>
<p>The “Number of cell per fcs” displays the cell counts for each <code>.fcs</code> file, sorted by condition if provided. If batch annotations are available, the plot will feature batch colors around the graph for enhanced visibility of potential batch effects.</p>
<p>Annotations on the plot assist in quickly identifying variations, facilitating effective monitoring and quality control. Below the graph, the documentation lists the <code>.fcs</code> files with the fewest cells to highlight samples that may require further examination.</p>
</section>
<section id="sec-qc-num-cell-quantile" class="level2" data-number="12.2">
<h2 data-number="12.2" class="anchored" data-anchor-id="sec-qc-num-cell-quantile"><span class="header-section-number">12.2</span> Number of Cells Per Quantiles table</h2>
<p>This table presents the distribution of cell counts across all <code>.fcs</code> files, summarized by quantiles.</p>
<p>It provides key statistical measures at five points: This quantile breakdown helps in understanding the distribution and variability of cell counts within your dataset, aiding in identifying outliers and general data trends.</p>
</section>
<section id="sec-qc-num-cell-hist" class="level2" data-number="12.3">
<h2 data-number="12.3" class="anchored" data-anchor-id="sec-qc-num-cell-hist"><span class="header-section-number">12.3</span> Number of Cells per <code>.fcs</code> Histogram</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/figure-html/fig-hist-QC-cluster-1.svg" class="img-fluid figure-img"></p>
<figcaption class="figure-caption">Histogram</figcaption>
</figure>
</div>
<p>This histogram visualizes the distribution of cell counts across all <code>.fcs</code> files, with the count of <code>.fcs</code> on the y-axis and cell numbers on the x-axis.</p>
<p>Key quantiles—Q1 (25%), Q2 (50%, median), Q3 (75%), and Q4 (100%, maximum)—are marked with red dashed lines to illustrate significant statistical boundaries within the data.</p>
<p>This histogram provides a clear graphical representation of how cell counts are spread among the <code>.fcs</code> files, helping to quickly identify patterns and anomalies in the dataset.</p>
</section>
<section id="sec-qc-num-cell-bar-clust" class="level2" data-number="12.4">
<h2 data-number="12.4" class="anchored" data-anchor-id="sec-qc-num-cell-bar-clust"><span class="header-section-number">12.4</span> Barplot Number of Cells per Clusters</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/figure-html/fig-barplot-QC-cluster-1.svg" class="img-fluid figure-img"></p>
<figcaption class="figure-caption">Number of cell per clusters/gating</figcaption>
</figure>
</div>
<p>This barplot illustrates the distribution of cells across different clusters, identified through manual gating. It displays the percentage of total cells per cluster and the cumulative percentage, providing a detailed look at cell distribution patterns. Barplot Details</p>
<ul>
<li><p>Y-Axis (Left): Shows the percentage of total cells in each cluster.</p></li>
<li><p>Y-Axis (Right): Displays the cumulative percentage of cells, aiding in understanding the overall distribution as it accumulates across clusters.</p></li>
<li><p>Cumulative Annotation: Each cluster is sorted by the percentage of cells it contains, with annotations indicating the cumulative percentages, helping to visualize how cell counts build up across clusters.</p></li>
</ul>
<p>Below the barplot, the clusters with the lowest percentage of cells are listed to highlight areas with minimal cell counts. This information is crucial for assessing the efficiency and effectiveness of the gating process.</p>
</section>
<section id="sec-qc-density-heat" class="level2" data-number="12.5">
<h2 data-number="12.5" class="anchored" data-anchor-id="sec-qc-density-heat"><span class="header-section-number">12.5</span> Density Heatmap</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/figure-html/fig-density-plot-1.svg" class="img-fluid figure-img"></p>
<figcaption class="figure-caption">Density</figcaption>
</figure>
</div>
<p>A special distance method, denoted as ‘ks,’ measures the similarity between distributions by computing the Kolmogorov-Smirnov statistic between two distributions.</p>
<p>for each sample/fcs a density of Argsinh frequencies / 0.03 then centered by the mean per clusters with density going from blue to red</p>
<p>The aim is to visually check the standardisation method and ensure that the abundance ranges of the samples are similar.</p>
</section>
<section id="sec-mfi-heat" class="level2" data-number="12.6">
<h2 data-number="12.6" class="anchored" data-anchor-id="sec-mfi-heat"><span class="header-section-number">12.6</span> MFI’s Heatmap</h2>
<p><img src="../images/figure-html/fig-heatmap_catalyst_style-1.svg" class="img-fluid"></p>
<div class="columns">
<div class="column" style="width:50%;">
<p><img src="../images/figure-html/fig-heatmap_catalyst_style-Acute-1.svg" class="img-fluid"></p>
</div><div class="column" style="width:50%;">
<p><img src="../images/figure-html/fig-heatmap_catalyst_style-Conv-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The MFI’s Heatmap is a visualization that displays the median fluorescence intensity (MFI) of markers across clusters in a cytometry dataset.</p>
<p>The input for this heatmap is the MFI cluster x marker array, where the MFI values have been previously transformed using an asinh(intensity/cofactor) function. The heatmap is organized with clusters in rows and markers in columns, providing a clear overview of the MFI distribution across the dataset. Alongside the heatmap, a barplot is presented to show the number of cells in each metacluster, offering insights into the relative sizes of the clusters.</p>
<p>Initially, the heatmap covers all <code>.fcs</code> files in the dataset, allowing for a comprehensive view of the MFI patterns. However, if a specific condition is selected for rendering the document, additional heatmaps are generated to display the MFIs for each subgroup within that condition. its feature enables users to compare and contrast the MFI patterns across different experimental conditions or sample groups. The MFI’s Heatmap serves as a valuable tool for visually checking the consistency of MFI values between samples and ensuring that the data is comparable across the dataset. By providing a clear and concise representation of the MFI distribution, this visualization aids in the interpretation and quality control of data.</p>
</section>
<section id="sec-mfi-abu-heat" class="level2" data-number="12.7">
<h2 data-number="12.7" class="anchored" data-anchor-id="sec-mfi-abu-heat"><span class="header-section-number">12.7</span> Mfi x Abundance Heatmap</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/figure-html/fig-heat-cytofast-plot-1.svg" class="img-fluid figure-img" width="384"></p>
<figcaption class="figure-caption">MFI / abundance heatmap</figcaption>
</figure>
</div>
<p>The Mfi x Abundance Heatmap is a two-part visualization that combines information about marker expression and cluster abundance in cytometry data.</p>
<ul>
<li><p>The first heatmap shows the normalized median fluorescence intensity (MFI) of each marker per cluster, allowing for easy comparison of marker expression across clusters. Markers are grouped hierarchically for better interpretation.</p></li>
<li><p>The second heatmap displays the relative abundances of each cluster per <code>.fcs</code> file, transformed relative to the cluster mean. The consistent green-purple color scale is used throughout the abundance matrix.</p></li>
<li><p>Sample metadata is provided on the left side of the abundance heatmap, offering context for interpreting cluster abundances.</p></li>
</ul>
</section>
<section id="abundance-heatmap" class="level2" data-number="12.8">
<h2 data-number="12.8" class="anchored" data-anchor-id="abundance-heatmap"><span class="header-section-number">12.8</span> Abundance Heatmap</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/figure-html/fig-heat-abundance-plot-unsupervised-1.svg" class="img-fluid figure-img"></p>
<figcaption class="figure-caption">Abundance heatmap</figcaption>
</figure>
</div>
<p>The Abundance Heatmap is a graph that shows the percentage of cells in each cluster for each sample in your cytometry dataset. The heatmap has samples in columns and clusters in rows, with the color intensity representing the percentage of cells. The graph helps you:</p>
<ul>
<li><p>See if samples within groups or conditions have similar cluster abundances</p></li>
<li><p>Identify samples that are different from others (outliers)</p></li>
<li><p>Check if experimental conditions have distinct cluster abundance patterns</p></li>
</ul>
<p>The heatmap also has a barplot on the right side showing the group abundance values on a log scale, colored by condition if one was selected. This graph is useful for checking data quality and exploring how cluster abundances vary across samples and conditions in your dataset.</p>
</section>
<section id="sec-pca-abu" class="level1" data-number="13">
<h1 data-number="13"><span class="header-section-number">13</span> PCA of Samples Using Percentages per Cluster</h1>
<p>The PCA (Principal Component Analysis) graph is a visualization of your samples in a reduced dimensional space based on the percentages of cells in each cluster. This graph helps you assess the homogeneity of sample states, identify outliers or gender effects, and determine if experimental conditions can be separated. The input for the PCA is a table with samples as rows and clusters as columns, containing the percentage of cells in each cluster for each sample. Before the analysis, the percentages are transformed using an asinh(%+cte) function with a constant (cte) of 0.03 and then centered by cluster. The PCA graph is generated using the factormineR PCA function and visualized with factoextra functions. It is important to check that the first 2 or 3 principal components retain the main information from your dataset. In the PCA graph, each point represents a sample, and the distance between points reflects their similarity in terms of cluster percentages. Samples with similar cluster abundances will be closer together, while samples with different abundances will be farther apart. By examining the PCA graph, you can:</p>
<ul>
<li><p>Assess the homogeneity of sample states within groups or conditions</p></li>
<li><p>Identify potential outliers or samples affected by factors like gender</p></li>
<li><p>Determine if experimental conditions form distinct clusters, indicating their impact on cluster abundances</p></li>
</ul>
<p>This graph provides a concise summary of the relationships between your samples based on their cluster composition, aiding in data quality assessment and exploratory analysis of your cytometry dataset.</p>
<section id="sec-pca-bar" class="level2" data-number="13.1">
<h2 data-number="13.1" class="anchored" data-anchor-id="sec-pca-bar"><span class="header-section-number">13.1</span> Barplot of Variance of Each PC</h2>
<p>The barplot of variance shows the percentage of explained variance for each principal component (PC) in the PCA analysis, both for abundance and MFI data. The bars represent the PCs, with the height indicating the proportion of variance explained. The first few dimensions capturing the most significant information are displayed.</p>
<p><img src="../images/figure-html/fig-barplot-factoextra-mfi-1.svg" class="img-fluid"></p>
<ul>
<li>PCA The PCA graph visualizes the samples in the reduced dimensional space, with colors representing annotations of interest. Each point is a sample, and colors correspond to different categories or conditions. Circles highlight clustering or separation of groups. This graph assesses the impact of annotated variables on sample distribution.</li>
</ul>
<div class="columns">
<div class="column" style="width:33%;">
<p><img src="../images/figure-html/fig-pca-mfi-decomp-acqdate-Dim1vsDim2-1.svg" class="img-fluid"></p>
</div><div class="column" style="width:33%;">
<p><img src="../images/figure-html/fig-pca-mfi-decomp-cond-Dim1vsDim2-1.svg" class="img-fluid"></p>
</div><div class="column" style="width:33%;">
<p><img src="../images/figure-html/fig-pca-mfi-decomp-Gender-Dim1vsDim2-1.svg" class="img-fluid"></p>
</div>
</div>
<div class="columns">
<div class="column" style="width:33%;">
<p><img src="../images/figure-html/fig-pca-abu-decomp-acqdate-Dim1vsDim2-1.svg" class="img-fluid"> <!-- ![](../images/figure-html/fig-pca-abu-decomp-acqdate-Dim1vsDim3-1.svg) --> <!-- ![](../images/figure-html/fig-pca-abu-decomp-acqdate-Dim2vsDim3-1.svg)  --></p>
</div><div class="column" style="width:33%;">
<p><img src="../images/figure-html/fig-pca-abu-decomp-cond-Dim1vsDim2-1.svg" class="img-fluid"> <!-- ![](../images/figure-html/fig-pca-abu-decomp-cond-Dim1vsDim3-1.svg) --> <!-- ![](../images/figure-html/fig-pca-abu-decomp-cond-Dim2vsDim3-1.svg) --></p>
</div><div class="column" style="width:33%;">
<p><img src="../images/figure-html/fig-pca-abu-decomp-Gender-Dim1vsDim2-1.svg" class="img-fluid"> <!-- ![](../images/figure-html/fig-pca-abu-decomp-Gender-Dim1vsDim3-1.svg) --> <!-- ![](../images/figure-html/fig-pca-abu-decomp-Gender-Dim2vsDim3-1.svg) --></p>
</div>
</div>
<ul>
<li>Biplot The biplot combines sample points and variable loadings, showing relationships between samples and contributions of variables (clusters or markers) to the principal components. Correlations between variables and PCs are annotated if their cos2 values exceed the mean cos2 for the axes of interest, identifying key variables driving sample separation or clustering.</li>
</ul>
<div class="columns">
<div class="column" style="width:50%;">
<p><img src="../images/figure-html/fig-pca-abun-Dim1vsDim2-1.svg" class="img-fluid"></p>
</div><div class="column" style="width:50%;">
<p><img src="../images/figure-html/fig-pca-mfi-Dim1vsDim2-1.svg" class="img-fluid"></p>
</div>
</div>
<p>These graphs provide a comprehensive understanding of PCA results, exploring sample relationships, annotation impact, and main factors contributing to variance in the cytometry dataset.</p>
</section>
</section>
<section id="sec-tables-more" class="level1" data-number="14">
<h1 data-number="14"><span class="header-section-number">14</span> Contribution and Correlation of variables to each axis</h1>
<p>In addition to the PCA graphs, three tables are provided to further analyze the results:</p>
<ul>
<li><p><strong>Contribution Table</strong>: The contribution table shows the contributions of each variable (cluster or marker) to the first five principal components. Only variables that contribute at least 1% to one of these dimensions are included in the table. This table helps identify the key variables that have a significant impact on the variance captured by each principal component. Variables with high contributions are considered important in shaping the sample distribution in the reduced-dimensional space.</p></li>
<li><p><strong>Correlation Table</strong>: If quantitative associated variables have been detected in the dataset, a correlation table is generated. This table displays the correlations between the quantitative variables and the principal components.High absolute values of correlation indicate a strong relationship between a variable and a specific principal component. This information can help interpret the meaning of the principal components and understand how the quantitative variables are related to the sample distribution in the PCA space.</p></li>
<li><p><strong>R2 Table</strong>: If qualitative associated variables have been detected in the dataset, an R2 table is provided. This table shows the R-squared values, which measure the proportion of variance in the principal components that can be explained by each qualitative variable. High R-squared values suggest that a qualitative variable has a strong influence on the sample distribution along the corresponding principal component. This information can help identify the categorical factors that significantly contribute to the observed patterns in the PCA results.</p></li>
</ul>
<p>These tables complement the PCA graphs by providing numerical summaries of the variable contributions, correlations, and explanatory power. They assist in interpreting the PCA results and identifying the key factors driving the sample distribution and variability in the cytometry dataset.</p>
<section id="sec-pca-mfi-heat" class="level2" data-number="14.1">
<h2 data-number="14.1" class="anchored" data-anchor-id="sec-pca-mfi-heat"><span class="header-section-number">14.1</span> Heatmap Top 10 cos2 for Each First 3 Dimensions Combination</h2>
<p><img src="../images/figure-html/fig-heat-mfi-topDim1vsDim2-1.svg" class="img-fluid"></p>
<p>The MFI PCA analysis includes heatmaps that show the top 10 markers with the highest cos2 values for each combination of the first three dimensions (Dim.1 vs Dim.2, Dim.1 vs Dim.3, and Dim.2 vs Dim.3). The cos2 value indicates how well a marker is represented and contributes to the variability captured by the corresponding dimensions. A high cos2 value means a marker has a strong influence on the sample distribution in the PCA space. For each dimension combination, a separate heatmap is generated.</p>
</section>
</section>
</div>



</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
  const toggleBodyColorMode = (bsSheetEl) => {
    const mode = bsSheetEl.getAttribute("data-mode");
    const bodyEl = window.document.querySelector("body");
    if (mode === "dark") {
      bodyEl.classList.add("quarto-dark");
      bodyEl.classList.remove("quarto-light");
    } else {
      bodyEl.classList.add("quarto-light");
      bodyEl.classList.remove("quarto-dark");
    }
  }
  const toggleBodyColorPrimary = () => {
    const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
    if (bsSheetEl) {
      toggleBodyColorMode(bsSheetEl);
    }
  }
  toggleBodyColorPrimary();  
  const disableStylesheet = (stylesheets) => {
    for (let i=0; i < stylesheets.length; i++) {
      const stylesheet = stylesheets[i];
      stylesheet.rel = 'prefetch';
    }
  }
  const enableStylesheet = (stylesheets) => {
    for (let i=0; i < stylesheets.length; i++) {
      const stylesheet = stylesheets[i];
      stylesheet.rel = 'stylesheet';
    }
  }
  const manageTransitions = (selector, allowTransitions) => {
    const els = window.document.querySelectorAll(selector);
    for (let i=0; i < els.length; i++) {
      const el = els[i];
      if (allowTransitions) {
        el.classList.remove('notransition');
      } else {
        el.classList.add('notransition');
      }
    }
  }
  const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
    const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
    const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
    let newTheme = '';
    if(darkModeDefault) {
      newTheme = isAlternate ? baseTheme : alternateTheme;
    } else {
      newTheme = isAlternate ? alternateTheme : baseTheme;
    }
    const changeGiscusTheme = () => {
      // From: https://github.com/giscus/giscus/issues/336
      const sendMessage = (message) => {
        const iframe = document.querySelector('iframe.giscus-frame');
        if (!iframe) return;
        iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
      }
      sendMessage({
        setConfig: {
          theme: newTheme
        }
      });
    }
    const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
    if (isGiscussLoaded) {
      changeGiscusTheme();
    }
  }
  const toggleColorMode = (alternate) => {
    // Switch the stylesheets
    const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
    manageTransitions('#quarto-margin-sidebar .nav-link', false);
    if (alternate) {
      enableStylesheet(alternateStylesheets);
      for (const sheetNode of alternateStylesheets) {
        if (sheetNode.id === "quarto-bootstrap") {
          toggleBodyColorMode(sheetNode);
        }
      }
    } else {
      disableStylesheet(alternateStylesheets);
      toggleBodyColorPrimary();
    }
    manageTransitions('#quarto-margin-sidebar .nav-link', true);
    // Switch the toggles
    const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
    for (let i=0; i < toggles.length; i++) {
      const toggle = toggles[i];
      if (toggle) {
        if (alternate) {
          toggle.classList.add("alternate");     
        } else {
          toggle.classList.remove("alternate");
        }
      }
    }
    // Hack to workaround the fact that safari doesn't
    // properly recolor the scrollbar when toggling (#1455)
    if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
      manageTransitions("body", false);
      window.scrollTo(0, 1);
      setTimeout(() => {
        window.scrollTo(0, 0);
        manageTransitions("body", true);
      }, 40);  
    }
  }
  const isFileUrl = () => { 
    return window.location.protocol === 'file:';
  }
  const hasAlternateSentinel = () => {  
    let styleSentinel = getColorSchemeSentinel();
    if (styleSentinel !== null) {
      return styleSentinel === "alternate";
    } else {
      return false;
    }
  }
  const setStyleSentinel = (alternate) => {
    const value = alternate ? "alternate" : "default";
    if (!isFileUrl()) {
      window.localStorage.setItem("quarto-color-scheme", value);
    } else {
      localAlternateSentinel = value;
    }
  }
  const getColorSchemeSentinel = () => {
    if (!isFileUrl()) {
      const storageValue = window.localStorage.getItem("quarto-color-scheme");
      return storageValue != null ? storageValue : localAlternateSentinel;
    } else {
      return localAlternateSentinel;
    }
  }
  const darkModeDefault = false;
  let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default';
  // Dark / light mode switch
  window.quartoToggleColorScheme = () => {
    // Read the current dark / light value 
    let toAlternate = !hasAlternateSentinel();
    toggleColorMode(toAlternate);
    setStyleSentinel(toAlternate);
    toggleGiscusIfUsed(toAlternate, darkModeDefault);
  };
  // Ensure there is a toggle, if there isn't float one in the top right
  if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
    const a = window.document.createElement('a');
    a.classList.add('top-right');
    a.classList.add('quarto-color-scheme-toggle');
    a.href = "";
    a.onclick = function() { try { window.quartoToggleColorScheme(); } catch {} return false; };
    const i = window.document.createElement("i");
    i.classList.add('bi');
    a.appendChild(i);
    window.document.body.appendChild(a);
  }
  // Switch to dark mode if need be
  if (hasAlternateSentinel()) {
    toggleColorMode(true);
  } else {
    toggleColorMode(false);
  }
  const icon = "";
  const anchorJS = new window.AnchorJS();
  anchorJS.options = {
    placement: 'right',
    icon: icon
  };
  anchorJS.add('.anchored');
  const isCodeAnnotation = (el) => {
    for (const clz of el.classList) {
      if (clz.startsWith('code-annotation-')) {                     
        return true;
      }
    }
    return false;
  }
  const clipboard = new window.ClipboardJS('.code-copy-button', {
    text: function(trigger) {
      const codeEl = trigger.previousElementSibling.cloneNode(true);
      for (const childEl of codeEl.children) {
        if (isCodeAnnotation(childEl)) {
          childEl.remove();
        }
      }
      return codeEl.innerText;
    }
  });
  clipboard.on('success', function(e) {
    // button target
    const button = e.trigger;
    // don't keep focus
    button.blur();
    // flash "checked"
    button.classList.add('code-copy-button-checked');
    var currentTitle = button.getAttribute("title");
    button.setAttribute("title", "Copied!");
    let tooltip;
    if (window.bootstrap) {
      button.setAttribute("data-bs-toggle", "tooltip");
      button.setAttribute("data-bs-placement", "left");
      button.setAttribute("data-bs-title", "Copied!");
      tooltip = new bootstrap.Tooltip(button, 
        { trigger: "manual", 
          customClass: "code-copy-button-tooltip",
          offset: [0, -8]});
      tooltip.show();    
    }
    setTimeout(function() {
      if (tooltip) {
        tooltip.hide();
        button.removeAttribute("data-bs-title");
        button.removeAttribute("data-bs-toggle");
        button.removeAttribute("data-bs-placement");
      }
      button.setAttribute("title", currentTitle);
      button.classList.remove('code-copy-button-checked');
    }, 1000);
    // clear code selection
    e.clearSelection();
  });
  function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
    const config = {
      allowHTML: true,
      maxWidth: 500,
      delay: 100,
      arrow: false,
      appendTo: function(el) {
          return el.parentElement;
      },
      interactive: true,
      interactiveBorder: 10,
      theme: 'quarto',
      placement: 'bottom-start',
    };
    if (contentFn) {
      config.content = contentFn;
    }
    if (onTriggerFn) {
      config.onTrigger = onTriggerFn;
    }
    if (onUntriggerFn) {
      config.onUntrigger = onUntriggerFn;
    }
    window.tippy(el, config); 
  }
  const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
  for (var i=0; i<noterefs.length; i++) {
    const ref = noterefs[i];
    tippyHover(ref, function() {
      // use id or data attribute instead here
      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
      try { href = new URL(href).hash; } catch {}
      const id = href.replace(/^#\/?/, "");
      const note = window.document.getElementById(id);
      return note.innerHTML;
    });
  }
  const xrefs = window.document.querySelectorAll('a.quarto-xref');
  const processXRef = (id, note) => {
    if (id.startsWith('sec-')) {
      // Special case sections, only their first couple elements
      const container = document.createElement("div");
      if (note.children && note.children.length > 2) {
        for (let i = 0; i < 2; i++) {
          container.appendChild(note.children[i].cloneNode(true));
        }
        return container.innerHTML
      } else {
        return note.innerHTML;
      }
    } else {
      return note.innerHTML;
    }
  }
  for (var i=0; i<xrefs.length; i++) {
    const xref = xrefs[i];
    tippyHover(xref, undefined, function(instance) {
      instance.disable();
      let url = xref.getAttribute('href');
      let hash = undefined; 
      if (url.startsWith('#')) {
        hash = url;
      } else {
        try { hash = new URL(url).hash; } catch {}
      }
      if (hash) {
        const id = hash.replace(/^#\/?/, "");
        const note = window.document.getElementById(id);
        if (note !== null) {
          try {
            const html = processXRef(id, note);
            instance.setContent(html);
          } finally {
            instance.enable();
            instance.show();
          }
        } else {
          // See if we can fetch this
          fetch(url.split('#')[0])
          .then(res => res.text())
          .then(html => {
            const parser = new DOMParser();
            const htmlDoc = parser.parseFromString(html, "text/html");
            const note = htmlDoc.getElementById(id);
            if (note !== null) {
              const html = processXRef(id, note);
              instance.setContent(html);
            } 
          }).finally(() => {
            instance.enable();
            instance.show();
          });
        }
      }
    }, function(instance) {
    });
  }
      let selectedAnnoteEl;
      const selectorForAnnotation = ( cell, annotation) => {
        let cellAttr = 'data-code-cell="' + cell + '"';
        let lineAttr = 'data-code-annotation="' +  annotation + '"';
        const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
        return selector;
      }
      const selectCodeLines = (annoteEl) => {
        const doc = window.document;
        const targetCell = annoteEl.getAttribute("data-target-cell");
        const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
        const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
        const lines = annoteSpan.getAttribute("data-code-lines").split(",");
        const lineIds = lines.map((line) => {
          return targetCell + "-" + line;
        })
        let top = null;
        let height = null;
        let parent = null;
        if (lineIds.length > 0) {
            //compute the position of the single el (top and bottom and make a div)
            const el = window.document.getElementById(lineIds[0]);
            top = el.offsetTop;
            height = el.offsetHeight;
            parent = el.parentElement.parentElement;
          if (lineIds.length > 1) {
            const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
            const bottom = lastEl.offsetTop + lastEl.offsetHeight;
            height = bottom - top;
          }
          if (top !== null && height !== null && parent !== null) {
            // cook up a div (if necessary) and position it 
            let div = window.document.getElementById("code-annotation-line-highlight");
            if (div === null) {
              div = window.document.createElement("div");
              div.setAttribute("id", "code-annotation-line-highlight");
              div.style.position = 'absolute';
              parent.appendChild(div);
            }
            div.style.top = top - 2 + "px";
            div.style.height = height + 4 + "px";
            div.style.left = 0;
            let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
            if (gutterDiv === null) {
              gutterDiv = window.document.createElement("div");
              gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
              gutterDiv.style.position = 'absolute';
              const codeCell = window.document.getElementById(targetCell);
              const gutter = codeCell.querySelector('.code-annotation-gutter');
              gutter.appendChild(gutterDiv);
            }
            gutterDiv.style.top = top - 2 + "px";
            gutterDiv.style.height = height + 4 + "px";
          }
          selectedAnnoteEl = annoteEl;
        }
      };
      const unselectCodeLines = () => {
        const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
        elementsIds.forEach((elId) => {
          const div = window.document.getElementById(elId);
          if (div) {
            div.remove();
          }
        });
        selectedAnnoteEl = undefined;
      };
      // Attach click handler to the DT
      const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
      for (const annoteDlNode of annoteDls) {
        annoteDlNode.addEventListener('click', (event) => {
          const clickedEl = event.target;
          if (clickedEl !== selectedAnnoteEl) {
            unselectCodeLines();
            const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
            if (activeEl) {
              activeEl.classList.remove('code-annotation-active');
            }
            selectCodeLines(clickedEl);
            clickedEl.classList.add('code-annotation-active');
          } else {
            // Unselect the line
            unselectCodeLines();
            clickedEl.classList.remove('code-annotation-active');
          }
        });
      }
  const findCites = (el) => {
    const parentEl = el.parentElement;
    if (parentEl) {
      const cites = parentEl.dataset.cites;
      if (cites) {
        return {
          el,
          cites: cites.split(' ')
        };
      } else {
        return findCites(el.parentElement)
      }
    } else {
      return undefined;
    }
  };
  var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
  for (var i=0; i<bibliorefs.length; i++) {
    const ref = bibliorefs[i];
    const citeInfo = findCites(ref);
    if (citeInfo) {
      tippyHover(citeInfo.el, function() {
        var popup = window.document.createElement('div');
        citeInfo.cites.forEach(function(cite) {
          var citeDiv = window.document.createElement('div');
          citeDiv.classList.add('hanging-indent');
          citeDiv.classList.add('csl-entry');
          var biblioDiv = window.document.getElementById('ref-' + cite);
          if (biblioDiv) {
            citeDiv.innerHTML = biblioDiv.innerHTML;
          }
          popup.appendChild(citeDiv);
        });
        return popup.innerHTML;
      });
    }
  }
});
</script>
<nav class="page-navigation">
  <div class="nav-page nav-page-previous">
      <a href="../qmd/sec_mod_recurrent_element.html" class="pagination-link">
        <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">11</span>&nbsp; <span class="chapter-title">Recurrent element</span></span>
      </a>          
  </div>
  <div class="nav-page nav-page-next">
      <a href="../qmd/sec_mod_da.html" class="pagination-link">
        <span class="nav-page-text"><span class="chapter-number">13</span>&nbsp; <span class="chapter-title">DA - analyse abundancy of clusters - univar</span></span> <i class="bi bi-arrow-right-short"></i>
      </a>
  </div>
</nav>
</div> <!-- /content -->




</body></html>