knitr::opts_chunk$set(warning = FALSE)

````{=html}

## Introduction

The methods for labeling the cell type for single-cell RNA-sequencing (scRNAseq) data varies a lot. Including using a labeled reference dataset as the training set and classifying the test data by cluster or individual cells, or using a prior knowledge of the projection between marker gene sets and specific cell types and labeling the cells basing on detected markers. Currently, SCTK only supports using `SingleR`[@Aran2019] for cell type labeling, which works with the first approach as previously mentioned. We are planning to add more methods that annotate cells in various ways.  

`SingleR` is an automatic annotation method for scRNAseq data. Given a reference dataset of samples (single-cell or bulk) with known labels, it labels new cells from a test dataset based on similarity to the reference. The only prerequisite for using this method is a labeled reference dataset, and we have already enabled automated caching of online datasets, while users can always use their own data in the console analysis.  

To view detailed instructions on how to use this method, please select 'Interactive Analysis' for using `SingleR` in shiny application or 'Console Analysis' for using this method on R console from the tabs below: <br>


## Workflow Guide

````{=html}
<div class="tab">
  <button class="tablinks" onclick="openTab(event, 'interactive')" id="ia-button">Interactive Analysis</button>
  <button class="tablinks" onclick="openTab(event, 'console')" id="console-button">Console Analysis</button>
</div>

<div id="interactive" class="tabcontent">

Entry

entry\

Users should enter the page as instructed in the screenshot above, by clicking on "Differential Expression & Cell Type Labeling" first and choosing "Cell Type Labeling" sub-option next.

Usage

panel\ panel2\ There are 6 basic widgets that users need to work with before reaching to the result:

  1. Select assay - Select the feature expression matrix for the comparison against the reference dataset. This matrix has to be a log-normalized assay. (How to normalize an assay with SCTK)
  2. Choose a reference - Select the curated online reference dataset. There are multiple options that cover the need of analyzing data from human and mouse and from different tissues. The link at the bottom will pop users to the detail of the reference, which is currently chosen.
  3. Labeling level - For most of the provided references, there will be 3 levels of annotations - "main" for main cell types, "fine" for more subtypes, and with "ont", subtypes are mapped to Cell Ontology.
  4. Feature type - Choose the identifier type that matches with users' dataset. Unfortunately, the references are only annotated with symbols and ensembl IDs. Therefore, users working with other types of IDs might need to do the conversion prior to using this functionality. Automated conversion maybe added in future versions of SCTK.
  5. Label by - Whether to label each cell individually or label each pre-identified cluster. (How to cluster cells)

  6. 5.1. Use cluster label - Choose the cell level annotation that represent the clustering result. This option will only pop out when users choose "Clusters" in "Label by".

  7. Label - The button to trigger the algorithm. Click on this to run the cell type labeling process.

The result will not be pop out directly, but three levels of cell annotation will be inserted to the background object. They will all have the same prefix as "SingleR_{reference abbr}_{annotation level}_", then "score", "labels", "delta.next" and "pruned.labels", respectively. "labels" contains the predicted label, basing only on the maximum entry in scores. "delta.next" contains difference between the best and next-best score. "pruned.labels" contains predictions where "low-quality" labels are replaced with NAs.

With older versions of SingleR, the output variables ends with "score", "first.labels", "labels" and "pruned.labels", respectively. "first.labels" refers to the labeling initially indicated by the scores, "labels" is fine-tuned, and "pruned.labels" is the pruned result.

Visualization

SCTK does not have a quick visualization at this point. But users can go to the CellViewer tab to create a scatter plot using the pre-generated embedding and color it with the cell type labeling result.

````{=html}

wzxhzdk:2 ## References

compbiomed/singleCellTK documentation built on May 8, 2024, 6:58 p.m.