Run 3: Predict YFP synthesis rate of initiation mutants based on fit of stall strengths to single mutant data (for Fig 4, Fig. 4 supplement 1A–G)


In [4]:
%%writefile simulation_run_3.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run3/'))
mrnafiles = ['../annotations/simulations/run3/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run3_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run3_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run3_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',            
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',               
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run3/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Overwriting simulation_run_3.py

In [5]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(40):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_3.py',
        str(index)
    ])

Run 4: Predict YFP synthesis rate of CTC, CTT double mutants based on fit of stall strengths to single mutant data (for Fig. 5 figure supplement 1A, 1B)


In [6]:
%%writefile simulation_run_4.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run4/'))
mrnafiles = ['../annotations/simulations/run4/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run4_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run4_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run4_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',            
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run4/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Writing simulation_run_4.py

In [7]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(30):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_4.py',
        str(index)
    ])

Run 5: Predict YFP synthesis rate of CTC distance mutants based on fit of stall strengths to single mutant data (for Fig. 6 figure supplement 1)


In [9]:
%%writefile simulation_run_5.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run5/'))
mrnafiles = ['../annotations/simulations/run5/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run5_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run5_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run5_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run5/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Overwriting simulation_run_5.py

In [10]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(20):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_5.py',
        str(index)
    ])

Run 14: Predict YFP synthesis rate of serine initiation mutants based on fit of stall strengths to single mutant data (for Fig. 4 supplement 1H)


In [11]:
%%writefile simulation_run_14.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run14/'))
mrnafiles = ['../annotations/simulations/run14/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run14_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run14_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run14_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',            
                '--trna-concn', '../annotations/simulations/serine.starvation.average.trna.concentrations.tsv',               
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run14/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Writing simulation_run_14.py

In [12]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(15):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_14.py',
        str(index)
    ])

Run 15: Predict YFP synthesis rate of serine double mutants based on fit of stall strengths to single mutant data (for Fig. 5 figure supplement 1C)


In [14]:
%%writefile simulation_run_15.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])

currentindex = -1


mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run15/'))
mrnafiles = ['../annotations/simulations/run15/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run15_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run15_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run15_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/serine.starvation.average.trna.concentrations.tsv',            
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run15/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Overwriting simulation_run_15.py

In [15]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(15):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_15.py',
        str(index)
    ])

Run 16: Predict YFP synthesis rate of CTA multiple mutants based on fit of stall strengths to single mutant data (for Fig. 5)


In [16]:
%%writefile simulation_run_16.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run16/'))
mrnafiles = ['../annotations/simulations/run16/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run16_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run16_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run16_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',            
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run16/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Writing simulation_run_16.py

In [17]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(18):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_16.py',
        str(index)
    ])

Run 6: Vary initiation rate systematically for 3 different models (for Fig. 3A)


In [18]:
%%writefile simulation_run_6.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run6/'))
mrnafiles = ['../annotations/simulations/run6/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/runs678_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/runs678_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/runs678_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run6/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Writing simulation_run_6.py

In [19]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(8):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '10', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_6.py',
        str(index)
    ])

Run 7: Vary number of stall sites systematically for 3 different models (for Fig. 3B)


In [20]:
%%writefile simulation_run_7.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run7/'))
mrnafiles = ['../annotations/simulations/run7/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/runs678_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/runs678_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/runs678_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run7/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Writing simulation_run_7.py

In [21]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(9):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_7.py',
        str(index)
    ])

Run 8: Vary distance between stall sites systematically for 3 different models (for Fig. 3C)


In [23]:
%%writefile simulation_run_8.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run8/'))
mrnafiles = ['../annotations/simulations/run8/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/runs678_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/runs678_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/runs678_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run8/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Overwriting simulation_run_8.py

In [24]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(238):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '10', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_8.py',
        str(index)
    ])

Run 9 : Vary abortive termination rate systematically for 3 different models (for Fig. 7)


In [26]:
%%writefile simulation_run_9.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys
import numpy as np

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = ['../annotations/simulations/run4/yfp_cta18_initiationrate_0.3.csv']

# use experimental fits for stall strengths from run 4
terminationandStallStrengths = [
    ('--5prime-preterm-rate','../processeddata/simulations/run4_stallstrengthfits_5primepreterm.tsv'),
    ('--background-preterm-rate','../processeddata/simulations/run4_stallstrengthfits_selpreterm.tsv'),
    ('--selective-preterm-rate','../processeddata/simulations/run4_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    for typeOfTermination, stallstrengthfile in terminationandStallStrengths:
        for terminationRate in [0] + list(10.0**np.arange(-2,1.01,0.05)):
            currentindex += 1
            if currentindex != jobindex:
                continue
            cmd = ' '.join([
                    './reporter_simulation',
                    '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',
                    typeOfTermination, 
                        '%0.4g'%terminationRate,
                    '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run9/',
                    '--stall-strength-file', stallstrengthfile,
                    '--input-genes', mrnafile
                    ])
            sp.check_output(cmd, shell=True)


Overwriting simulation_run_9.py

In [1]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(200):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '20', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_9.py',
        str(index)
    ])

Run 11: Predict YFP synthesis rate of CTA distance mutants based on fit of stall strengths to single mutant data (for Fig. 6)


In [31]:
%%writefile simulation_run_11.py
#!/usr/bin/env python
#SBATCH --mem=8000

import subprocess as sp
import os
import sys

jobindex = int(sys.argv[1])
currentindex = -1

mrnafiles = list(filter(lambda x: x.startswith('yfp'), os.listdir('../annotations/simulations/run11/')))
mrnafiles = ['../annotations/simulations/run11/' + File for File in mrnafiles]

terminationandStallStrengths = [
    ('--5prime-preterm-rate',0,'../processeddata/simulations/run11_stallstrengthfits_trafficjam.tsv'),
    ('--5prime-preterm-rate',1,'../processeddata/simulations/run11_stallstrengthfits_5primepreterm.tsv'),
    ('--selective-preterm-rate',1,'../processeddata/simulations/run11_stallstrengthfits_selpreterm.tsv'),
        ]

for mrnafile in mrnafiles:
    currentindex += 1
    if currentindex != jobindex:
        continue
    for typeOfTermination, terminationRate, stallstrengthfile in terminationandStallStrengths:
        cmd = ' '.join([
                './reporter_simulation',
                '--trna-concn', '../annotations/simulations/leucine.starvation.average.trna.concentrations.tsv',            
                typeOfTermination, 
                    '%0.2g'%terminationRate,
                '--threshold-accommodation-rate', '22',
                '--output-prefix','../rawdata/simulations/run11/',
                '--stall-strength-file', stallstrengthfile,
                '--input-genes', mrnafile
                ])
        sp.check_output(cmd, shell=True)


Overwriting simulation_run_11.py

In [32]:
import subprocess as sp
# loop submits each simulation to a different node of the cluster
for index in range(20):
    sp.check_output([
        'sbatch', # for SLURM cluster; this line can be commented out if running locally
        '-t', '30', # for SLURM cluster; this line can be commented out if running locally
        '-n', '1', # for SLURM cluster; this line can be commented out if running locally
        'simulation_run_11.py',
        str(index)
    ])