Martin Krzywinski / Genome Sciences Center / Martin Krzywinski / Genome Sciences Center / - contact me Martin Krzywinski / Genome Sciences Center / on Twitter Martin Krzywinski / Genome Sciences Center / - Lumondo Photography Martin Krzywinski / Genome Sciences Center / - Pi Art Martin Krzywinski / Genome Sciences Center / - Hilbertonians - Creatures on the Hilbert Curve
Thoughts rearrange, familiar now strange.Holly Golightly & The Greenhornes break flowersmore quotes

In Silico Flurries: Computing a world of snow. Scientific American. 23 December 2017

data visualization + art

Martin Krzywinski @MKrzywinski
The BC Cancer Agency’s Personalized Oncogenomics Program (POG) is a clinical research initiative applying genomic sequencing to the diagnosis and treatment of patients with incurable cancers.

Art of the Personalized Oncogenomics Program

Nature uses only the longest threads to weave her patterns, so that each small piece of her fabric reveals the organization of the entire tapestry.
— Richard Feynman

Art is Science in Love
— E.F. Weisslitz

what do the circles mean?

The legend can be printed at 4" × 6". The bitmap resolution is 600 dpi.

 / Martin Krzywinski @MKrzywinski
Quick legend. 5 Years of Personalized Oncogenomics Project at Canada's Michael Smith Genome Sciences Centre. The poster shows 545 cancer cases. (zoom)

a case for a visual case summary

For every case, we sequence the DNA to study the genome structure and the RNA to discover which genes are expressed and to what extent. The analysis is quite complex and brings together many steps: sequence alignment, structural variation detection, expression profiling, pathway analysis and so on. Every case is "summarized" by a lengthy report, such as the one below, which can run to over 40 pages.

Personalized Oncogenomics Program at Canada's Michael Smith Genome Sciences Center / Martin Krzywinski @MKrzywinski
A report for a typical POG case is about 40–50 pages.

One of the goals of the 5-year anniversary art was to represent the cases in a way to clearly show their number, classification as well as diversity. There are many metrics that can be used and I decided to choose the case's correlation to other cancer types.

correlation to TCGA cancer database

For every POG case, the gene expression of 1,744 key genes is compared to that of 1,000's of cases in the TCGA database of cancer samples. For a given cancer type in the TCGA database (e.g. BRCA), we visualize the correlations using box plots. The box plot is ideal for showing the distribution of values in a sample.

Personalized Oncogenomics Program at Canada's Michael Smith Genome Sciences Center / Martin Krzywinski @MKrzywinski
Every case is compared to a database of 1,000's of cases. Shown here are box plots for the Spearman correlation coefficient between the gene expression of the POG case and cancers of a specific type (e.g. BRCA, LUAD, etc). (zoom)

The 10 largest Spearman correlation coefficients for the case shown above are

case    corr    type     tissue
POG661	0.436	BRCA	 Breast
POG661	0.371	PRAD	 Urologic
POG661	0.295	OV	 Gynecologic
POG661	0.257	UCEC	 Gynecologic
POG661	0.244	LUAD	 Thoracic
POG661	0.235	CESC_CAD Gynecologic
POG661	0.225	MB_Adult Central Nervous System
POG661	0.222	KICH	 Urologic
POG661	0.219	THCA	 Endocrine
POG661	0.208	UCS	 Gynecologic

In the figure below I show how the final encoding of the correlations is done. First, the top three correlations are taken—using more generates a busy look and diminishes visual impact. The correlations are encoded as concentric rings.

Because in most cases the differences in the top 3 correlations are relatively small, differences are emphasized by non-linearly scaling the encoding (the correlations are first scaled `r^3`).

Personalized Oncogenomics Program at Canada's Michael Smith Genome Sciences Center / Martin Krzywinski @MKrzywinski
Case POG661. Median gene expression correlations with different cancer types from TCGA database. (A) Top 10 correlations shown as a bar plot. Color coding is by source tissue associated with the cancer type. (B) Top 10 correlations encoded as concentric rings. The width of the ring is proportional to the correlation. (C) Top 3 correlations. (D) Top 3 correlations scaled with a power to emphasize differences. (zoom)

The type face is Proxima Nova. The colors for each tissue source are

         Gastrointestinal  234,62,144
                   Breast  237,75,51
                 Thoracic  242,130,56
              Gynecologic  253,188,61
              Soft tissue  244,217,59
                     Skin  193,216,51
                 Urologic  114,197,49
              Hematologic  29,166,68
            Head and neck  43,168,224
                Endocrine  71,82,178
   Central nervous system  127,65,146
                    Other  150,150,150

news + thoughts

Predicting with confidence and tolerance

Wed 07-11-2018
I abhor averages. I like the individual case. —J.D. Brandeis.

We focus on the important distinction between confidence intervals, typically used to express uncertainty of a sampling statistic such as the mean and, prediction and tolerance intervals, used to make statements about the next value to be drawn from the population.

Confidence intervals provide coverage of a single point—the population mean—with the assurance that the probability of non-coverage is some acceptable value (e.g. 0.05). On the other hand, prediction and tolerance intervals both give information about typical values from the population and the percentage of the population expected to be in the interval. For example, a tolerance interval can be configured to tell us what fraction of sampled values (e.g. 95%) will fall into an interval some fraction of the time (e.g. 95%).

Martin Krzywinski @MKrzywinski
Nature Methods Points of Significance column: Predicting with confidence and tolerance. (read)

Altman, N. & Krzywinski, M. (2018) Points of significance: Predicting with confidence and tolerance Nature Methods 15:843–844.

Background reading

Krzywinski, M. & Altman, N. (2013) Points of significance: Importance of being uncertain. Nature Methods 10:809–810.

4-day Circos course

Wed 31-10-2018

A 4-day introductory course on genome data parsing and visualization using Circos. Prepared for the Bioinformatics and Genome Analysis course in Institut Pasteur Tunis, Tunis, Tunisia.

Martin Krzywinski @MKrzywinski
Composite of the kinds of images you will learn to make in this course.

Oryza longistaminata genome cake

Mon 24-09-2018

Data visualization should be informative and, where possible, tasty.

Stefan Reuscher from Bioscience and Biotechnology Center at Nagoya University celebrates a publication with a Circos cake.

The cake shows an overview of a de-novo assembled genome of a wild rice species Oryza longistaminata.

Martin Krzywinski @MKrzywinski
Circos cake celebrating Reuscher et al. 2018 publication of the Oryza longistaminata genome.

Optimal experimental design

Tue 31-07-2018
Customize the experiment for the setting instead of adjusting the setting to fit a classical design.

The presence of constraints in experiments, such as sample size restrictions, awkward blocking or disallowed treatment combinations may make using classical designs very difficult or impossible.

Optimal design is a powerful, general purpose alternative for high quality, statistically grounded designs under nonstandard conditions.

Martin Krzywinski @MKrzywinski
Nature Methods Points of Significance column: Optimal experimental design. (read)

We discuss two types of optimal designs (D-optimal and I-optimal) and show how it can be applied to a scenario with sample size and blocking constraints.

Smucker, B., Krzywinski, M. & Altman, N. (2018) Points of significance: Optimal experimental design Nature Methods 15:599–600.

Background reading

Krzywinski, M., Altman, N. (2014) Points of significance: Two factor designs. Nature Methods 11:1187–1188.

Krzywinski, M. & Altman, N. (2014) Points of significance: Analysis of variance (ANOVA) and blocking. Nature Methods 11:699–700.

Krzywinski, M. & Altman, N. (2014) Points of significance: Designing comparative experiments. Nature Methods 11:597–598.

The Whole Earth Cataloguer

Mon 30-07-2018
All the living things.

An illustration of the Tree of Life, showing some of the key branches.

The tree is drawn as a DNA double helix, with bases colored to encode ribosomal RNA genes from various organisms on the tree.

Martin Krzywinski @MKrzywinski
The circle of life. (read, zoom)

All living things on earth descended from a single organism called LUCA (last universal common ancestor) and inherited LUCA’s genetic code for basic biological functions, such as translating DNA and creating proteins. Constant genetic mutations shuffled and altered this inheritance and added new genetic material—a process that created the diversity of life we see today. The “tree of life” organizes all organisms based on the extent of shuffling and alteration between them. The full tree has millions of branches and every living organism has its own place at one of the leaves in the tree. The simplified tree shown here depicts all three kingdoms of life: bacteria, archaebacteria and eukaryota. For some organisms a grey bar shows when they first appeared in the tree in millions of years (Ma). The double helix winding around the tree encodes highly conserved ribosomal RNA genes from various organisms.

Johnson, H.L. (2018) The Whole Earth Cataloguer, Sactown, Jun/Jul, p. 89

Why we can't give up this odd way of typing

Mon 30-07-2018
All fingers report to home row.

An article about keyboard layouts and the history and persistence of QWERTY.

My Carpalx keyboard optimization software is mentioned along with my World's Most Difficult Layout: TNWMLC. True typing hell.

Martin Krzywinski @MKrzywinski
TNWMLC requires seriously flexible digits. It’s 87% more difficult than using a standard Qwerty keyboard, according to Martin Krzywinski, who created it (Credit: Ben Nelms). (read)

McDonald, T. (2018) Why we can't give up this odd way of typing, BBC, 25 May 2018.