Code associated to the manuscript "Maximizing protein production by keeping cells at optimal secretory stress levels using real-time control approaches", by Sosa-Carrillo and colleagues, bioRxiv, 10.1101/2022.11.02.514931. The code can be used to analyze the raw data and generate figures for the manuscript. The raw data can be found on Zenodo at doi:10.5281/zenodo.7418639