Example re-analysis of an Influenza Vaccine Response Study using HAI (hemagglutination inhibition) assays

In this tutorial we will show you how to acquire, analyze, and display the demographic and HAI assay data from one study in ImmPort using R and Python analysis code. The code is freely available.

Age vs gender

The demographic data can be graphically rendered to facilitate exploration of age, gender and population characteristics of the study subjects.

HAI response vs Virus Strain

HAI results can be grouped by titer pre- and post-vaccination in a single overview plot.

HAI response vs Age and Virus Strain

HAI results can be displayed according to subject age and viral strain.


There are two versions of the analysis code, one written in R and the other in Python. Both versions complete the same analysis steps and render graphic summaries of the results.

Analysis using R

The analysis code was developed to use either the MySQL or the Tab version of the data.
The details of the code that uses the MySQL data format and the graphics it produces are available here.
An example HTML output from running the Tab version of the code is available here.
The R code for running the analysis using the MySQL version is available for download InfluenzaVaccination_SDY212_MySQL.R.
The R Markdown code for running the analysis using the MySQL version is available for download InfluenzaVaccination_SDY212_MySQL.Rmd.
The R code for running the analysis using the Tab version is available for download InfluenzaVaccination_SDY212_Tab.R.
The R Markdown code for running the analysis using the Tab version is available for download InfluenzaVaccination_SDY212_Tab.Rmd.
The code was written using RMarkdown and was developed and executed using the RStudo software.

Analysis using Jupyter Notebook

The code was written and executed using Jupyter Notebook.
The Python code for running the analysis using the Tab version is available for download InfluenzaVaccination_SDY212_Tab-v2.2017.ipynb
An example HTML output from running the Tab version of the code is available here.
Instructions on how to install Jupyter Notebook here.