hubmapconsortium / codex-pipeline

CODEX data processing code
GNU General Public License v3.0
10 stars 4 forks source link

Replace implementation of run_background_subtraction.assign_fraction_of_bg_mix #37

Closed jswelling closed 1 year ago

jswelling commented 1 year ago

This PR replaces the logic in run_background_subtraction.py assign_fraction_of_bg_mix(). It is able to handle cases where the 'blank' cycles are not the first and last, and thus should avoid a current error. It changes the way the weights are calculated so that for example the cycles immediately after the first and immediately before the last background cycles do contain non-zero contributions from the other background cycle, but that seems a more correct interpretation of the time interpolation.

VasylVaskivskyi commented 1 year ago

I was following what Akoya has done for their background subtraction, and they decided that cycles just after first and just before last are used with 0 interpolation. https://help.codex.bio/codex/processor/technical-notes/background-subtraction