sibernetic icon indicating copy to clipboard operation
sibernetic copied to clipboard

Steps towards integration of touch sensation

Open pgleeson opened this issue 6 years ago • 6 comments

  • [x] Incorporate recording of pressure in worm body
  • [ ] (Sibernetic) Transform this information to signal for 10 sections of body (head, 8 in midbody (2 on each of: left/dorsal; left/ventral; right/dorsal; right/ventral), tail) to signal when pressure of any point in there has passed a threshold signalling a 'touch' on that section. This information is saved to a separate file (sectiontouch.txt).
  • [ ] Create configuration with static obstacle (3d block) in front of worm which will cause spike in pressure in location on head when worm bumps into it after a short period of time (e.g. based on this config)
  • [ ] Make python class to manage interface between sibernetic generated info and inputs for specific neurons, e.g. SensoryManager.py (also relevant for https://github.com/openworm/sibernetic/issues/141). This will run in real time when sibernetic is executed.
  • [ ] Allow this class to save traces for individual inputs to give to cells (e.g. ADAL.dat) & generate plot of this at end of sibernetic_c302.py run.
  • [ ] Work out how to feed output of this into c302 generated Neuron simulation in real time so neurons change behaviour based on environmental input (also related to https://github.com/openworm/sibernetic/issues/141)...

pgleeson avatar May 08 '18 10:05 pgleeson

Hi @a-palyanov @skhayrulin -- now that the special issue is out; can we take a look at moving this forward? What do you guys think?

slarson avatar Sep 14 '18 15:09 slarson

I'm not a specialist in Python, but I can do the tasks which require modification of Sibernetic.

By the way, here is a paper "Determining the biomechanics of touch sensation in C. elegans" (2017), which might be useful in the context of this issue: https://www.researchgate.net/publication/320043028_Determining_the_biomechanics_of_touch_sensation_in_C_elegans

a-palyanov avatar Sep 16 '18 01:09 a-palyanov

There is some progress on https://github.com/lungd/sibernetic/tree/touch_sensation I unintentionally used the dev branch of my repo as base, instead of the dev branch of Sibernetic. Have a look at https://github.com/lungd/sibernetic/compare/development...lungd:touch_sensation?expand=1, for commits related to touch sensation only.

Every time data gets written to the pressure file, there is a check whether the pressure to a particle, belonging to the body of the worm, has passed a HARDCODED threshold, set to 1.

Every particle of the worm is 'mapped' to the same HARDCODED section, set to the soma of AVM, which will receive input at the end. If the pressure to one of the particles has passed the threshold, Sibernetic calls a method for creating an input to the given section, unless an input has already been created due to another particle.

At the end, there is a method 'addStimulus' which creates a new input to an existing section with HARDCODED amplitude, set to 0.2.

loadPressureToFile():
    for p in shell_particles:
        if p.pressure > threshold 
            if not received:
                simulation.receivePressure(p.id, p.type, p.pressure)
                received = True

simulation.receivePressure(id, type, pressure):
    -> ... -> LEMS_FILE.addStimulus('a_AVM', p.pressure)

LEMS_FILE.addStimulus(self, sectionName, pressure):
    section = loadSection(sectionName)
    i = h.IClamp(section)
    i.delay = current_time
    i.dur = self.dt
    i.amp = 0.2

TODOs and thoughts:

  • Fix list of particles (shell_particles): ATM, the list of particles consists of all particles belonging to the body of the worm. It should contain particles located on the surface of the worm only (https://github.com/openworm/sibernetic/issues/160).

  • Create a mapping from particle_ids to a section_names: We want to divide the body of the worm into different sections (head, tail, ...). To know which section the particle belongs to, we need to define a mapping from a particle-id to the name of the section. The positions of the particles are defined inside the config file as well as the type of the particle. I can imagine to add something to the type, to know which section it belongs to.

  • Create a mapping from section_names to lists of (sensory) neurons: We also need to define a mapping from the section to a list of 'connected' neurons, to know which neurons should receive input. Could be a hardcoded dict first. ("head": ["AVM", ...], "tail": ["PLML", "PLMR", ...])

  • Set proper threshold

  • Translate pressure into current (amplitude): ATM, the amplitude of the input is defined in ampere. I am not sure how to translate pressure into current. We probably need to implement and fit a proper model for sensory neurons first. And we need to know the max possible pressure. Depending on the neuronal model, we maybe need to create a new input class with pascal (or m - displacement) as unit - don't know if that is possible.

Any feedback is welcome!

lungd avatar Feb 01 '19 18:02 lungd

I applied some more changes:

Because the worm is straightened at the beginning of the simulation, I divided the worm into segments, based on the worm's length/width/height. I defined 5 sections: 3 body sections (each divided into 4 parts) + head + tail. The generated section file after running master_openworm.py: sectiontouch.txt

I removed the invocations for creating input to AVM for now.

Next, I will create a hardcoded map (sectionName -> neuronList)

If anyone is interested (@slarson), I created a container including my forks (c302, sibernetic; 'touch_sensation' branch) https://github.com/lungd/OpenWorm/tree/touch_sensation. I didn't create a PR for Sibernetic, because after creating new input for neurons, I will change c302_FW.py for testing purposes.

lungd avatar Feb 07 '19 18:02 lungd

Is pressure alone sufficient for detecting touch? I think we need to check surrounding particles as well, otherwise, we cannot distinguish between pressure coming from the environment, and pressure coming from a body bend? What do you guys think (@skhayrulin @a-palyanov @pgleeson)?

lungd avatar Feb 08 '19 12:02 lungd

What's the status of this?

ido4848 avatar May 18 '21 21:05 ido4848