Data analysis, figure, and modeling code for Kabaria et al "Programmable Promoter Editing for Precise Control of Transgene Expression"
Code in this repository requires data available as listed in the main manuscript.
- Create a virtual environment in the repository directory using python -m venv env
- Activate the virtual environment using source env/bin/activate (MacOS, Linux) or .\env\Scripts\activate (Windows)
- Install the current package versions for this project using pip install -r requirements.txt (Note if package mismatches - for Figure 6 ZF DIAL use requirements_bal.txt, for Figure 4/S19/S21 use requirements_mee.txt, and check the document requirementsold.txt for alternative package versions.) Alternatively, manually install packages as needed using the versions in the requirements.txt document. Most commonly used packages are in
functions.py
These notebooks were coded with Python 3.9.1.
- Download the raw and analyzed data from Zenodo Specifically, download the specified zip files and extract them into a new folder
attune_data. - Create a file in the root directory of the repo called
datadir.txtthat contains the absolute path to the data directoryattune_datayou just downloaded. This should be a single line.
- Select your
datadir.txtat the beginning of the notebook. For example thedatadir_srk.txtis selected indatadir = Path(Path('./datadir_srk.txt').read_text()) - Ensure each of the
file_pathandyaml_pathin each occurrence is modified to be a local reference to your data directory for the downloadedattune_datafolder. For example, ifdatadircontained the absolute path for the attune_data folder, the code for importing data would change from:
# Original
# Import Data1
# Import Data -BioRep1
folder = '20240121flow_exp20240118_p2'
file_path = datadir/'instruments'/'data'/'attune'/'Sneha'/folder/'export_singlets' #Assign file paths
yaml_path = datadir/'instruments'/'data'/'attune'/'Sneha'/folder/'well_metadata.yaml' #Assign yaml paths
data1 = rd.flow.load_csv_with_metadata(file_path, yaml_path) #Pull data
and become:
# Your File, with directory datadir for the Data folder
# Import Data1
# Import Data -BioRep1
folder = '20240121flow_exp20240118_p2'
file_path = datadir/'Sneha'/folder/'export_singlets' #Assign file paths
yaml_path = datadir/'Sneha'/folder/'well_metadata.yaml' #Assign yaml paths
data1 = rd.flow.load_csv_with_metadata(file_path, yaml_path) #Pull data
- The input
columnsin the functionrd.flow.load_csv_with_metadatamay be removed to return all single cell data parameters. The line#rd.plot.plot_well_metadata(yaml_path)can be removed as well (this line shows the plate layout.)
- Each file concatenates data across bioreplicates into dataframes labeled
data,df, etc. These dataframes can be exported with a function liketo_excel()to obtained a merged file containing single cell data with labels of conditions and bioreplicates. - Alternatively, the
.ipynbnotebooks specify the folders and.yamlplate maps for all data per experiment, and can be used directly with the single cell data exports available at Zenodo. - Summary statistic data exports are available in Zenodo.
- In most notebooks you can set the directory of exported plots. Edit lines such as
figure_folder = './figs_2024_promoter_editing_paper/f_diff-min-prom/'. Ensure that the directory specified exists. If you do not wish to save exported plots, comment out lines with thesavefig()function, such asg.figure.savefig(figure_folder + plottitle + '.svg',dpi=300,bbox_inches='tight').
MATLAB code is included in a folder MATLAB_modeling_plasmid_titration. The code enclosed was used for modeling. Relevant experimental data is included in datafiles. This data was exported from the experiments in Fig2_S8_S9A_ZF37plasmidtitration.ipynb and FigS8_ZF43plasmidtitration.ipynb. Shorted notebooks for data export are modeling_ZF37plasmidtitration.ipynb and modeling_ZF43plasmidtitration.ipynb. The version used was MATLAB 24.1 (2024a).