Java Data Grinders -
A Framework for Automated Screening of Behavioral Phenotypes

The goal of this page is to promote the awareness and development of behavioral analytical tools for the 21st century. Current genomic and proteonomic approaches are capable of yielding terrabyte quantities of data within hours. The complexity of behavioral phenotypes imposes an intrinsic upper limit to the application of high-throughput screening to biologically significant behaviors. However, technological advances in the fields of electronics, statistics, and engineering, should be exploited to maximize automation and the temporal and spatial resolution of behavioral analysis. Our current efforts focus on bridging automated analyses of visual media, advanced techniques of statistical inference, with implementations of robotics.

The capabilities provided through this initiative are grouped within the JavaGrinders Class Library: a general package for behavioral analysis that combines interfaces for sensors and robotic control procedures with methods for statistical inference:

Java Applets

Java Applets download automatically as part of webpages and begin to execute their "untrusted" code. In this case, it makes good sense to only allow actions which pose no danger to the local environment. For security reasons, an Applet cannot access or modify files on the local computer where it is running. This requires that data are entered manually and precludes the use of any local data files provided by the user.

Java Applications

Java applications on the other hand must be downloaded and installed like any other program and are therefore not subject to the same security risks and restrictions. A library of Java classes was developed to simplify the specialized aspects of behavioral analysis. With it complex analysis programs can be written using a few lines of code.

The basis of any statistical analysis program is code which (as painless as possible) reads text files, parses them into individual data values, assembles these into variables, lists descriptive stats or allows the selection of specific subsets. Although any Java code uses an extensive library of classes which help in the nuts and bolts of such processes, I found that some programming effort was required to implement these basic tasks. Moreover, these tasks were virtually identical in most of my analysis programs. To help with future programming of this kind I decided to develop and assemble the relevant code into a framework of modular custom classes - the JavaGrindersLib.jar library.

Methods in the class DataFileParser provide generalized techniques to read the content of data files (ASCII-text files) into an internal store, and extract variables of different data types from this internal store with error checking. Data are then stuffed into individual variables which are classes that may contain different data types and form a hierarchical tree.

         - numberVariable
         |
Variable - strVariable    - CharVariable
         |                - StringVariable
         |
         - BooleanVariable
         |
         - MoveVariable
         |
         - CaptureVariable

These variables are able to report descriptive statistics among other things. on the variables containing numbers, and allow the selection of subsets. Here is an example DataHandlingDemo1 of a program that uses the various classes in this library for the basic task of acquiring data from hard-disk based files, followed by some descriptive statistics. in many cases sets of variables should be treated as a group - for example when we selected cases across a range of variables, based on certain values in one of the variables. This is illustrated in a more elaborate DataHandlingDemo2 program in which the different tasks are broken into separate subroutines. DataHandlingDemo3 shows how to obtain and graphically display the content of variables as a (read-only) spreadsheet.

Analyzer objects are used to perform the actual analyses, e.g., an analysis of independence on a cross-tabulation frequency table with a ContingencyAnalyzer. A HierarchyAnalyzer comes with a variety of techniques for exploring interaction and dominance tables. ContingencyAnalysisDemo illustrates how to perform a simple analysis of a crosstabulation frequency table that has been created from information about which individual had initiated and which had received an attack. TransitionAnalysisDemo shows how to a sequence analysis. A spatial analysis is illustrated with the PlotAnimal demo. A demo for an initial multivariate analysis is shown at ParametricAnalysisDemo.

Central are a set of classes which implement 2-dimensional contingency tables.

                 - InteractionTable
                 |
ContingencyTable -
                 |
                 - DominanceTable

Permission is hereby granted, without written agreement and without license or royalty fees, to download, use, copy, and distribute this library for non-commercial applications. The actual Java Source code for these sets of JavaGrinders classes can be purchased here.

External Motor and Sensor Control

Contol over motor interfaces allows the development of dynamic experimental setups, such as for automated, operant conditioning paradigms. JavaGrinders supports a variety of usb/serial devices, however, the easiest interfaces are based on building blocks for low cost sensing and control hardware from Phidgets Inc.

Why Java? and What do I need?

I found getting started with Java programming quite painless. Java syntax is similar to C, and its feel is reminiscent of Object Pascal. If you know rudimentary C and have an idea of what object oriented programming is about, you'll have no problem writing your first applet within a few hours. The entire source code is usually contained in a single text file without confusing header or library files. You compile it with the freeware Java Compiler and there is a wealth of wonderful tutorial files and online programming resources available to help you along. A few lines of HTML are enough to embed these applets in a page and they magically run within all common web browsers and applet viewers on all platforms.

To customize programs for your analyses you need to download amd install Java, a Java Compiler, Quicktime for Java, the JavaGrinders library, and to then develop some code that uses its functionality. Some are free and can be downloaded at http://java.sun.com/ for virtually all computing platforms. Please let me lobsterman.bgsu@gmail.com know if you have any problems running these applets/applications and if I can help you get started creating your own. A great place to start is also at Java Programming Resources.

Instructions for Mac OSX

Instructions for PC

Suggestion on how to cite:

XXX was performed using a collection of public domain Java Applets for the analysis of behavioral data (available on the Internet at http://caspar.bgsu.edu/~software/Java/).

You might also want to check some of the following links:

You can help expand and improve the content of this site by submitting links, bug-reports, source code, feature requests, articles, or general feedback directly to the Java Grinders Editor <lobsterman.bgsu@gmail.com>. Back to my personal homepage, or my professional homepage.


last updated 5/23/08