Files
cellxgene/docs/_site/posts/methods.html

134 lines
6.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 -->
<title>Methods | cellxgene</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Methods" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="An interactive explorer for single-cell transcriptomics data" />
<meta property="og:description" content="An interactive explorer for single-cell transcriptomics data" />
<link rel="canonical" href="https://chanzuckerberg.github.io/cellxgene/posts/methods.html" />
<meta property="og:url" content="https://chanzuckerberg.github.io/cellxgene/posts/methods.html" />
<meta property="og:site_name" content="cellxgene" />
<script type="application/ld+json">
{"url":"https://chanzuckerberg.github.io/cellxgene/posts/methods.html","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://chanzuckerberg.github.io/cellxgene/cellxgene-logo.png"}},"headline":"Methods","description":"An interactive explorer for single-cell transcriptomics data","@type":"WebPage","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/cellxgene/assets/css/style.css?v=3718e894edc8a8f6e7776946695ab37c5c96ec9f">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<img src="/cellxgene/cellxgene-logo.png" alt="cellxgene" />
<p>An interactive explorer for single-cell transcriptomics data</p>
<p>
<a href="/cellxgene/" class="btn">Quick start</a><br>
<a href="/cellxgene/posts/install" class="btn">Installation</a><br>
<a href="/cellxgene/posts/gallery" class="btn">Gallery</a><br>
<a href="https://cellxgene.cziscience.com/" class="btn">Cellxgene data portal</a><br>
<a href="/cellxgene/posts/demo-data" class="btn">Demo datasets</a><br>
<a href="/cellxgene/posts/prepare" class="btn">Preparing your data</a><br>
<a href="/cellxgene/posts/launch" class="btn">Launching cellxgene</a><br>
<a href="/cellxgene/posts/hosted" class="btn">Hosting cellxgene</a><br>
<a href="/cellxgene/posts/annotations" class="btn">Annotating data</a><br>
<a href="/cellxgene/posts/methods" class="btn"><b>Methods</b></a><br>
<a href="/cellxgene/posts/troubleshooting" class="btn">Troubleshooting</a><br>
<a href="/cellxgene/posts/roadmap" class="btn">Roadmap</a><br>
<a href="/cellxgene/posts/contribute" class="btn">Contributing (ideas or code)</a><br>
<a href="/cellxgene/posts/contact" class="btn">Contact & finding help</a><br>
<a href="https://github.com/chanzuckerberg/cellxgene" class="btn" target="_blank">Code</a>
</p>
</header>
<section>
<h1 id="methods">Methods</h1>
<h2 id="data-structure-anndata-fields-used-for-visualization">Data structure: <em>anndata</em> fields used for visualization</h2>
<h3 id="expression-data">Expression data</h3>
<p>Gene expression values are pulled from <code class="language-plaintext highlighter-rouge">anndata.X</code>. These feed into the histograms, scatterplot, colorscale, and differential expression calculations. Were <a href="https://github.com/chanzuckerberg/cellxgene/issues/689">working on ways</a> to incorporate <code class="language-plaintext highlighter-rouge">anndata.raw</code> and other <code class="language-plaintext highlighter-rouge">anndata.layers</code>!</p>
<h3 id="metadata">Metadata</h3>
<p>Categorical (e.g., cluster labels) and continuous (e.g., pseudotime) metadata are pulled from <code class="language-plaintext highlighter-rouge">anndata.obs</code>. Any column added here will be available for visualization in cellxgene. You can also <a href="annotations">create new categorical annotations</a> within the application.</p>
<h3 id="embeddings">Embeddings</h3>
<p>cellxgene looks for embeddings (e.g., tSNE, UMAP, PCA, spatial coordinates) in <code class="language-plaintext highlighter-rouge">anndata.obsm</code>. These fields must follow the scanpy convention of starting with <code class="language-plaintext highlighter-rouge">X_</code>, e.g., <code class="language-plaintext highlighter-rouge">anndata.obsm['X_umap']</code>. If an embedding has more than two components, the first two will be used for visualization.</p>
<h2 id="differential-expression">Differential expression</h2>
<p>Were actively working on how to improve differential expression within the app.
<strong>N.B.: the <a href="https://github.com/chanzuckerberg/cellxgene/blob/main/server/app/scanpy_engine/diffexp.py#L40">current implementation</a> assumes normally distributed values on a linear scale.</strong></p>
<p>Currently, we use a <a href="https://en.wikipedia.org/wiki/Welch%27s_t-test">Welchs <em>t</em>-test</a>, which assumes that the two populations are each normally distributed, but may have unequal variance. We use a two-sided t-test against the null hypothesis that the two populations have <strong>equal</strong> means. P-values are adjusted with the <a href="https://en.wikipedia.org/wiki/Bonferroni_correction">Bonferroni corrrection</a>.</p>
<p>To help avoid spurious results, we use the log fold change to filter genes, retaining those where <code class="language-plaintext highlighter-rouge">|log2( mean(set1) / mean(set2) )| &gt; 0.01</code>; this threshold can be configured with the <a href="launch"><code class="language-plaintext highlighter-rouge">--diffexp-lfc-cutoff</code></a> command. We then sort genes by their associated <code class="language-plaintext highlighter-rouge">|t value|</code> and return the top 15 genes.</p>
</section>
<footer>
<p>This project is maintained by <a href="https://github.com/chanzuckerberg">chanzuckerberg</a></p>
</footer>
</div>
<script src="/cellxgene/assets/js/scale.fix.js"></script>
</body>
</html>