All supplemental code and data from Dunphy et al DOI:https://doi.org/10.1016/j.cels.2018.12.002 biorxiv version applies to commit 8d1eb3e0f8786552ee8ffd3517922d470db3c5a5 and earlier
S1A Code - R code and data to regenerate paper figures and calculate growth dynamics
S1B Code - MATLAB code to perform gene essentiality predictions
README Information
S1A Code. R code and data to regenerate figures and calculate growth dynamics
Software information: R Version 3.4.0
Installation: o Download RStudio (open source license) from https://www.rstudio.com/products/rstudio/download/
o Create a new project in the S1A Code folder by opening RStudio, selecting File->New Project… -> New Directory -> Empty Project. Enter a directory name (can be anything you want), and choose S1A Code as the subdirectory. Make sure that the project is in the S1 Code folder and not in a subfolder.
Required R packages:
Once RStudio is running, the following packages need to be installed in order for the supplied script to be able to run:
o readr
o dplyr
o ggplot2
o ggthemes
o tidyr
o viridis
o gridExtra
o grid
o knitr
o reshape2
o gplots
o RColorBrewer
o ggsignif
o cowplot
o ggpubr
o gtable
o png
o vegan
o growthcurver
o scales
o ggdendro
o tiff
All available using install.packages(‘packageName’), or the first chunk of code in allFigures.Rmd can be uncommented the first time the file is run.
Scripts:
o allFigures.Rmd
o biologDataPM1.csv – All growth data on Phenotypic Microarray Plate PM1
o biologDataPM2.csv – All growth data on Phenotypic Microarray Plate PM2a
o headersPM1.csv – Carbon source labels from plate PM1
o headersPM2.csv – Carbon source labels from plate PM2a
o biologGrowthDynamics.csv – All calculated growth dynamics
o carbonSourceDescriptors.csv – Pathway descriptions for carbon sources in Figure 3
o growthDataNAG.csv (1 through 4) – Growth data from Figures 4A, 4B, S4A, S4B
o NAG_mutants_key.csv – Key between mutant labels in Figure 4B data and gene locus tags
o mutationsPIP.csv – Mutated genes in the piperacillin-evolved lineage
o geneEssentialityPredictions.csv – Predicted essential genes by carbon source
o PipDeletionsAllLineages.csv – All other genes in PIP-evolved lineages not in the large deletion of PIP-R1. Used in Figure S5B-C
o growthDataLeucine.csv – Growth data of ancestor, PIP, and gnyA on 40mM L-Leucine (all 4 biological replicates)
o growthData4HBA_1.csv – Half of the growth data on 4HBA
o growthData4HBA_2.csv – The other half of the growth data on 4HBA
o growthDataHocquet_1.csv – Half of the growth data of the Hocquet isolates grown on L-leucine
o growthDataHocquet_2.csv – The other half of the Hocquet growth data
o growthDataIsoleucine_gnyA.csv – Growth data from S6 Fig.
o Figures and Data folder – Empty folder where figures/data generated by the script will be saved
o PCR_images folder – Folder containing labeled gels verifying transposon insertions
Instructions:
o Prior to this point, RStudio must be installed with the appropriate packages and a new project must be created in the S1A Code folder.
o Open the project in the S1A Code folder.
o Open the script allFigures.Rmd in the project (File -> Open File…).
o Run the script by clicking Knit->Knit to HTML in the upper left-hand corner of the window.
o This will generate the following:
• An HTML file containing all of the figures and figure captions • Figures 2-6 from the main manuscript as .pdf files • Figures S1-S6 and S8 as .tiff files • Data S1-S4 as .csv files Figures can easily be changed to different file formats (e.g. jpg, png, etc.) or saved to different locations by changing adjusting the filenames and paths within ggsave functions. A call to ggsave can be found at the bottom of the code for each figure.
S1B Code. MATLAB code to perform gene essentiality predictions.
Software information: MATLAB R2016b, Gurobi 6.5.2
Required Toolboxes and Software: In order to implement the included code, you will first need to download the following:
o Gurobi Optimizer – Can be downloaded from: http://www.gurobi.com after acquiring a license. Licenses are free for academic use.
o Cobra Toolbox – Can be downloaded from: https://github.com/opencobra/cobratoolbox/
o Check that your solver and toolbox are installed correctly with the following commands:
• initCobraToolbox (this command initializes the toolbox)
• changeCobraSolver(‘solvername’) (where solver name is ‘gurobi5’ or ‘gurobi6’)
• testAll (note that not all tests will pass with the gurobi solver)
Scripts:
o S3_Code_Implementation.m – Main script to generate S4 Data
o changeMinimalMedia.m – Function to set the model to minimal media
o addExchangeReaction_JB.m – Function to add an exchange reaction
** Functions were not originally written by Dunphy et al. Author contributions are listed within the scripts.
Data files:
o model_PA.mat- This workspace contains the model iPau1129 (Bartell, Blazier et al., 2017). The model can also be downloaded from: http://bme.virginia.edu/csbl/Downloads1.html
Instructions:
o Open MATLAB and change your path to the S1C Code folder (or folder where you have the above scripts and data files stored).
o Add the Cobra Toolbox folder and subfolders to your path.
o If you are using a Windows machine, add the gurobi folder and subfolders to your path.
o Open S3_Code_Implementation.m and run it. This will take some time. The script will output a CSV file named geneEssentialityPredictions.csv, which is identical the file of the same name in S2 Code. The output is an unfiltered version of S4 Data.