Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - contact me Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca on Twitter Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - Lumondo Photography Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - Pi Art Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - Hilbertonians - Creatures on the Hilbert Curve
In your hiding, you're alone. Kept your treasures with my bones.Coeur de Piratecrawl somewhere bettermore quotes

typography: fun



EMBO Practical Course: Bioinformatics and Genome Analysis, 5–17 June 2017.


art + design

Math geek? If you like the clean geometric design of the type posters, you may enjoy something even more mathematical. Design that transcends repetition: Art of Pi, Phi and e posters.

Visions of Type

eyes on the universe

These typographical posters are designed after the style of the Snellen Chart, which is one of the kinds of eye charts used to measure visual acuity.

If you love looking, seeing and the universe, these posters are for you. They are available for purchase.

optotypes

Symbols on such charts are known as optotypes. Fonts by Andrew Howlett exist whose glyphs conform to the properties of optotypes: Snellen font and Sloan font. However, some of the characters in the Snellen font file are a little oddly shaped—I provide my redesign of the Snellen font in which the glyphs are more consistent (see below). Lowercase characters are not available.

For the posters here, I've used either my redesigned Snellen font or Monotype's Rockwell, with minor stroke and kerning adjustments in places. Some symbols, such as on the math chart, were designed by hand.

The numbers on the left side of the posters (e.g. 20/30) are a measure of visual acuity. The numbers on the right provide information about what is shown on the line (e.g. abundance of elements).

Snellen chart design

The charts are designed to be viewed at a distance of 6 meters (20 feet). At this distance, ability to resolve a letter tha subtends 5 minute of arc corersponds to 6/6 (or 20/20) visual acuity. This corresponds to a letter size of $$\frac{2\pi}{360} \times \frac{5}{60} \times 6 = 8.727 \, \text{mm} = 24.74 \, \text{pt}$$

The Snellen optotypes are designed on a 5 × 5 grid and have a fascinating history. For design, Rockwell and Lubalin Graph can be used to approximate Snellen, though these fonts lack the grid structure of the optotypes.

Snellen optotypes of the 9 letters used in eye charts. The optotypes are compared to characters from the Rockwell Bold font. / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Snellen optotypes are designed on a 5 × 5 grid. At a viewing distance of 6 m (20 ft) each letter on the 6/6 (or 20/20) acuity line must be 8.727 mm (24.47 pt). The optotypes are compared to the characters from the Rockwell Bold font, which is a mediocre approximation. (zoom)

snellen optotype font

Below I show the difference between Andrew's version of Snellen and my own redesign of the font—read about redesign process—which reinterprets some of the characters and adds lowercase.

You can download both versions of the font.

Characters in the Snellen TrueType font and my redesign of some of the characters. / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Snellen optotypes are designed on a 5 × 5 grid. At a viewing distance of 6 m (20 ft) each letter on the 6/6 (or 20/20) acuity line must be 8.727 mm (24.47 pt) (zoom, zoom, about the design, download Snellen font)

the posters

conventional Snellen charts

These Snellen charts include acuity lines from 20/200 to 20/10.

The charts should be printed at a physical size of 16" × 24" (1150 pt × 1725 pt. At this size, the characters on the 20/20 line subtend 5 minutes of arc when viewed at 6 meters (20 feet), which is the technical specification of the Snellen chart.

When the charts are printed at this size, the two horizontal lines below the 20/30 and 20/20 lines are exactly 8" (576 pt) long. These length markers are my own addition.

If the chart is printed at any other size, the viewing distance changes. To compute the correct viewing distance, `d`, measure the length of these lines, `L` (in inches) and use $$ d = 6 \times L / 8 $$

For example, if I print this chart to fit onto an 8.5" × 11" page, these lines are 3.47". Thus, my smaller chart should be viewed from `6 \times 3.47 / 8 = 2.60 \, \text{m}` (8.53 ft).

Numbers on the left provide visual acuity in feet. Numbers on the right show the denominator of the acuity in feet and its equivalent in meters, rounded to the nearest integer.

The order of the 61 characters on the charts has been limit uniformity and avoid easily perceived patterns—especially in the case of the genetic sequence Snellen. These restrictions (e.g. limit in the number of repeated n-grams) apply across linebreaks.

9 character Snellen

This is the canonical Snellen chart, using the 9 original characters.

E FP LDO CETD ZOFEL DCZTFP PFLOZDE OZPCELTD TLEFDCOP EDOPTFLC LTCZOEPF FODLPZCT
  1. no more than 8 instances of any character and no fewer than 6
  2. no double characters (e.g. PP does not occur)
  3. no more than 2 repeats of any 2-gram (e.g. LT ... LT ... LT does not occur)
  4. all 3-grams are unique (e.g. LDO does not repeat)
  5. no identical adjacent characters across lines within a distance of one positions.
  6. for a given line, the characters at the same position in the previous 6 lines are all different.

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
A technically accurate Snellen chart using traditional 9 characters C D E F L O P T Z rendered as optotypes. Print at 16 in × 24 in. (BUY ARTWORK)

26 character Snellen

This chart uses all the letters of the alphabet and is typset using my Snellen font redesign.

  1. all letters of the alphabet are used
  2. no more than 3 instances of any character
  3. no double characters (e.g. PP does not occur)
  4. all n-grams (n = 2, 3, ...) are unique
  5. on a given line, all characters are unique
  6. no identical adjacent characters across lines within a distance of 8 positions.
  7. for a given line, the characters at the same position in all other lines are all different.
E FP NBJ GCHQ RKVNX PZLSAY IMEXDBU CYRAVQGH LWKPIJZO XUBHRFEV JTDIGSYZ QFWLMUKA

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
A technically accurate Snellen chart using all 26 letters of the alphabet rendered as optotypes. All n-grams are unique. Print at 16 in × 24 in. (BUY ARTWORK)

genomic sequence Snellen

Since I work in a genome center, the one below is the one we'd use. Thanks to Dr. Nüket Bilgen for suggesting that the chart start with ATG (start codon) and end with one of the stop codons (TAG, TGA, but not TAA since no two adjoining characters can be the same).

  1. no more than 19 instances of any character and no fewer than 15
  2. no double characters (e.g. AA does not occur)
  3. no more than 7 repeats of any 2-gram
  4. no more than 4 repeats of any 3-gram
  5. no more than 2 repeats of any 4-gram or 5-gram
  6. for a given line, the characters at the same position in the previous 2 lines are different
  7. chart starts with start codon ATG
  8. chart ends with stop codon TAG, which appears only once; the other two stop codons (TGA, TAA) do not appear on the chart
A TG CAT ATCG GCATA CGTCTG TACAGAC GTGTACGA CGAGCTAT ACTCTGTG GTCAGAGC CGAGATAG

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
A technically accurate Snellen chart using four genetic bases A T G C rendered as optotypes. The chart begins with the start codon ATG and ends in the stop codon TGA, which appears only once in the chart. Print at 16 in × 24 in. (BUY ARTWORK)

The best alignments of this chart's sequence are to fungus (Leptosphaeria maculans lepidii, 35/42, 83%) and a tapeworm (Diphyllobothrium latum, 24/26, 92%). Thanks to Lorraine May for this observation!

nautical flags Snellen

Charts ahoy!

Z KE CHG XVRM YTWUS JQFINB EZAOXLD NHKVCUGF SWRMIAZP DBTOJYXE FZHLNUKA IVGMYCWR

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
A technically accurate Snellen chart using the nautical flag alphabet rendered as optotypes. Print at 16 in × 24 in. (BUY ARTWORK)

The flag alphabet has been designed to match, as closely as possible, to the style of the Snellen optotypes. In some cases this required that the geometry of the flag had to be adjusted—this may upset the purists and cause havoc on the waterways.

Proportions of colors has been adjusted in some flags to fit symmetrically into the 5 × 5 optotype grid. The checker of N is now a 5 × 5 grid. The number of stripes in Y has been reduced—the width of each stripe is now 20% of the width of the flag. Proportions in C, D, J, R, S, T, W and X have been adjusted so that color strips are a multiple of 20% of the width of the flag. The cross in M and V matches the X used in the Snellen font.

Snellen optotypes for the nautical flag alphabet. / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Snellen optotypes for the nautical flag alphabet. (zoom)

eyes on the elements

Elements are sorted in order of abundance. The numbers on the left show the max and min `-log_{10}` abundance of the elements listed on a given line. For example, 3.0/3.3 for the "N Si Mg S" line in the abundance of elements in the universe indicates that abundance of N is 0.001 and of S is 0.0005.

You can download my tidy plain-text table of abundance of elements in the universe (original source, 83 elements) and table of abundance of elements in the body (original source, 60 elements). These have been parsed from the original sources and give the `-log_{10}` abundance for various elements.


Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart of abundance of the elements in the universe. (BUY ARTWORK)

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart of abundance of the elements in the human body. (BUY ARTWORK)

eyes on physical constants

44 of the most interesting physical constants ranging from the very large (Planck temperature `T_p = 1.4 \times 10^{32} \mathrm{K}`) to the very small (cosmological constant `\Lambda = 1.19 \times 10^{-52} \mathrm{m}^{-2}`). You can download the table of constants and their values.


Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart of physical constants. (BUY ARTWORK)

eyes on mathematical symbols

44 intriguing and perhaps mysterious mathematical symbols ranging from common equality `=` to the esoteric normal subgroup `\triangleleft`.


Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart of mathematical operators and symbols. (BUY ARTWORK)

where's the chart?

The chart is the visual form of a rhetorical question. The letter layout here is the same as in the canonical Snellen chart, which is limited to the 10 Sloan letters C, D, E, F, L, N, O, P, T, Z.


Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart typeset in Braille. (BUY ARTWORK)

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart typeset in Braille. Variant #2. (BUY ARTWORK)

Typographical posters of how the world works in the style of Snellen eye charts
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca buy artwork
Snellen Chart typeset in Braille. Variant #3. (BUY ARTWORK)
VIEW ALL

news + thoughts

Ensemble methods: Bagging and random forests

Mon 16-10-2017
Many heads are better than one.

We introduce two common ensemble methods: bagging and random forests. Both of these methods repeat a statistical analysis on a bootstrap sample to improve the accuracy of the predictor. Our column shows these methods as applied to Classification and Regression Trees.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Ensemble methods: Bagging and random forests. (read)

For example, we can sample the space of values more finely when using bagging with regression trees because each sample has potentially different boundaries at which the tree splits.

Random forests generate a large number of trees by not only generating bootstrap samples but also randomly choosing which predictor variables are considered at each split in the tree.

Krzywinski, M. & Altman, N. (2017) Points of Significance: Ensemble methods: bagging and random forests. Nature Methods 14:933–934.

Background reading

Krzywinski, M. & Altman, N. (2017) Points of Significance: Classification and regression trees. Nature Methods 14:757–758.

...more about the Points of Significance column

Classification and regression trees

Mon 16-10-2017
Decision trees are a powerful but simple prediction method.

Decision trees classify data by splitting it along the predictor axes into partitions with homogeneous values of the dependent variable. Unlike logistic or linear regression, CART does not develop a prediction equation. Instead, data are predicted by a series of binary decisions based on the boundaries of the splits. Decision trees are very effective and the resulting rules are readily interpreted.

Trees can be built using different metrics that measure how well the splits divide up the data classes: Gini index, entropy or misclassification error.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Classification and decision trees. (read)

When the predictor variable is quantitative and not categorical, regression trees are used. Here, the data are still split but now the predictor variable is estimated by the average within the split boundaries. Tree growth can be controlled using the complexity parameter, a measure of the relative improvement of each new split.

Individual trees can be very sensitive to minor changes in the data and even better prediction can be achieved by exploiting this variability. Using ensemble methods, we can grow multiple trees from the same data.

Krzywinski, M. & Altman, N. (2017) Points of Significance: Classification and regression trees. Nature Methods 14:757–758.

Background reading

Lever, J., Krzywinski, M. & Altman, N. (2016) Points of Significance: Logistic regression. Nature Methods 13:541-542.

Altman, N. & Krzywinski, M. (2015) Points of Significance: Multiple Linear Regression Nature Methods 12:1103-1104.

Lever, J., Krzywinski, M. & Altman, N. (2016) Points of Significance: Classifier evaluation. Nature Methods 13:603-604.

Lever, J., Krzywinski, M. & Altman, N. (2016) Points of Significance: Model Selection and Overfitting. Nature Methods 13:703-704.

Lever, J., Krzywinski, M. & Altman, N. (2016) Points of Significance: Regularization. Nature Methods 13:803-804.

...more about the Points of Significance column

Personal Oncogenomics Program 5 Year Anniversary Art

Wed 26-07-2017

The artwork was created in collaboration with my colleagues at the Genome Sciences Center to celebrate the 5 year anniversary of the Personalized Oncogenomics Program (POG).

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
5 Years of Personalized Oncogenomics Program at Canada's Michael Smith Genome Sciences Centre. The poster shows 545 cancer cases. (left) Cases ordered chronologically by case number. (right) Cases grouped by diagnosis (tissue type) and then by similarity within group.

The Personal Oncogenomics Program (POG) is a collaborative research study including many BC Cancer Agency oncologists, pathologists and other clinicians along with Canada's Michael Smith Genome Sciences Centre with support from BC Cancer Foundation.

The aim of the program is to sequence, analyze and compare the genome of each patient's cancer—the entire DNA and RNA inside tumor cells— in order to understand what is enabling it to identify less toxic and more effective treatment options.

Principal component analysis

Thu 06-07-2017
PCA helps you interpret your data, but it will not always find the important patterns.

Principal component analysis (PCA) simplifies the complexity in high-dimensional data by reducing its number of dimensions.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Principal component analysis. (read)

To retain trend and patterns in the reduced representation, PCA finds linear combinations of canonical dimensions that maximize the variance of the projection of the data.

PCA is helpful in visualizing high-dimensional data and scatter plots based on 2-dimensional PCA can reveal clusters.

Altman, N. & Krzywinski, M. (2017) Points of Significance: Principal component analysis. Nature Methods 14:641–642.

Background reading

Altman, N. & Krzywinski, M. (2017) Points of Significance: Clustering. Nature Methods 14:545–546.

...more about the Points of Significance column

`k` index: a weightlighting and Crossfit performance measure

Wed 07-06-2017

Similar to the `h` index in publishing, the `k` index is a measure of fitness performance.

To achieve a `k` index for a movement you must perform `k` unbroken reps at `k`% 1RM.

The expected value for the `k` index is probably somewhere in the range of `k = 26` to `k=35`, with higher values progressively more difficult to achieve.

In my `k` index introduction article I provide detailed explanation, rep scheme table and WOD example.