Skip to main content

PyMICE - a Python™ library for analysis of mice behaviour

Manual analysis of abundant behavioral data produced by automated systems for long-time monitoring of a group of animals is extremely inefficient and error prone. Some systems (like IntelliCage™) are shipped with software enough for basic analysis of the data, however lacking flexibility for more advanced analyses.

To facilitate research reproducibility, same analysis of same data should always yield same results. One (possibly the best) way to achieve such robustness is to have the process automated (due to the IT slogan "let the computer do the work"), therefore reducing number of possible human errors. The other advantage of such approach is that modern computers are both faster and more precise than humans when dealing with numbers.

An automated analysis workflow can be created easily if there is a possibility of a convenient access to data. That is the purpose of development of PyMICE library by our laboratory. The library provides its user with an object oriented application programming interface (API) and a data abstraction layer - therefore shifting ones focus from the form the data is provided to the data itself. A simple analysis can be performed in just a few lines of readable source code (see Figure 1 for an example). Moreover, the library comes with auxiliary tools supporting development of analysis workflows. Some of them facilitate data validation while other are dedicated for workflow configuration.

Figure 1
figure 1

A six-line example of data analysis with PyMICE library. Firstly the library is loaded, secondly data are read from file "". In the third line a list of all visits of mouse named "Jerry" is obtained. Then the first nose poke (if any) from every visit is selected and then - the side of the nose poked door. Finally numbers of left and right doors nose poked as first are counted.


Sponsored by Symfonia NCN grant: UMO-2013/08/W/NZ4/00691

Author information

Authors and Affiliations


Corresponding author

Correspondence to Jakub M Kowalski.

Rights and permissions

This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated.

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kowalski, J.M., Puścian, A., Mijakowska, Z. et al. PyMICE - a Python™ library for analysis of mice behaviour. BMC Neurosci 16 (Suppl 1), P145 (2015).

Download citation

  • Published:

  • DOI:


  • Application Programming Interface
  • Human Error
  • Manual Analysis
  • Data Abstraction
  • Modern Computer