Using Pergola with JAABA data

The Janelia Automatic Animal Behavior Annotator (JAABA)* is a machine learning-based system that enables researchers to automatically anotate animal behaviors. Pergola can import score files generated by JAABA in matlab format as show in this notebook:

*Kabra, M., Robie, A. A., Rivera-Alba, M., Branson, S., & Branson, K. (2013). JAABA: interactive machine learning for automatic annotation of animal behavior. Nat Meth, 10(1), 64–67. doi:10.1038/nmeth.2281

Path to matlab file containing scores of Drosophila chasing behavior generated using JAABA (sample_data folder):

Data can be easily export to a csv file. Note that we can normalize the scores using “norm” flag so they move within a range of -1 to 1.

We can also load the data into an IntData object. For this we can use the file we have generated above but the function jaaba_scores_to_intData performs the process without this intermediate steps. We need to set the equivalences between the jaaba scores fields and the pergola ontology using a file that contains the mappings. This function also allows for the normalization of the scores using “norm” flag and for the annotation of the behavior using data_type parameter.

WARNING: File format not recognized, default format assumed to be csv

IntData objects

IntData, contains all the intervals of a file and some interesting related attributes like the dataTypes it contains, min and max values, the tracks (in this case individuals) and the data itself:

set(['chase'])
3376
27330
set(['11', '10', '13', '12', '15', '14', '17', '16', '19', '18', '1', '3', '2', '5', '4', '7', '6', '9', '8'])
[('1', 3486, 3486, '-0.0625935142616', 'chase'), ('1', 4427, 4438, '0.0894133992959', 'chase'), ('1', 8032, 8032, '-0.0741294976008', 'chase'), ('1', 8397, 8397, '-0.0224614989493', 'chase'), ('1', 8399, 8402, '-0.0260602853835', 'chase'), ('1', 8755, 8755, '-0.069399336129', 'chase'), ('1', 8759, 8760, '-0.036959462996', 'chase'), ('1', 10409, 10409, '-0.110257591161', 'chase'), ('1', 11434, 11436, '0.0418167820454', 'chase'), ('1', 11439, 11439, '-0.0318922057499', 'chase')]

Basic data outputs for visualization or analysis

IntData to bed

Data can be transformed to bed files. Bed files contain just the raw intervals and values without any further manipulation of the data:

Fields containing time points will be multiplied by:  1
Relative coordinates set to: True
Removed data types are:
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_2_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_14_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_6_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_1_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_8_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_13_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_5_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_17_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_19_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_12_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_4_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_16_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_11_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_18_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_3_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_15_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_7_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_9_dt_chase.bed generated
Files dump into path:  /Users/jespinosa/git/pergola/test
File tr_10_dt_chase.bed generated