2024 π Daylatest newsbuy art
syncopation & accordionCafe de Flore (Doctor Rockit)like France, but no dog poopmore quotes
very clickable
data visualization + databases

Schemaball

Circular visualization of database schemas

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SCHEMABALL CAN ACCOMODATE VARIOUS SCHEMA SIZES | (left) A Medline citation database with 12 tables. (middle) A ugene database with 35 tables. (right) A massive sequencing LIMS database with 135 tables.

Schemaball was published in SysAdmin Magazine (Krzywinski, M. Schemaball: A New Spin on Database Visualization (2004) Sysadmin Magazine Vol 13 Issue 08). Who cites Schemaball?

These tutorials illustrate different features of Schemaball. Tutorials are divided into sections. Each section covers a particular aspect of a feature or set of features. Each section has its own documentation, configuration file and schema ball image.

all tutorials

tutorial 4

Highlighting schema diagram elements.

NAME

sbtut_04 - highlighting schema elements

SYNOPSIS

  <table>
  <highlight_rx>
  misc
  feature
  </highlight_rx>
  fill_hi    = acff96
  outline_hi = ffffff
  </table>

  <table>
  <highlight_rx>
  !_feature
  </highlight_rx>
  fill_hi    = c2cdef
  outline_hi = ffffff
  </table>

  <highlight_rx>
  ^.*feature.*__
  </highlight_rx>

  <highlight_rx>
  __.*feature.*$
  </highlight_rx>

PURPOSE

This tutorial will illustrate how to use highlighting to apply a different colour scheme to elements in the schema diagram.

TUTORIAL

Highlighting is controlled in a similar manner to visibility. The element blocks <link> and <table> have a highlight_file parameter and a <highlight_rx> block, used to store regular expressions applied to the names of the elements. When an element name matches, its colour scheme will be determined by FIELD_hi elements (e.g. stroke_hi, fill_hi, etc).

Highlighting Tables

Highlighting specific tables is best done using the <highlight_rx> block. Here, tables whose names contain the strings ``misc'' or ``feature'' will be coloured differently. You can independently adjust the fill colour and the width and colour of the glyph outline.

  <table>
  ...
  <highlight_rx>
  misc
  feature
  </highlight_rx>
  ...
  fill_hi    = acff96
  outline_hi = ffffff
  ...
  </table>

The resulting image is sbtut_04_01.png

Fading Tables

The highlight feature can be subverted to fade all but a given set of tables. To select all tables except those that match a regular expression, append !_ to the regular expression. This configuration will apply the highlight colours, designed to fade into the background, to all tables except those which have ``feature'' in their names.

  <table>
  ...
  <highlight_rx>
  !_feature
  </highlight_rx>
  ...
  fill_hi    = c2cdef
  outline_hi = ffffff
  ...
  </table>

The resulting image is sbtut_04_02.png

Highlighting Links

Highlighting constraint links is done the same way as tables. Remember that links are named like table1__table2. This convention allows you to create regular expressions to select links that start at a table (e.g. table1__) or end at a table (e.g. __table2).

When highlighting links, you can control the colour and thickness of the line. This configuration will highlight all links starting and ending at a table whose name contains the string ``feature''.

  <link>
  ...
  <highlight_rx>
  feature
  </highlight_rx>
  ...
  color_hi  = acff96
  stroke_hi = 3
  ...
  </link>

The resulting image is sbtut_04_03.png.

To highlight only links which start at a given table, or tables, use the fact that the link name is table1__table2. The following highlights only those links which start at a table with a name containing ``feature''.

  <link>
  ...
  <highlight_rx>
  ^.*feature.*__
  </highlight_rx>
  ...
  color_hi  = acff96
  stroke_hi = 3
  ...
  </link>

The resulting image is sbtut_04_04.png.

Similarly, to highlight all links which lead to feature tables,

  <link>
  ...
  <highlight_rx>
  __.*feature.*$
  </highlight_rx>
  ...
  color_hi  = acff96
  stroke_hi = 3
  ...
  </link>

The resulting image is sbtut_04_05.png.

By creating multiple layers with specific links highlighted in different colours you can achieve flexible compositions.

HISTORY

BUGS

Please report errors and suggestions to martink@bcgsc.ca

AUTHOR

Martin Krzywinski, mkweb.bcgsc.ca, martink@bcgsc.ca

$Id: schemaball,v 1.5 2003/10/27 20:25:11 martink Exp $

CONTACT

  Martin Krzywinski
  Genome Sciences Centre
  Vancouver BC Canada
  www.bcgsc.ca
  mkweb.bcgsc.ca
  martink@bcgsc.ca

configuration


################################################################
#
# Schemaball configuration file
#
# Tutorial 04
#
# sbtut_04_01.conf - highlighting schema elements
#

<db>
sqlfile = tutorial/04/hs.sql
</db>

<linkrule fieldregex>
fieldrx   = ^(\w+)_([a-z]+)$
use       = yes
avoidself = yes
<fields>
table = 0
field = 1
</fields>
</linkrule>

<image>

file        = /home/httpd/htdocs/worldatwar/schema.png
size        = 1000
glyphradius = 0.7

background  = c2cdef
foreground  = 61,95,197

<elements>

<link>
show_links = yes
color  = 3d5fc5
stroke = 2
anchor = edge
type = bezier

</link>

<bezier>
resolution = 100
radius = 0.1
</bezier>

<label>
font   = tahoma.ttf
size   = 10
</label>

<table>
size    = 25
fill    = 255,219,150
stroke  = 2
outline = 3d5fc5

<highlight_rx>
misc
feature
</highlight_rx>

fill_hi    = acff96
outline_hi = ffffff

</table>

</elements>

</image>

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca

################################################################
#
# Schemaball configuration file
#
# Tutorial 04
#
# sbtut_04_02.conf - highlighting schema elements
#

<db>
sqlfile = tutorial/04/hs.sql
</db>

<linkrule fieldregex>
fieldrx   = ^(\w+)_([a-z]+)$
use       = yes
avoidself = yes
<fields>
table = 0
field = 1
</fields>
</linkrule>

<image>

file        = /home/httpd/htdocs/worldatwar/schema.png
size        = 1000
glyphradius = 0.7

background  = c2cdef
foreground  = 61,95,197

<elements>

<link>
show_links = yes
color  = 3d5fc5
stroke = 2
anchor = edge
type = bezier

</link>

<bezier>
resolution = 100
radius = 0.1
</bezier>

<label>
font   = tahoma.ttf
size   = 10
</label>

<table>
size    = 25
fill    = 255,219,150
stroke  = 2
outline = 3d5fc5

<highlight_rx>
!_feature
</highlight_rx>

fill_hi    = c2cdef
outline_hi = 7b96e4

</table>

</elements>

</image>

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca

################################################################
#
# Schemaball configuration file
#
# Tutorial 04
#
# sbtut_04_03.conf - highlighting schema elements
#

<db>
sqlfile = tutorial/04/hs.sql
</db>

<linkrule fieldregex>
fieldrx   = ^(\w+)_([a-z]+)$
use       = yes
avoidself = yes
<fields>
table = 0
field = 1
</fields>
</linkrule>

<image>

file        = /home/httpd/htdocs/worldatwar/schema.png
size        = 1000
glyphradius = 0.7

background  = c2cdef
foreground  = 61,95,197

<elements>

<link>
show_links = yes
color  = 3d5fc5
stroke = 2
anchor = edge
type = bezier

<highlight_rx>
feature
</highlight_rx>

color_hi  = acff96
stroke_hi = 3

</link>

<bezier>
resolution = 100
radius = 0.1
</bezier>

<label>
font   = tahoma.ttf
size   = 10
</label>

<table>
size    = 25
fill    = 255,219,150
stroke  = 2
outline = 3d5fc5

</table>

</elements>

</image>

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca

################################################################
#
# Schemaball configuration file
#
# Tutorial 04
#
# sbtut_04_04.conf - highlighting schema elements
#

<db>
sqlfile = tutorial/04/hs.sql
</db>

<linkrule fieldregex>
fieldrx   = ^(\w+)_([a-z]+)$
use       = yes
avoidself = yes
<fields>
table = 0
field = 1
</fields>
</linkrule>

<image>

file        = /home/httpd/htdocs/worldatwar/schema.png
size        = 1000
glyphradius = 0.7

background  = c2cdef
foreground  = 61,95,197

<elements>

<link>
show_links = yes
color  = 3d5fc5
stroke = 2
anchor = edge
type = bezier

<highlight_rx>
^.*feature.*__
</highlight_rx>

color_hi  = acff96
stroke_hi = 3

</link>

<bezier>
resolution = 100
radius = 0.1
</bezier>

<label>
font   = tahoma.ttf
size   = 10
</label>

<table>
size    = 25
fill    = 255,219,150
stroke  = 2
outline = 3d5fc5

</table>

</elements>

</image>

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca

################################################################
#
# Schemaball configuration file
#
# Tutorial 04
#
# sbtut_04_05.conf - highlighting schema elements
#

<db>
sqlfile = tutorial/04/hs.sql
</db>

<linkrule fieldregex>
fieldrx   = ^(\w+)_([a-z]+)$
use       = yes
avoidself = yes
<fields>
table = 0
field = 1
</fields>
</linkrule>

<image>

file        = /home/httpd/htdocs/worldatwar/schema.png
size        = 1000
glyphradius = 0.7

background  = c2cdef
foreground  = 61,95,197

<elements>

<link>
show_links = yes
color  = 3d5fc5
stroke = 2
anchor = edge
type = bezier

<highlight_rx>
__.*feature.*$
</highlight_rx>

color_hi  = acff96
stroke_hi = 3

</link>

<bezier>
resolution = 100
radius = 0.1
</bezier>

<label>
font   = tahoma.ttf
size   = 10
</label>

<table>
size    = 25
fill    = 255,219,150
stroke  = 2
outline = 3d5fc5

</table>

</elements>

</image>

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
news + thoughts

Nasa to send our human genome discs to the Moon

Sat 23-03-2024

We'd like to say a ‘cosmic hello’: mathematics, culture, palaeontology, art and science, and ... human genomes.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SANCTUARY PROJECT | A cosmic hello of art, science, and genomes. (details)
Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SANCTUARY PROJECT | Benoit Faiveley, founder of the Sanctuary project gives the Sanctuary disc a visual check at CEA LeQ Grenoble (image: Vincent Thomas). (details)
Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
SANCTUARY PROJECT | Sanctuary team examines the Life disc at INRIA Paris Saclay (image: Benedict Redgrove) (details)

Comparing classifier performance with baselines

Sat 23-03-2024

All animals are equal, but some animals are more equal than others. —George Orwell

This month, we will illustrate the importance of establishing a baseline performance level.

Baselines are typically generated independently for each dataset using very simple models. Their role is to set the minimum level of acceptable performance and help with comparing relative improvements in performance of other models.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Comparing classifier performance with baselines. (read)

Unfortunately, baselines are often overlooked and, in the presence of a class imbalance5, must be established with care.

Megahed, F.M, Chen, Y-J., Jones-Farmer, A., Rigdon, S.E., Krzywinski, M. & Altman, N. (2024) Points of significance: Comparing classifier performance with baselines. Nat. Methods 20.

Happy 2024 π Day—
sunflowers ho!

Sat 09-03-2024

Celebrate π Day (March 14th) and dig into the digit garden. Let's grow something.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2024 π DAY | A garden of 1,000 digits of π. (details)

How Analyzing Cosmic Nothing Might Explain Everything

Thu 18-01-2024

Huge empty areas of the universe called voids could help solve the greatest mysteries in the cosmos.

My graphic accompanying How Analyzing Cosmic Nothing Might Explain Everything in the January 2024 issue of Scientific American depicts the entire Universe in a two-page spread — full of nothing.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
How Analyzing Cosmic Nothing Might Explain Everything. Text by Michael Lemonick (editor), art direction by Jen Christiansen (Senior Graphics Editor), source: SDSS

The graphic uses the latest data from SDSS 12 and is an update to my Superclusters and Voids poster.

Michael Lemonick (editor) explains on the graphic:

“Regions of relatively empty space called cosmic voids are everywhere in the universe, and scientists believe studying their size, shape and spread across the cosmos could help them understand dark matter, dark energy and other big mysteries.

To use voids in this way, astronomers must map these regions in detail—a project that is just beginning.

Shown here are voids discovered by the Sloan Digital Sky Survey (SDSS), along with a selection of 16 previously named voids. Scientists expect voids to be evenly distributed throughout space—the lack of voids in some regions on the globe simply reflects SDSS’s sky coverage.”

voids

Sofia Contarini, Alice Pisani, Nico Hamaus, Federico Marulli Lauro Moscardini & Marco Baldi (2023) Cosmological Constraints from the BOSS DR12 Void Size Function Astrophysical Journal 953:46.

Nico Hamaus, Alice Pisani, Jin-Ah Choi, Guilhem Lavaux, Benjamin D. Wandelt & Jochen Weller (2020) Journal of Cosmology and Astroparticle Physics 2020:023.

Sloan Digital Sky Survey Data Release 12

constellation figures

Alan MacRobert (Sky & Telescope), Paulina Rowicka/Martin Krzywinski (revisions & Microscopium)

stars

Hoffleit & Warren Jr. (1991) The Bright Star Catalog, 5th Revised Edition (Preliminary Version).

cosmology

H0 = 67.4 km/(Mpc·s), Ωm = 0.315, Ωv = 0.685. Planck collaboration Planck 2018 results. VI. Cosmological parameters (2018).

Error in predictor variables

Tue 02-01-2024

It is the mark of an educated mind to rest satisfied with the degree of precision that the nature of the subject admits and not to seek exactness where only an approximation is possible. —Aristotle

In regression, the predictors are (typically) assumed to have known values that are measured without error.

Practically, however, predictors are often measured with error. This has a profound (but predictable) effect on the estimates of relationships among variables – the so-called “error in variables” problem.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Error in predictor variables. (read)

Error in measuring the predictors is often ignored. In this column, we discuss when ignoring this error is harmless and when it can lead to large bias that can leads us to miss important effects.

Altman, N. & Krzywinski, M. (2024) Points of significance: Error in predictor variables. Nat. Methods 20.

Background reading

Altman, N. & Krzywinski, M. (2015) Points of significance: Simple linear regression. Nat. Methods 12:999–1000.

Lever, J., Krzywinski, M. & Altman, N. (2016) Points of significance: Logistic regression. Nat. Methods 13:541–542 (2016).

Das, K., Krzywinski, M. & Altman, N. (2019) Points of significance: Quantile regression. Nat. Methods 16:451–452.

Martin Krzywinski | contact | Canada's Michael Smith Genome Sciences CentreBC Cancer Research CenterBC CancerPHSA
Google whack “vicissitudinal corporealization”
{ 10.9.234.151 }