Art is science in love.
— E.F. Weisslitz
The final art pieces are the outcome of a long process of exploration, experimentation and more than a few dead-ends. Here I'll take you through the process of parsing, exploring and drawing the data and finding a story.
The first step was to identify how to present the theme of "differences" in the exhibit. We wanted to draw attention to the fact that the extent to which we can answer questions about biological states depends on how accurate and precise the measurements are. Initially, I thought that this might be a useful theme—highlighting both biological and technical variation.
In parallel, I thought about different functional sources of variation and the kinds of questions that the data might be used to answer. I narrowed them down to differences that cause disease, differences that cause disease progression and differences that allow for a variety of normal function.
We also considered the idea of showing differences due to purely experimental error, which are fluctuations due to the technology not necessarily the biology.
For each of the difference scenarios, the input data set were single-cell gene expression counts.
cell1 sample cell_type gene1 count cell1 sample cell_type gene2 count ... cell2 sample cell_type gene1 count cell2 sample cell_type gene2 count ...
Each cell was identified by its sample (e.g. blood normal vs tumor) and type (e.g. B cell, T cell, etc). Typically, we had counts for about 500 genes of 100's or 1000's of cells of a given type and sample.
The transcriptome of each cell is a point in high-dimensional space—one dimension for each gene for which we have a count. To find a projection of the data onto the page, we dimensionally reduced the data using tSNE (t-distributed stochastic neighbour embedding) into either 2 or 4 dimensions.
# 2 dimensions (x,y) cell1 sample cell_type tsne_x tsne_y cell2 sample cell_type tsne_x tsne_y ... # 4 dimensions (x,y,u,v) cell1 sample cell_type tsne_x tsne_y tsne_u tsne_v cell2 sample cell_type tsne_x tsne_y tsne_u tsne_v ...
When the cells are drawn as points based on their tSNE coordinates, typically they will cluster both by type and disease status. They cluster by type because the gene expression profile for each cell type is different—this is what causes cells to have different function.
What we're looking for here is cells that cluster by disease state within a given cell type cluster, like the classical monocytes highlighted in the figure above. What this happens, we can say that there's something fundamentally different for this cell type between the normal and diseased states. For cell types that don't have a differential expression in disease, we see more of a random mixing of the normal and disease cell populations within their clusters.
I like to start by exploring ways to map the data onto the page. Typically, at this stage I try a lot of different approaches and many take the shortest route to the trash.
The focus of our story is "differences". So, I'll be looking for visuals that capture the Gestalt of a difference. Because we're aiming for an equal mix of art and data visualization, it's not critical that we can judge the differences quantitatively—ability to make qualitative assessments will suffice—but it is important that something obviously appears to be different, both within one panel and across panels.
In the search for an encoding, two basic questions have to be addressed: how cells are to be (a) placed and (b) represented on the page. For example, placement could be systematic, such as on a grid, with order based on some property such as total gene count. With this approach, we can achieve a tiling that covers the full canavs.
Or, placement could be based on properties such as tSNE coordinates. In this case, we settle in not populating the canvas evenly and hope that the cells fall into groups in a meaningful way.
Below is one attempt at a tiling encoding. The cells are represented by a grid of squares and each square shows a comparison of gene counts in disease vs normal for four genes. This layout can be adapted into triangles (3 genes) or hexagons (6 genes).
The genes can be chosen based on ones that are known to be of clinical significance or, as below, identified from the data set as ones that have the largest change in expression between normal and disease. Cells can be ordered based on similarity in counts between normal and disease.
I then tried using the 4-dimensional `(x,y,u,v)` tSNE coordinates to represent each cell, still sticking to a tiling of cells. Cells are drawn in a row-dominant order and those with more similar tSNE coordinates are drawn closer together. For example, for the circular encoding, each concentric circle radius is `(x,x+y,x+y+u,x+y+u+v)`.
Playing with colors and shapes makes for interesting tilings.
As much as all these attempts have pretty shapes and colors, it's hard to point your finger at any part of these encodings and say, "Here's a difference worth investigating."
As well, by placing cells on a grid makes for a rigid represntation. We agreed that we needed something that looked a little more organic. Could the way the cells were drawn look like actual cells?
We started looking at drawing the cells based on their 2-dimensional tSNE coordinates. In this representation, cells that are closer together on the plane have more similar transcription profiles.
With this approach, it was really easy to draw attention to differences—either by cell type (which we wanted to do in the normal function case) or disease status. We also felt that this would be a familiar approach and one that showed populations of cells at the resolution of single cells.
One of the data sets that we identified early was the internal validation set, which captured the variability between operators and technical replication. Below are the results of six experiments, each done by a different operator on two different days. Here, we don't expect (and we don't see) any clustering based on days or operators. In the end, we chose not make use of this data set in the final exhibit and focus instead on clinically relevant differences.
We then explored ways in which the tSNE coordinates could be used to derive different representations, such as a network or tesselation.
By hiding the cells and filling the polygons based on cell type and mixing the neighbouring polygon colors, we get a
A more organic feel can be achieved by perturbing the edges of both the cells and polygons. We were happy enough with this representation to use it on the introductory panel in the exhibit.
The distance between a given tumor cell and its nearest normal cell of the same type can be emphasized by encoding the distance with color, such as below.
At this point we decided to explore mapping this difference by the 3rd dimension, literally.
The stereoscopic image shown above is a quick prototype generated in Illustrator. The final images were rendered in a full 3D environment using Cinema4D.
Quantile regression explores the effect of one or more predictors on quantiles of the response. It can answer questions such as "What is the weight of 90% of individuals of a given height?"
Unlike in traditional mean regression methods, no assumptions about the distribution of the response are required, which makes it practical, robust and amenable to skewed distributions.
Quantile regression is also very useful when extremes are interesting or when the response variance varies with the predictors.
Das, K., Krzywinski, M. & Altman, N. (2019) Points of significance: Quantile regression. Nature Methods 16:451–452.
Altman, N. & Krzywinski, M. (2015) Points of significance: Simple linear regression. Nature Methods 12:999–1000.
Outliers can degrade the fit of linear regression models when the estimation is performed using the ordinary least squares. The impact of outliers can be mitigated with methods that provide robust inference and greater reliability in the presence of anomalous values.
We discuss MM-estimation and show how it can be used to keep your fitting sane and reliable.
Greco, L., Luta, G., Krzywinski, M. & Altman, N. (2019) Points of significance: Analyzing outliers: Robust methods to the rescue. Nature Methods 16:275–276.
Altman, N. & Krzywinski, M. (2016) Points of significance: Analyzing outliers: Influential or nuisance. Nature Methods 13:281–282.
Two-level factorial experiments, in which all combinations of multiple factor levels are used, efficiently estimate factor effects and detect interactions—desirable statistical qualities that can provide deep insight into a system.
They offer two benefits over the widely used one-factor-at-a-time (OFAT) experiments: efficiency and ability to detect interactions.
Since the number of factor combinations can quickly increase, one approach is to model only some of the factorial effects using empirically-validated assumptions of effect sparsity and effect hierarchy. Effect sparsity tells us that in factorial experiments most of the factorial terms are likely to be unimportant. Effect hierarchy tells us that low-order terms (e.g. main effects) tend to be larger than higher-order terms (e.g. two-factor or three-factor interactions).
Smucker, B., Krzywinski, M. & Altman, N. (2019) Points of significance: Two-level factorial experiments Nature Methods 16:211–212.
Krzywinski, M. & Altman, N. (2014) Points of significance: Designing comparative experiments.. Nature Methods 11:597–598.
Celebrate `\pi` Day (March 14th) and set out on an exploration explore accents unknown (to you)!
This year is purely typographical, with something for everyone. Hundreds of digits and hundreds of languages.
A special kids' edition merges math with color and fat fonts.
One moment you're
:) and the next you're
Make sense of it all with my Tree of Emotional life—a hierarchical account of how we feel.