Function Repository Resource:

AminoAcidsBarChart

Source Notebook

Create a custom bar chart of amino acid content for a list of foods

Contributed by: Gay Wilson and Jeff Bryant

ResourceFunction["AminoAcidsBarChart"][foods]

returns customizable amino acid information for a list of foods as a 2D or 3D bar chart.

Details and Options

Broad food descriptions (e.g., "chicken", "grilled chicken" or "chicken thighs") will be more successful in retrieving data on amino acids than very specific food descriptions ("skinless, boneless grilled chicken thighs").
By default, a Manipulate is returned that allows the user to select which amino acid content is displayed.
Each bar represents the amount in grams of the selected amino acid relative to 1 gram of that food (g/g).
ResourceFunction["AminoAcidsBarChart"] takes the same options as BarChart or BarChart3D, with the following changes:
ChartLabelsAutomaticfood names
ImageSize600overall image size expressed in points
ImageMarginsAutomaticabsolute margins around image
BackgroundAutomaticbackground color for chart

Examples

Basic Examples (1) 

Compare the amounts of amino acids in these high-protein foods. Choose from 20 amino acids in the dropdown list:

In[1]:=
ResourceFunction[
 "AminoAcidsBarChart"][{"beef", "chicken", "eggs", "pork", "tempeh"}]
Out[1]=

Options (2) 

Use options to customize the appearance of the chart:

In[2]:=
ResourceFunction[
 "AminoAcidsBarChart"][{"beef", "chicken", "eggs", "pork", "tempeh"}, ChartStyle -> "RedBlueTones", BarSpacing -> None, Background -> LightBlue, ImageMargins -> 10, PlotLabel -> "Amino Acids in High-Protein Foods"]
Out[2]=

Select the BarChart3D chart type for a different perspective when comparing these nuts and seeds:

In[3]:=
ResourceFunction[
 "AminoAcidsBarChart"][{"hazelnut", "peanut", "pecan", "macadamia", "chia seed", "sesame seed"}, ChartStyle -> 73, ChartLabels -> Placed[{"hazelnut", "peanut", "pecan", "macadamia", "chia seed", "sesame seed"}, Below, Rotate[#, Pi/2] &]]
Out[3]=

Neat Examples (2) 

Select All in the dropdown list for an interactive 3D chart of the amino acids in these deli meats:

In[4]:=
ResourceFunction[
 "AminoAcidsBarChart"][{"ham", "turkey", "bologna", "salami", "pastrami"}]
Out[4]=

Deselect foods to examine a smaller set of data, then reselect those foods to restore their data to the chart. Rotate the chart for different views:

In[5]:=
ResourceFunction[
 "AminoAcidsBarChart"][{"ham", "turkey", "bologna", "salami", "pastrami"}]
Out[5]=

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.1.0 – 15 May 2024
  • 1.0.0 – 22 March 2024

Related Resources

License Information