Skip to content

Program flow

Giuseppe Tavella edited this page Jul 20, 2023 · 3 revisions

Logic and flow of the program.

  • Have blood test file in csv

  • Have default Reference scale in csv

  • Have Components map in csv

  • Define what are Metadata and Components

  • Define the final dataframe that you'll be working with

  • Define Reference scale

  • Define Components map

  • Have

Outcome: a standardized dataframe, with predictable column names, where you know what to expect regardless of input data.


  • Define a "safety margin" applied to the ends of the recommended range. Example: 10% safety margin means that if the blood value is 10% close or less to the recommended minimum, or 10% close or more than the recommended maximum, it is classified as "low" or "high"
  • Calculate percentages from the minimum value, i.e. my platelets are 8% lower than minimum (-8%), 34% higher than maximum (+134%).
  • In which quantile is blood value?
  • Do you need to scale all values? For example from scale 40-70 to 0-100
  • Create a scaled dataframe of the original values. This dataframe contains all the values, but scaled on a scale 0-100, for immediate interpretability. Or 0-1 scale?
  • Create a scaling algorithm that allows you to scale back and forth values from one scale to another
  • Do different associations worldwide use different scales? Can the scale differ on a country level?
  • Is it possible to gather all most known scales, calculate the average for each scale, and recompute values based on this new "average" scale?
  • Compute the correlation between all blood values with each other
  • Define how you define that there's a pattern, for example Pearson corr > |0.7|
  • Plot only the most relevant patterns? Or all combinations of blood values?
  • What factors need to be taken into consideration that affect the way you interpret values?
  • Can sex, age influence the way you interpret values? For example, based on factor X we can say that value Y is normal, but are there ways in which as factors change, the interpretion, the meaning of the values change? What is normal through a factor, might be anormal through different factor
  • To define normal, what is the tolerance level in which we consider that a blood is 'normal'?
  • Based on what, and by how much, do we assess that some value is normal or not?

create a class Blood this class exposes methods for validating data, analyzing blood, finding patterns, scaling values when I have a value, I can switch the class BloodComponent is a child of Blood you cannot make changes to blood values you have two dataframes: original and scaled you work with the scaled one. 0-1 scale. if you want the original dataframe you need to ask for it

class Blood: initialize by validating and formatting the dataset, expose any problem before any analysis what is necessary in order to do analysis? how should the data by validated, cleaned, formatted?

interpret these values with this reference scale (that is, the framework in which to frame that values are normal, low, high etc.)

every component has class BloodComponent: scale -> default scales to 0-1 scale_original -> scales from 0-1 to original scale

Clone this wiki locally