# Aggression in Drosophila melanogaster
Budhaditya Chowdhury

## Experimental Protocol:

### Materials:

- 2% Agarose
  - *This should be prepared by mixing agarose with water and microwaved
    till fully dissolved.*
- Clear Corn Syrup
  - *Bought from grocery stores*
- Sugar
- Nipagin / Tegosept
  - *Stock solution made by dissolving 20 grams of tegosept in 100 ml in
    95% Ethanol*
- Adult flies (1 day old)
  - *All bottles containing fly genotypes of interest should be kept in
    an environmentally stable 12hr light/12hr dark conditions. For best
    results parental flies should not be housed in a crowded condition
    and transferred to new bottles every 3-5 days. (For best results
    parental crosses should be set up with 20 virgin females and 20
    young males).*
- CO2 or ice for anesthesia
- Standard fly food (see appendix)

### Equipment:

- 3d printed fighting chamber
  - *For best results the chambers should be printed with ABS material
    at 100-micron thickness.*
- Dividers
  - *For best results X-ray films should be cut with Silhouette printer
    for accuracy of dimensions.*
- Top glass cover
  - Standard large glass slides, or two regular glass slides placed side
    by side should be used.
- Base plate for food
  - *Inverted 10 ml clear pipette tip covers can be used as a base plate
    for food.*
- Computer & Camera setup:
  - Computer for video acquisition and data analysis: *We use a standard
    Windows PC (Windows 10, 16 GB RAM, 2.6 ghz 4 core processor)*
  - Video acquisition camera body: acA1920-155um - Basler Ace
  - Video acquisition camera lens: Edmund Industrial Optics 86572 (25mm
    focal length)
  - 1/4-20” Camera Mounting Plate for Ace Series (Basler 2000029679)
  - USB 3.0 cable ([Basler
    2000033239](https://www.digikey.com/short/29vrbv2z))
    - Camera stand (Kaiser Repro Kid Copy Stand Kit (Consists of 23.25”
      Calibrated Column, 15 x 12.5” Baseboard)
    - LED board for bottom illumination.

### Assembling the Fighting Chamber on food

- Making the food
  - To make food for one divider assay chamber (12 pairs of concurrent
    fights) the following ingredients and recipe is recommended.
    - Clear corn syrup: 7 ml
      - Sugar: 4 g
      - Agarose: 2 g
      - water: 220 ml
    - Mix all the ingredients in a microwave safe flask and microwave
      till the food solution runs clear.
    - Let the hot food rest on bench till the temperature falls below 65
      C (typically 30 mins or so in room temperature)
    - Add 2 ml Nipagin/Tegosept
    - Pour in food boxes and let it solidify before assembling fighting
      chamber on top of it (recommended wait time ~2 hours)
- Assembling divider assay chambers on top of food *(Consult
  Supplementary movie to see the assembly of chamber)*
  - Place three dividers through the slits between the chambers while
    holding the chamber upside down, supported by the inverted glass
    cover.
  - Gently move the inverted and assembled fighting chamber up towards
    the solidified food and once the chamber comes in contact with food
    surface invert the entire assembly to have a right side up fighting
    chamber resting on food.

### Loading 1-day old flies on Fighting Chamber

Newly eclosed flies (less than a day old) should be anesthetized on CO2
or ice. Two male flies should be gently placed in a single fighting
arena on two sides of the divider. Once 12 pairs have been loaded the
top glass cover should be placed on top and secured with a thin strip of
clear tape (while not obstructing view of fighting arenas)

### Video acquisition of behavioral experiments

- The divider assay chamber with isolated future fighting pairs should
  be housed in a temperature and humidity-controlled environment with a
  12hr light/12 hr dark cycle.
- Once the flies have reached appropriate age to carry out experiments
  (5 days) the chamber assembly should be placed under the camera view
  and on top of LED lightsource for acquisition of high contrast
  aggression movies.
- The dividers should be gently removed by pulling them out in a linear
  motion while not disrupting the isolated flies.
- The Basler video acquisition software should be run to acquire movie
  file of the 12 well chamber for the duration of assay (we recommend
  recording at 20 Hz, and for assay duration of 20 minutes).

### How to Design behavioral Classifiers

1.  The first step in designing a classifier is ascertaining if the
    behavior is discrete (Lunging), or continuous (boxing). The output
    of automated action-classifying algorithms (like JAABA) should
    return results that match conventional behavioral scoring (manual
    quantification).
    - **Critical Step** Discrete behavior classifiers can start off by
      labeling multiple frames, but rigorous subsequent training should
      be done till classified frames are a match with manual scoring.
      For classifiers that labels 5 or more frames when only one should
      be picked, it might be prudent to start over.
2.  The framerate of the movie that records behavior should be decided a
    priori. It will also depend on behaviors of interest, contrast and
    resolution of camera, and how many pixels constitute a single animal
    of interest. For Lunging, a high-resolution movie should be at least
    20 fps, and a regular handheld camera 25 and above. For regular
    cameras we recommend the chambers are bottom lit to increase
    contrast.
    - **Critical Step** Once a classifier is fully trained, there is
      some leeway with differing frame rates, but every time a movie in
      a new recording setup is classified, manual scoring and classified
      movie should be matched for accuracy, before engaging in large
      scale annotation. Generally, a properly trained classifier
      requires only minor tweaks and re-training in a new setup.
3.  The first step in any automated annotation is picking a tracking
    algorithm that tracks flies and generates perframe features that can
    be imported into JAABA. Proper tracking depends on the contrast of
    animals on a well-lit background and a movie that is devoid of any
    camera shakes. A Proper tracker also should make little
    mis-categorization of fly Identities. We recommend FlyTracker 1.05.
4.  When training behavioral classifiers for discrete behaviors, the
    sequence of actions that constitutes a behavior should be kept in
    mind and the most salient feature should be trained. For instance,
    aggression constitutes a series of steps that culminate in the
    hallmark action of a Lunge (orientation, head-on or perpendicular
    alignment, rearing up on hind legs, and snapping down with front
    legs). In our movies, the rearing up, as well as the snap
    constitutes a single frame – both of which are amenable for training
    a lunge classifier (one frame – one count). However, the rearing up
    can also be seen when a fly moves from the floor to the side. This
    left the snap as the action pattern of choice and the lunge
    classifier is trained to identify this single frame snap.
    - **Critical Step** When using the lunge classifier with regular
      handycam acquired movies, a slowed down version should be first
      checked where the snap doesn’t lose pixel integrity. If a freeze
      frame of a lunge looks like the fly pixels has broken into
      multiple component pieces, the single frame pre-lunge rearing up
      should be classified. By changing the chamber design where the
      arena edges are at an angle (like the flyBowl Assay for instance),
      misclassifications of crawling up on the side can be reduced.
5.  We recommend using at least 300+ instances of lunging frames to
    train a classifier, along with negative frames. 300 single lunges
    will for instance give 200 instances of hits, at least 500 -1000
    instances of no-lunge frames should be included in the training. In
    our experience a single lunge-frame bookended by multiple frames of
    no-lunge classifications returns the fastest results.
6.  Ground-truthing helps increase the efficiency of classifiers. But in
    our opinion a meticulous step of quantifying multiple aggression
    movies manually, and then comparing them with results returned by
    automated annotation should be performed. This solves multiple
    problems:
    1.  If the classifier is labeling multiple frames as a single lunge,
        the average difference between manual scoring, and classified
        movie will be readily apparent (if two frames are being labeled
        as a lunge, the automated classification will return double the
        number of lunges as manually scored!)
    2.  A subsequent frame by frame analysis will clear up which
        behaviors are getting mislabeled, making it easier to train them
        out.
    3.  Setting post processing filters will help retain correct IDs
        while removing unwanted ones, making the total count get as
        close to the gold standard of manual scoring as one wants.
