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
And she looks like the moon. So close and yet, so far.Future Islandsaim highmore quotes

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

visualization + design

Martin Krzywinski @MKrzywinski
Cover image for the human genetics special issue. Trends in Genetics October 2012, 28 (10) (lowres, hires, Trends in Genetics)

Creating the Trends in Genetics October 2012 Cover

Lately, I've been making a lot of square things round. So when Rhiannon Macrae, the Editor of Trends in Genetics, requested a Circos-like cover image for the human genetics special edition of the journal, I started drawing circles.

The image was published on the cover of Trends in Genetics human genetics special issue (Trends in Genetics October 2012, 28 (10)).


Circos, Circos tableviewer, Illustrator CS5, and a cup (or two) of Galileo coffee from a Rancilio Epoca.

Other Covers

Circos has appeared on covers of journals and books. Some of the images were designed by me and others were drawn from papers published in the issue.


Martin Krzywinski @MKrzywinski
Cover of Blood, 2 Aug 2012, 120(5). Figure from Egan, J. B., C. X. Shi, et al. (2012). Whole-genome sequencing of multiple myeloma from diagnosis to plasma cell leukemia reveals genomic initiating events, evolution, and clonal tides. Blood 120(5): 1060-1066. (Blood)
Martin Krzywinski @MKrzywinski
Genomics, Aug 2012, 100(2). Figure from Katapadi, V. K., M. Nambiar, et al. (2012). Potential G-quadruplex formation at breakpoint regions of chromosomal translocations in cancer may explain their fragility. Genomics 100(2): 72-80. (Genomics)
Martin Krzywinski @MKrzywinski
Science Translational Medicine, December 2010, 2(61). Figure from Lo, Y. M., K. C. Chan, et al. (2010). Maternal plasma DNA sequencing reveals the genome-wide genetic and mutational profile of the fetus. Sci Transl Med 2(61): 61ra91 (Science Translational Medicine)

Martin Krzywinski @MKrzywinski
EMBO Journal, May 2009, 28(9). Cover design by Martin Krzywinski. (EMBO)
Martin Krzywinski @MKrzywinski
Nature Biotechnology, November 2009, 27(11). Figure from Cho, B. K., K. Zengler, et al. (2009). The transcription unit architecture of the Escherichia coli genome. Nat Biotechnol 27(11): 1043-1049. (Nature Biotechnology)
Martin Krzywinski @MKrzywinski
Genome Research, April 2008, 18(4). Cover design by Ryan Morin (Genome Research)

Martin Krzywinski @MKrzywinski
American Scientist, September/October 2007. Cover design by Martin Krzywinski — how it was done. (American Scientist)


Martin Krzywinski @MKrzywinski
iGenetics, 3rd ed. by Peter Russell (Benjamin Cummings). Cover design by Martin Krzywinski. (iGenetics)
Martin Krzywinski @MKrzywinski
Building Bioinformatics Solutions with Perl, R and MySQL (Oxford University Press). Cover design by Martin Krzywinski. (Building Bioinformatics Solutions)
Martin Krzywinski @MKrzywinski
Designing Universal Knowledge by Gerlinde Schuller (Lars Müller Publishers) (Designing Universal Knowledge)

Martin Krzywinski @MKrzywinski
Chromosomes — art book of film stills, David Cronenberg. Contribution to book design by Martin Krzywinski. (Chromosomes)

source of design

I have a collection of unpublished Circos posters and thought these might be a good starting point. Rhiannon and I narrowed the choice down to the black-and-white design that showed sequenced organisms. We also liked the complex style of a panel of hundreds of Circos images generated with the tableviewer.

Martin Krzywinski @MKrzywinski
An old Circos poster. (zoom)
Martin Krzywinski @MKrzywinski
A panel of images generated from the Circos tableviewer. (zoom)

The idea would be that the foreground would be more artistic and stylized, while the background was more technical and complex. I have thousands of images available from the tableviewer (e.g. huge 15,129 image matrix).

Rhiannon also wanted to include the quote by Henry David Thoreau, "Nature and human life are as various as our several constitutions. Who shall say what prospect life offers to another?" This reminded me of a similar but more tragic line from Shakespeare's Julius Caesar, "How many ages hence shall this our lofty scene be acted over in states unborn and accents yet unknown!"

early comps

In the early comps we played around with the idea of using non-genomics elements in the image, such as coins. We thought that we could use the variety of color and shape of the coins to communicate the idea of genetic diversity. However, after wrestling with how to do this effectively the concept was scrapped — the idea of using coins felt both arcane and arbitrary.

Martin Krzywinski @MKrzywinski
First set of comps. (zoom)

I decided to go with a warm brown color scheme. It's not a color I use a lot of, which makes me think that I should try to do more with it.

Deep brown provides great contrast for saturated colors, though I had to be careful not to make the image look too kitchy with an excess of colour variation. In some of the early comps shown above, two or more different color palettes were used (e.g. grey/red/blue and false color) and this lowered to overall visual cohesion of the image.

It's always a good idea to add variety to design. After all, without any variety we'd be left with a blank page. Ok, so variety is good, but too much variety is very bad, and can make you wish for that blank page again. Think about this: one kind of variety already provides variety! A variety of variety (I run the risk of recursing myself ad infinitum) can not only compete for attention but resonate destructively (that's design-speak for "turn into visual mush").

refining the design

Everyone liked the combination of bright colors and dark background. This is an approach I favour too, which has worked well on other covers.

Martin Krzywinski @MKrzywinski
Experimenting with an organic look. (zoom)

Briefly I experimented with various brush and pencil filters to give the image a more hand-drawn and organic look. Most of the illustrations I generate are very digital — blocks of solid colors and high-contrast shapes — and I thought a departure from this look could work in this case. However, like with the coins, this path didn't produce anything productive.

Martin Krzywinski @MKrzywinski
Refining color palettes. (zoom)

final image elements

Martin Krzywinski @MKrzywinski
The background is created from a matrix of about 1,400 individual Circos images created by the user community using the tableviewer. (zoom)
Martin Krzywinski @MKrzywinski
The main element is a Circos image of a 15 x 15 table, also created with the tableviewer. (zoom)

Martin Krzywinski @MKrzywinski
A watermark made up from elements in a tableviewer image that show aggregate statistics for each row and column. (zoom)
Martin Krzywinski @MKrzywinski
A multi-crop zoom of the main element shown above. This version is colored for punch. (zoom)

Martin Krzywinski @MKrzywinski
Masks showing the locations of smaller vignettes. (zoom)
Martin Krzywinski @MKrzywinski
An 8 x 8 tableviewer image with outlined ribbons. (zoom)

Martin Krzywinski @MKrzywinski
Thoreau quote: Nature and human life are as various as our several constitutions. Who shall say what prospect life offers to another? (zoom)

Martin Krzywinski @MKrzywinski
Background and midground elements. (zoom)
Martin Krzywinski @MKrzywinski
Background and foreground elements. (zoom)

final image

Martin Krzywinski @MKrzywinski
Final image with all the layers. (Trends in Genetics October 2012, 28 (10)) (zoom)

news + thoughts

Classification and regression trees

Fri 28-07-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
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
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
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.

Dark Matter of the English Language—the unwords

Wed 07-06-2017

I've applied the char-rnn recurrent neural network to generate new words, names of drugs and countries.

The effect is intriguing and facetious—yes, those are real words.

But these are not: necronology, abobionalism, gabdologist, and nonerify.

These places only exist in the mind: Conchar and Pobacia, Hzuuland, New Kain, Rabibus and Megee Islands, Sentip and Sitina, Sinistan and Urzenia.

And these are the imaginary afflictions of the imagination: ictophobia, myconomascophobia, and talmatomania.

And these, of the body: ophalosis, icabulosis, mediatopathy and bellotalgia.

Want to name your baby? Or someone else's baby? Try Ginavietta Xilly Anganelel or Ferandulde Hommanloco Kictortick.

When taking new therapeutics, never mix salivac and labromine. And don't forget that abadarone is best taken on an empty stomach.

And nothing increases the chance of getting that grant funded than proposing the study of a new –ome! We really need someone to looking into the femome and manome.