Food conversions calculation

Food conversions are computed using a recursive search algorithm to link foods-as-eaten to foods-as-measured, possibly through intermediate conversion steps. For instance, if (unpeeled) apple and grapes are the foods-as-measured, the food-as-eaten apple pie contains peeled apple and raisins, peeled apple is linked to unpeeled apple, and raisins are dried grapes. Hence, for this apple pie, there are two conversions, one to apple and one to grapes, each with its own conversion path of intermediate conversion steps.

For each food-as-eaten, the food conversion algorithm recurstively builds up the conversion paths using the the following 7-step procedure:

  1. Check food-as-measured (step 1): Check whether the current food is considered a food-as-measured, i.e., it is a food for which substance concentration measurements are considered to be available. If successful, a food-as-measured has been found, and the current search stops.

  2. Find processing link (step 2): Check whether the current food can be considered to be a processed variant (e.g., cooked or peeled) of another food.

  1. Match processing factor (step 2a): try to find the code in the processing factors table.

  2. Processing link wildcard match (step 2b): try to find a wildcard match in the processing table. Wildcard match codes consist of an initial string (startcode, may be empty), an asterisk (*), and possibly a processing part (-processingtype). * may be any string endcode (not containing a -) such that code equals startcodeendcode or startcodeendcode-processingtype.

  1. If code contains a processing part (-processingtype), then the wildcard match code should also end with -processingtype. Convert to the code specified in the field foodunprocessed, where endcode is substituted for any * in the new code.

  2. If code contains no processing part, then the wildcard match code should also contain no processing part. Convert to the code specified in the field foodunprocessed, where endcode is substituted for any * in the new code.

If successful, try to find find food translation information in the food recipes data to correct for weight reduction or increase. Then, restart at step 1 with the new code of the unprocessed food.

  1. Food translation link (step 3): Check whether the current food translates to one or more other foods through composition or read-across.

  1. Food recipe link (step 3a): Try to find food translations for the current food (i.e., the ingredients of a composite food). This may result in one or more food codes for ingredients, and the iterative algorithm will proceed with each of the ingredient food codes in turn.

  2. TDS food sample composition link (step 3b): Try to find the code in the TDSFoodSampleCompositions table (column idFood), a default translation proportion of 100% is assumed. The iterative algorithm will proceed with a TDS food (column idTDSFood) sample.

  3. Read-across link (step 3c): Try to find a food extrapolation rule for the current food, a default translation proportion of 100% for ‘idToFood’ is assumed.

If successful, restart at step 1 with each of the new codes of the ingredient foods, TDS foods or Read Across foods.

  1. Subtype link (step 4): try to find subtype codes, e.g. ‘xxx$*’ in the MarketShares table. In general, marketshares should sum to 100%. Foods with marketshares not summing to 100% are ignored in the analysis unless the checkbox ‘Allow marketshares not summing to 100%’ is checked. This step is optional, see advanced settings if you want to use this. If successful, restart at step 1 with each of the new codes of the subtype foods.

  2. Supertype link (step 5): try to find supertypes, e.g. ‘xxx$yyy’ is converted to ‘xxx’. This step is optional, see advanced settings if you want to use this. If successful, restart at step 1 with the new code of the supertype food.

  3. Default processing factor (step 6): remove processing part (-xxx) of the code. If successful, restart at step 1 with the new code without processing part.

  4. Maximum residue limit (step 7): try to find the code in the MaximumResidueLimits table. If successful, the current search stops. If not successful, then stop anyway and the search is marked as failed food conversion.