helena * jambor

scientist interested in RNA, genomics and science visualizations

Category: Miscellaneous

Real viz coming soon, today status: tired!

I have a couple of thing I want to prepare and show, but we, as many in Germany, are submitting a DFG-excellence strategy grant next week. It’s a giant project, for seven years, with many many player’s and a lot of coordination, politics and details… To relax in the evening, i do what I always did to calm myself, drawing!

More information design soon!

Mom, can you draw a unicorn for me…

img_7807.jpg

Stop drawing me mom!

img_7804.jpg

Advertisements

Visualize calendar data in R

Last week, I visualized the days I did sports in 2017 by hand with illustrator. Most of the time, we want however re-tell similar data (I am not giving up sports anytime soon!), so I always look for ways to create visualizations computationally, for example in R. Therefore, today, I show you how to make a viz of data on days of a year in R.

First step: googling (or: duckduck-ing) to find a package other people use for this type of visualization. To my surprise, this took a very long time! Apparently, there is no default package in R that can visualize calendar data!? I found a very laborious solution that someone made with ggplot (referenced here: https://www.r-bloggers.com/ggplot2-time-series-heatmaps/), but it was > 10 lines of code. I then stumbled upon another package, made specifically for visualizing pollutants in air (!), but it works also for other data and is straightforward to use. openair” takes any dataframe with a “date”-column in the standard format (YYYY-MM-DD) and plots whatever you define as the “pollutant”. In my case, the days I did sports were the “pollutant”.

3 easy steps:

  1. Open your data in R, I called my dataframe “sports”.
  2. Then load library(openair)
  3. Plot: calendarPlot(sports, pollutant = “Sports”, year = 2017)

Voila!

Red: days I did sports, yellow: lazy days, white: sick days.

Screen Shot 2018-01-14 at 10.35.29

CalendarPlot() takes a lot more arguments, so you can adjust the colorscheme, labelling of the days and so forth.

Documentation:

http://www.openair-project.org/Downloads/Default.aspx

https://cran.r-project.org/web/packages/openair/index.html

 

 

A New Year’s resolution

*** UPDATE: below! *******

At some point in life, one has to start with sports to stay healthy. On my new job at the CRTD I learned that the brain cells increase with sports and that bones stay strong when close to strong muscles (they actually get signaling molecules telling them to stay young!). In the past years I also had my share of mental challenges, for which the positive influence of sports is widely known. My 2017 New year’s resolution was therefore to do sports as often as possible.

As I love data and data visualizations, I tracked my progress daily. You can see that I steadily increased the number of days with sports to a whopping 90% in July! In January and February, before I started the diary, it was well below half of the days! It is easier to run, swim etc. in summer, and I could not keep this up in fall. But I am very pleased to see that I am still doing sports 2/3 of days a month now. It was difficult keeping it up while traveling and when I had evening appointments (November, our visit of the President of Germany), but even in hotel rooms doing planks for 10 minutes is feasible. Most of the days without sports were when I had visitors!

myYear3

I also tracked exercise time, the kind of sports I did, and other aspects of my life such as my mood (hint: boring dataset, mainly correlates with female cycle!), my food and my alcohol intake. I chose to visualize the alcohol intake alongside here. Interestingly, there is no correlation between sports and alcohol. I do not drink on those days that I feel too miserable for sports. Some days I drank a sip (light grey, a small sherry or so) after my sports, some days I neither drank nor did sports.

My resolution for 2018: visualize data every day, and as often as possible blog about it. To start, here is the making off of this chart. Since I use my diary regularly, I recorded this data on paper:

IMG_0173

I thought about how to present it best. I wanted to show my daily grind and therefore kept it in the calendar format.

I started out making a dot for each day in a simple table format (Step 1) and then adjusted the number of days and numbered them to have a week-like format (Step 2). Sticking to standard practice: labeling 1, 8, 15 is of course counter-intuitive to a 7-day week format, I therefore changed the day labels to 7/14/21 (Step 3).

I then added the actual data: empty space for days without sports, a circle for days I did sports, and a cross for sick days (Step 4). Next, I started the graphic design part: decluttering wherever possible, playing with color and adjusting layout If necessary. For example, the table like grey boxes are not necessary (Step 5), and the lines separating the weeks are ugly, even in grey (Step 6)! Some guide is however needed to wade through the days. Gestalt principles show that white space is more effective in grouping than lines and boxes (Step 7). Using white space to separate the weeks made it necessary to then adjust the “no sports” data points from white to light grey.

Last was to add some more information, a summarizing bar chart showing percentage of days I did sports (not counting sick days), titles, axis labels, tick marks, and I the data of my alcohol consumption (for those months I tracked).

At last – and always at last only!  – I added color, and my favorite is blue. Voila!

 

************* UPDATE ****************

  • Holger commented that bars summarizing each month should be shown in same hue – they actually are, but with different opacity. I tried it without opacity.
  • Someone else wanted to see the months keyed to the weekdays, to check if I hate sports on Monday, and love it on Sundays. Sadly, no pattern emerges:

myYear4

Scales in scientific images

I recently saw drawings by Maria Sybilla Merian at Kupferstichkabinett Berlin and the University Library Dresden. Merian, who lived from 1647 to 1717, is renowned for her exceptional illustrations of biological specimens and gained recognition as a scientist for her nature observations, for example, of insect metamorphosis.

Maria Sibylla Merian (1647-1717) – “Das kleine Buch der Tropenwunder”, Insel Verlag, Leipzig Wiesbaden 1954, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3319993

Merian evidently was genius in choosing frame and magnification in her drawings, but her pictures lack indications of scale*, which are essential in today’s science images. Scales give the reader the key for aligning the image content with reality. To my knowledge, neither Merian nor her predecessors from Antiquity, Byzantium, or Renaissance included scales in their medical and natural science images*. Even in the beginning of the 20th century, images were often considered a waste of space and scales unnecessary as scientists were familiar with each other’s apparatuses and objects. Today however we study invisible processes and structures that are unfamiliar to most of our colleagues and therefore have to include scales in our images.

Comment from Benjamin Moore in nature (1910) when reviewing a biochemistry handbook.

We often include in images a familiar object of a standard size for scale: a penny placed on a rock, a person standing beside a large animal or in a landscape, a measuring tape next to a fossil (or an Earth worm!).

Bar = 1cm (Earth worm lovingly raised by Jeff Woodruff).

Using familiar objects for scale isn’t possible for tiny things. We don’t have a clear mental image of the size of a salt grain or sesames seed to reliably use them to scale for instance cells**. We therefore include scale bars in microscopy images. With ImageJ/FIJI files from any microscope system can be read in along with their scaling information (shout-out to Curtis and Melissa and the Bio-Formats project!). By using Analyze > Tools > Scale Bar we can add the scale bar with a user-defined length, width, color, position, and label. Now the audience can calculate the actual size of objects and relate image with reality.

Four tips for superb scale bars

  • Length: Be kind to your audience and use simple units, such as 100um, 50um, 10 or 2um.
  • Color: Scale bars should have a high contrast with the background. Avoid red, green, or blue bars, as these colors might be considered part of the image.
  • Position: Lower left corner is a safe place. The upper space should be kept for important information like species, cell type, or gene name.
  • Add scale bar last: In the process of writing your manuscript you may re-think the figure size. Also images are re-sized for posters and slides. It is therefore easierst to add only a very fine scale bar with FIJI and then re-draw it in Adobe Illustrator (or PowerPoint, as I I know that about half of you out there use PowerPoint for making figures and posters!).

 

And finally, do not miss this article by Monica Zoppe with an interesting idea on how to communicate subcellular sclales better!

 

* I’d be delighted to stand corrected, and if you find old scientific images with scale bars, or interesting scales, send them my way for my collection!

** a great tool to update yourself in comparable scales in biology is here: http://learn.genetics.utah.edu/content/cells/scale/.

I never cease to be amazed at the relative size differences of cells and how they vary over so many magnitudes!

#BarBarPlots

Recently a kickstarter project raised more than 3000 EUR in one month to campaign for banning all wrong usage of bar plots in scientific journals. This demonstrates two important points: a lot of the plots in scientific journals are somewhat misleading, and a growing number of people feel very uneasy about this!

What exactly is wrong about bar plots? Nothing per se, but everything goes wrong if you use a bar plot for statistical data – this kind of plot species is also infamous as the “dynamite plot”. We are talking about the famous vertical or horizontal boxes that often come in a dazzling array of colors or patterns, with big fat black outlines and overly prominent error bars.

Dynamite_vs_DataPlot

Dynamite Plot                                                          Data Plot

 

Are they common? Very much so! My personal survey [i] of “dynamite plots” in scientific journals revealed that on average 30-60% of articles use them in journals covering a wide range of subjects that include physics, meteorology or psychology where authors typically have rigorous training in applied mathematics. The prevalence of dynamite plots increases as we go towards more life science journals, where 50- 70% of articles are accompanied by a dynamite plot showing a statistical summary [ii].

Most of us are completely accustomed to dynamite plots and happily use them, that is, until we see the light. From then on it is impossible to not hate them! Because it is so obvious they are misleading and make reading of the data just harder than necessary! And, as scientists, we aim for clarity and getting information across concisely!

The top reasons to avoid dynamite plots

  • They hide the real distribution of the data. Do all samples cluster closely? Do they form two groups? Or is there one drastic outlier? Generally, we assume a normal distribution of the data around the mean where there might not be one! In my survey of dynamite plots per journal they were more or less normally distributed.
  • They hide the sample size. From the bar plot you would not have known that I probed one issue of Nature, two issues of Cell and four issues of Development! But for judging scientific data knowledge of the sample size is essential for a proper evaluation of the data! Too often we have to search for the n in axis labeling, figure text, the results, or the methods section to finally find this information. And sometimes it is omitted entirely. A clear understanding of sample size in my opinion is also critical for the review process of a paper and should be demanded by the reviewers! Not showing data, or only showing summary data, should be treated equally to cropping Western blot bands!
  • Many different distributions of data can lead to the very Bar! See the Anscombe quartet. Bar plots are not intended to show statistic distributions, they are for absolute numbers. By plotting the real data we also learn more about the biology!

Not quite convinced? Seeing is believing, check out this figure:

tshirt_totebag

(c) Page Piccinini and the #barbarplots campain

For further information watch the video of the kickstarter campaign (British accent and humor alert!) – ideally with your entire lab and a discussion of this seminal paper on wrong usage of bar charts and this survey of their prevalence in biomedical journals!

Practical advice to avoid dynamite plots

  • Plot charts with statistical programing tool R. You have to either learn it, or be really nice to someone who knows it – if your PhD requires 3 boxplots, maybe invest in a friendly relationship with the bioinformatic geek in your department, a couple of coffees go a long way!
  • Learn how to make box plots in excel! (Here and here is how, but its a bit tedious).
  • Can’t be bothered to do either? Use one of the available web tools such as the boxplot maker from the Tyer’s lab or the plot generator from the University of Belgrade.

 

[i] I probed the top10-articles of Nature in July, the three most recent volumes of Science (August), four issues of Development (Vol 138, 1:3-2011 and Jan 2016), and two issues of Cell journal from 2016 (Jan and August). I was very relaxed and gave the benefit of doubt when I wasn’t sure. But I was rigorous when authors mixed right and wrong usage of bar plots. How does this even happen? Mix of co-authors and some know better than others?

[ii] Disclaimer: this does not mean the other articles have great figure design! I saw multiple uses of 3-dimensional pie charts, rainbow color schemes, other instances of unintentional usage of color, incomprehensible spider graphs and 3-dimensional heat maps! Maybe I will devote another blog post to those.

Color-blind people are your audience too!

This article is also on TheNode http://thenode.biologists.com/color-blind-audiences/photo/

Or, please stop mixing green/red

Color is a key aspect of graphic design, but for many years was not relevant for scientific figures that were largely black and white. Falling prices for color print and electronic publishing changed this dramatically and scientists now frequently produce multi-colored figures. Using color functionally is not always straightforward but few rules exist: do not combine red and green!

Already in 1939 Willard Brinton advised his readers to not use red letters on a green background as they become invisible to color-blind people (and are hideous for the rest of us!). [his great book on data visualization is available for free here]. A century later, when browsing through figures in scientific periodical, this message has not reached everyone.

In charts, it is very straightforward to avoid mixing red and green. If you want to use red, combine it with blue or cyan, if you want to use green, combine it with magenta or orange. That way also color blind people can distinguish the data points. A side note: try starting a chart in black and white, and only add color if absolutely essential.

In laser-microscopy green and red fluorophores are widely used, often in combination. But: Simply because a wavelength of your fluorophore is 488nm this does not mean you have to use green for its display! The camera output doesn’t have color anyway, so you are at liberty to choose a suitable lookup table. Why not be color-blind friendly and choose colors visible to your entire audience. Options that still preserve a little information on the wavelength are green/magenta or cyan/red. Again, consider if two black and white images instead of a composite color. In fact, the contrast is usually higher in greyscale which benefits the display of structure details and subtle intensity differences.

*Rm62 RNA in Drosophila egg chambers part of my postdoc project, find more subcellular RNAs on the Dresden Ovary Table.

Helpful tools:

  • Test color-blind visibility for your images here
  • Choose color for categorical, quantitative and diverging data in charts using color-brewer.

Comment suggesting more tools very welcome!

Teaching Figure Design and RNA in Israel

When PhD students invite to a retreat, it is an honor and obligation to go. They primarily invited me to teach about my research on RNA and its cellular localization, but I convinced them that visualization of biological data,  my recent passion, is as important. I ended up teaching both!
I am now somewhere in the clouds on my way back and am left truly impressed: by the wonderful program put together by the PhD students of the SignGene program; by the excellent organization headed by Dhana Friedrich Alon Appleboim, and their devotion to making an interesting, interactive and innovative program; and I am impressed by the scientific excellence and intellectual curiosity of all SingGene students!

I left Israel mesmerized by its cultural blend. The WinterSchool (held in a pleasant 25C sunshine environment) took place in a modern resort hotel in Elat. While we conferenced, we were surrounded by an orthodox Israelis, American families, Russian tourists, Arabs, Poles, Germans, African families, and Japanese travel groups. After an exhausting day of seminars, we gazed from the Israeli beach into Jordan, Saudi Arabia and Egypt, underneath us the African and Arabian continental plates touching and slowly sliding along each other, remembering all those that were here before: Moses, the Nabateans, the Romans, the silk road traders…

The trip was also personally touching for me. My beloved grandmother, Alice Jambor, had worked for the Israeli embassy in Bonn. She traveled to Israel countless times and loved it passionately. As I loved her passionately, I had long wanted to visit Israel too. While traveling, I kept her close to my heart by wearing a necklace she gifted to me as a child saying “love” in Hebrew.

FullSizeRender-2

I wish love to this beautiful region. I wish the bonds between Germany and the state of Israel remain strong, and those in Germany questioning this will remain a minority. I believe personal friendships strengthen these bonds and that scientific exchanges, such as for example the SignGene program, are fantastic starting points!

Information is Beautiful!

If you want to get inspired of how to create beautiful and informative figures with your data I urge you to browse the Information is Beautiful site.

The categories are Infographic, Data visualization, Interactives, Data journalism, websites and projects. What is missing is a scientific category that would highlight how cutting edge scientific findings are told in a compelling and clear way – if such a category exists, students could submit entries similar to the iGEM competition!

PS you can still vote TODAY on the shortlist of the best visualization!!!

 

how does she do it!!!!????!?!

Meant as a compliment, I still despise being asked in awe how I manage to raise kids and have a (science) career. The simple answer is: I try. And fail. And try again. Just like thousands of other working mothers. I always wonder if people would dare asking this question to a male scientist who also often combine family and career.

I never wanted to comment on working mothers – others said all before, and better. But a recent article in the local newspaper did prompt me to write a reply to the editor. The article portraits two women that, with support from the Technical University of Dresden, combine family and a science career.

The article however fails to notice: it portraits only women! And, they are at the postdoc stage, meaning, they are far from a successful career as independent scientists, which is tied to a professorship. And, the article also fails to mention the reason no female professor was interviewed: the institute in fact has 0% female professors (full and assistant level!) – a fact that I do find noteworthy in the context of this article! Not enough, I kid you not, the support from the TU Dresden is organized though the “office for chronically ill, disabled, and women” – clearly, 50% of the population are considered just another minority.

 

The printed shortened reply:


My entire article here (German):

Leserbrief, Anmerkungen zu „Zwischen Labor und Familie“, SZ 22. August 2016/Campus, Jana Mundus.

Der Artikel beschreibt sehr hübsch zwei Wissenschaftlerinnen am CRTD Institut, das zur Fakultät Naturwissenschaften der TU Dresden gehört. Es fehlt allerdings komplett eine auch nur ansatzweise kritische Auseinandersetzung mit der Situation von Frauen in der Wissenschaft. Warum kamen nicht mehr Professorinnen zu Wort? Es gibt sie nicht!

Ich bin Wissenschaftlerin und Mutter und musste in den letzten Jahren zusehen, wie eine nach der anderen meiner talentierten, ambitionierten und erfolgreichen Kolleginnen aufgegeben hat. Die Gründe sind vielfältig, aber letztendlich gibt es eben die berühmte Glasdecke, durch die Frauen oft nur schwer durchkommen. Und alles „Reinlehnen“ (siehe Sheryl Sandbergs Buch Lean in) reicht eben nicht aus, um die Glasdecke zu durchbrechen. Aber, um unabhängige Forschung zu betreiben, ist das Ziel immer die Professur oder eine äquivalente Stelle an einem Forschungsinstitut. Beide im Artikel beschriebenen Forscherinnen sind noch weit davon entfernt oder kommen da nur schwer hin, weil sie auf einer Nachwuchsstelle (Postdoc) festsitzen, die, wenn sie als Sprungbrett für die Professur genutzt wird, in der Regel vor dem vierzigsten Geburtstag beendet sein sollte (man muss ja auch eine Weile noch Juniorprofessor sein bevor man zum Vollprofessor ernannt wird!).

Das Institut, an dem die beiden Forscherinnen tätig sind, das CRTD, glänzt nicht mit einem hohen Frauenanteil. Im Gegenteil, seit dem Weggang von Professor Elly Tanaka gibt es KEINE Frau in der Riege der Professuren, oder auch nur Nachwuchsprofessuren. An den direkten Nachbarinstituten ist das nicht anders: Am BIOTEC sind gerade mal zwei von 14 Gruppenleiterinnen weiblich. Das dritte Institut am Tatzberg, B-cube, hat ebenfalls: KEINE Frau. Summa summarum ist der Frauenanteil am Center for Molecular and Cellular Bioengineering, dem die drei Institute zugeordnet sind, damit bei knapp über 5%.

Wird sich das ändern? Mit Sicherheit nicht. Woher ich das weiß? Alle Nachwuchsprofessuren an den genannten Instituten wurden mit Männern besetzt, inklusive der neuesten Nachwuchsgruppenleiterstellen. Dies senkt den Frauenanteil nochmals und zementiert den niedrigen Frauenanteil auch langfristig: wie soll man eine Professur mit einer Frau besetzen wenn es unter den Juniorprofessuren schon keine gibt? Dieser geringe Frauenanteil ist eine klare Missachtung der schon vor 10 Jahren vereinbarten „Forschungsorientierte Gleichstellungsstandards“ der DFG, und der von ihr geförderten Forschung!

Gibt es keinen Druck seitens der Universitätsleitung, der Politik, dem Aufsichtsrat? Der Aufsichtsrat (in der Wissenschaft: scientific advisory board) des CRTD und BIOTEC ist zu 100% mit Männern besetzt, denn, anders als in Dax-Konzernen, gibt es hier keine Frauenquote! Der Druck der Politik, trotz einer prominenten Frau, Eva-Maria Stage, an der Spitze des Wissenschaftsbereichs, reicht nicht aus. Und die TU Dresden? Solange die Belange der Frauen in der Stabstelle für „chronisch Kranke, Behinderte und Frauen“ (!!!) behandelt werden, wird sich das Bild festigen, dass Frauen nur eine weitere Minderheit sind, und nicht als exzellente Wissenschaftlerinnen im Hauptinteresse der Universitätsleitung stehen. Aber: wir sind keine Minderheit, wir sind 50%, im Biologie-Studium oft sogar 6—70%, und wir wollen bitte langfristig auch 50% der Professuren besetzten! Warum? Frei nach Justin Trudeau: Because it’s 2016.

What’s next after you postdoc?

Part 2 of “Pie or no Pie”.

Before_after2

In my last blog I discussed why pie charts are hard to read and therefore better to be avoided. Today, I offer a real life example and answer the question of all scientists in training: What’s next after my postdoc? And I have the answer! (at least for those of you working at the Max Planck in Dresden!

According to the numbers collected in the fifteen years since the institute was founded most of you, as you suspected, will not become professors, but most, 74%, will remain closely connected to academic science, by being a staff scientist, on a second postdoc or entering the administration. If you came to MPI to go into industry, bad luck!, your chances are low, as only 11% end up in Pharma (maybe because the tech industry in Dresden is not very strong yet?) Many that work in science-related business become editors or consultants. You don’t fall into any category? Me neither, and we are in the category “other”, which really is a miscellaneous category of people on parental leave or unemployed, working at a bank or freelancing.

So let’s think of how to present the data best. The default to show percentages of a whole is often the pie chart. But – we immediately see a problem: we would like to show the three large categories, academia, science-related businesses, and “others”, but we also want to split up each category into its subgroups, and there are 12 of them! This means, the pie chart has way too many categories to really comprehend them. And, to help the reader, each subcategory therefore must be labeled, resulting in a pie chart completely cluttered with category names and data labels, none of them nicely aligned.

1_PIE_bad

Let’s try the column or bar chart. From last week you might remember that it is easier to use horizontal bar if you have long category names: this gives you plenty of space for the labels, which really is a plus in this case!

Then, when using a bar chart we add another layer of information, and this for instance can be done using color. To visually group subcategories into the large categories, we use three distinct colors for ‘academia’, ‘science-related’, and ‘other’. Need help on choosing color? Colorbrewer is a fantastic resource! (For our plot: we have three data classes and they are all qualitatively different). Now, with one glance we can see the large categories and all subcategories! In addition, I have added a little more text to indicate the name and overall percentage of the three large categories.

3_bar_nice

One reason people love pie charts is that they visually present parts of a whole (although our eyes more often than not struggle to make that out!). To allow the audience to clearly make out parts of a whole, we can use a little trick and extent the bars to 100% (or here 50%) and fill the bar with color according to its percentage. I personally think there are too many categories and that the empty bars create lot of lines clutter on the right hand side. Another possibility is to show stacked bars, but one looks a bit lonely. I’d use this to compare for example the data per year.

Finally, here is a wonderful compilation of atrocious pie charts, and I hope you NEVER use one again.