simularium / binding-sim-edu

Other
0 stars 0 forks source link

Rework equilibrium data #125

Open meganrm opened 1 week ago

meganrm commented 1 week ago

Problem

Estimated review size: large

What is the problem this work solves, including closes #61 there was a bug where we were using the starting concentration of B instead of the live concentration of B to calculate the Kd. So reworking that required changes to how we're storing the data

Solution

This data is a series of arrays that are all matched in indices. I did this instead of storing this data as an object that I then have to unpack as separate arrays for the plots. I do have to go over them once to make sure all the data has the correct index, but they also have to be sorted in order of the reactantConcentrations, so I'm saving one pass over the data by storing it way.

equilibriumData inputConcentrations reactantConcentrations (new array) productConcentrations timeToEquilibrium (new array, needed to store the dots on the product conc over time plot) colors (new array, it's created by the inputConcentrations, and then the index for other arrays is used to sync colors kd added because it was needed in more than one component

graphs:

Type of change

Please delete options that are not relevant.

Steps to Verify:

  1. A setup step / beginning state
  2. What to do next
  3. Any other instructions
  4. Expected behavior
  5. Suggestions for testing

Screenshots (optional):

Screenshot 2024-09-30 at 9 39 22 PM
meganrm commented 1 week ago

I'll try to schedule a code review with you two to go over this