kymata-atlas / kymata-core

Core Kymata codebase, including statistical analysis and plotting tools
https://kymata.org
MIT License
5 stars 0 forks source link

Make denoising an operation on `ExpressionSet`s #404

Open caiw opened 2 weeks ago

caiw commented 2 weeks ago

Currently the IPPM code uses IPPMSpikes and SpikeDicts, but @neukym and I reckon it would be doable to have denoising be a generic operation on ExpressionSets (see also #402, #403)

caiw commented 2 hours ago

Discussed with @neukym just now and we decided the following:

HexelExpressionSets naturally have two hemispheres. So when denoising and generating IPPMs, there are two options:

  1. Denoise separately on each hemisphere — and separately generate IPPMs from each hemisphere.
  2. Combine both hemispheres into a single pool of hexels and denoise that.

This issue says that (1) is the correct way to do this. Explaining why through the motivating example of bilateral TVL feeding into left-lateralised language, we would have a "left hemi" TVL IPPM and a "right hemi" TVL IPPM which look similar. Then we have a left-hemi language IPPM and a (possibly empty) right-hemi language IPPM. What we want is the left- and right-hemi TVL IPPMs separate (because it is a bilateral effect), and then both feeding into the left-hemi language IPPM (as this is a lateralised effect). But this is an operation on the level of the graph, not on the level of the denoising. So if we denoise separately, we can keep the left- and right-lateralised TVL IPPMs, and then do a graph operation to make the output of the RH TVL IPPM feed into the input of the LH langauge IPPM.

This means that denoising is kept at the level of the ExpressionSet: in source space it operates on the hemispheres independently. This also means that the functions will be in a good place to incorporate cortical location into a future spatial denoising operation, whereas if the hemis were pooled this could be harder.