コード例 #1
0
    def get_protocol(self):
        p = stepwise.Protocol()

        ## Clean your bench
        p += stepwise.load('rnasezap')

        ## In vitro transcription
        rxn = self.reaction
        n = plural(rxn.num_reactions)
        f = self.footnotes.get('reaction', [])
        p += paragraph_list(
            f"Setup {n:# in vitro transcription reaction/s}{p.add_footnotes(*f)}:",
            rxn,
            unordered_list(*self.instructions),
        )

        f = self.footnotes.get('incubation', [])
        if self.short and affected_by_short(self.incubation_times_min):
            f += [
                f"Reaction time is different than usual because the template is short (<{self.template_length_threshold} bp)."
            ]
        p += f"Incubate at {self.incubation_temp_C}°C for {format_min(pick_by_short(self.incubation_times_min, self.short))}{p.add_footnotes(*f)}."

        ## DNase treatment
        if self.dnase:
            f = self.footnotes.get('dnase', [])
            p += paragraph_list(
                f"Setup {n:# DNase reaction/s}{p.add_footnotes(*f)}:",
                self.dnase_reaction,
            )
            p += f"Incubate at {self.dnase_incubation_temp_C}°C for {format_min(self.dnase_incubation_time_min)}."

        return p
コード例 #2
0
ファイル: make_mrna.py プロジェクト: kalekundert/bind_dna
    def get_protocol(self):
        anneal = AnnealMrnaLinker(self.mrnas, self.linkers)
        anneal.num_reactions = self.num_reactions
        anneal.linker_ratio = 0.6  # See expt #1

        # Scale the reactions such that we'll end up with enough mRNA:
        anneal_rxn = anneal.reaction

        mrna_pmol = (
                self.expected_dead_volume_uL * self.target_conc_uM /
                self.expected_yield
        )
        mrna_conc_uM = anneal_rxn['mRNA'].stock_conc.value

        anneal.mrna_volume_uL = max(
                mrna_pmol / mrna_conc_uM,
                self.mrna_volume_uL,
        )

        ligate = LigateMrnaLinker(anneal)
        wash = WashBarendt()
        wash.mwco_kDa = self.mwco_kDa

        p = stepwise.Protocol()
        p += anneal.protocol
        p += ligate.protocol

        if self.label:
            p += f"Label the product: {self.label}"
        if self.wash:
            p += wash.protocol
        if self.aliquot:
            p += stepwise.load('aliquot "4 µL" "1 µM"')

        return p
コード例 #3
0
ファイル: gel.py プロジェクト: kalekundert/stepwise_mol_bio
    def get_protocol(self):
        p = stepwise.Protocol()

        if self.sample_mix:
            p += self.prep_step

        p += self.run_step

        if self.stain:
            p += stepwise.load(self.stain)

        return p
コード例 #4
0
ファイル: make.py プロジェクト: kalekundert/freezerbox
    def from_product(cls, product):
        maker = cls()
        args = product.maker_args

        maker.products = [product]

        if 'deps' in args:
            maker.dependencies = {x.strip() for x in args['deps'].split(',')}
        if 'seq' in args:
            maker._product_seqs = [args['seq']]
        if 'conc' in args:
            maker._product_concs = [Quantity.from_string(args['conc'])]
        if 'volume' in args:
            maker._product_volumes = [Quantity.from_string(args['volume'])]
        if 'molecule' in args:
            maker._product_molecules = [args['molecule']]

        if 'cwd' in args:
            cwd = expanduser(args['cwd'])
        elif 'expt' in args:
            import exmemo
            root = expanduser(args.get('project', getcwd()))
            work = exmemo.Workspace.from_path(root)
            expt = work.pick_experiment(args['expt'])
            cwd = expt.root_dir.resolve()
        else:
            cwd = getcwd()

        load_cmd = ' '.join(args.by_index[1:])
        if not load_cmd:
            raise QueryError("no stepwise command specified", culprit=product)

        with cd(cwd):
            maker.protocol = stepwise.load(load_cmd).protocol

        maker._protocol_str = maker.protocol.format_text()

        return maker
コード例 #5
0
    def get_protocol(self):
        p = stepwise.Protocol()

        footnotes = [x] if (x := self.protocol_link) else []
        footnotes += self.footnotes

        s = pl(f"Stain gel with {self.title}{p.add_footnotes(*footnotes)}:")

        if self.light_sensitive:
            #s += "Keep gel in the dark in all following steps."
            s += ul("Keep the stain protected from light.")
            #s += ul("In all following steps, protect the stain from light.")

        s += self._format_stage('prep')
        s += self._format_stage('stain')
        s += self._format_stage('destain')

        p += s

        if self.imaging_cmd:
            p += stepwise.load(self.imaging_cmd)

        return p
コード例 #6
0
#!/usr/bin/env python3

import stepwise

p = stepwise.Protocol()
p += "load"
p += stepwise.load("main")
p += stepwise.load("argv 1 2")
p += stepwise.load("import")

p.print()
コード例 #7
0
p = stepwise.Protocol()

# Deciding how much to load:
# - I want one lane to be almost maximally concentrated, just to make sure I
#   see something.
# - Normally I load 200 ng on urea gels, so I should have at least one lane
#   close to that.
# - [Filonov2015] claims to be able to detect 100 pg of RNA (Figure 2), so that
#   makes sense as a lower bound.
p += stepwise.load([
    'serial',
    '2 µL',
    f'{db[mrna].conc_ng_uL} ng/µL',
    0.1,
    8,
    '-m',
    'f97',
    '-d',
    'nuclease-free water',
])
p += stepwise.load([
    'gel',
    'urea',
    mrna,
    '-S',
])
p += stepwise.load('stain_dfhbi')

p.print()
コード例 #8
0
        o127     400 µM    1 µL  yes
        PBS          2x    2 µL  yes
""")
rxn.num_reactions = 4

p += f"""\
Setup 4 click reactions:

{rxn}
"""

p += """\
Incubate the reactions as follows:

- 25°C for 4h
- 25°C for 3h30, 65°C for 30 min
- 37°C for 4h
- 37°C for 3h30, 65°C for 30 min
"""

p += stepwise.load("gel anneal 6 -c 1990")

p.steps[2] = p.steps[2].replace(':', ' [1]:')
p.footnotes[1] = """\
The product (o129) has MW = 19899 g/mol, so:
100 µM = 1990 ng/µL
"""

print(p)

コード例 #9
0
#!/usr/bin/env python3

import stepwise
import po4

p = stepwise.Protocol()

p += """\
In the following steps, setup these reactions:

Buffer:      Mn  Mn  Mn  Mn  Mn  Mn  Mg  Mg  Mg  Mg  Mg  Mg  
dCas9:       +   −   +   −   +   +   +   −   +   −   +   +
DNA:         −   +   +   +   +   +   −   +   +   +   +   +
HUH-target:  −   −   −   +   +   +   −   −   −   +   +   +
EDTA:        −   −   −   −   −   +   −   −   −   −   −   +
"""

p += stepwise.load('huh/huh_cas9 f99 f100 -n 4 -S -b "Mn²⁺/Mg²⁺ buffer" -B 2.5')
p += stepwise.load('gel sdsmax 12 -S')
p += stepwise.load('gelgreen -r')
p += stepwise.load('simplyblue -fr')

print(p)


コード例 #10
0
def rnase_digestion():
    rxn = MasterMix("""\
            Reagent         Stock    Volume
            =============  ======  ========
            water                  to 10 µL  
            IVTT reaction            2.5 µL
            EDTA           500 mM   1.25 µL
            RNase A                  1.0 µL
    """)

    return f"""\
Setup an RNase A digestion:

{rxn}

- Incubate at 60°C for 30 min.
"""


p = Protocol()

p += load('nebex p27 -v 12 -d 75/5')
p += hydroxide_hydrolysis()
p += carbonate_hydrolysis()
p += rnase_digestion()
p += load('gel sdsmax −lysate,−p27,−treatment,NaOH,NaHCO₃,RnaseA -S')
p += load('laser blue')
p += load('gelgreen -r')

print(p)
コード例 #11
0
#!/usr/bin/env python3

import stepwise
from stepwise import pl, ul

p = stepwise.Protocol()

p += stepwise.load('cond optimize_click_freeze_cond.xlsx')

rxn = stepwise.MasterMix("""\
        Reagent   Stock  Volume  MM?
        =======  ======  ======  ===
        PBS          2x    2 µL   -
        o126     400 µM    1 µL   +
        o233     400 µM    1 µL   +
""")
rxn.num_reactions = 2
rxn.extra_percent = 0
rxn.hold_ratios.volume = '3 µL'

p += pl(
    f"Setup {rxn.num_reactions} click reactions:",
    rxn,
)
p += "Divide each reaction in three."

p += pl(
    "Incubate the reactions as follows:",
    ul(
        "−20°C overnight",
        "25°C for 4h, −20°C overnight",
コード例 #12
0
ファイル: test_controls.py プロジェクト: kalekundert/bind_dna
p += f"""\
Make NM plates with the following additives:

{stepwise.tabulate(additives, header)}
"""

p += """\
Grow fresh colonies of s4 and s5 to OD≈1 in 3 mL 
LB+Carb+Kan.
"""

p += """\
Wash cells with minimal media:

- Spin 3500g, 3 min, 4°C.
- Resuspend in 1 mL NM.
- Spin 3500g, 3 min, 4°C.
- Resuspend in 1 mL NM.
- Dilute to OD=0.1
"""

p += stepwise.load('serial 90µL 0.1OD 6 -f 10 -m cells -d NM')

p += """\
Plate 5 µL of each dilution in triplicate on each 
plate.
"""

print(p)
コード例 #13
0
#!/usr/bin/env python3

import stepwise
import wang2017

p = stepwise.Protocol()

p += """\
Prepare 100 U/mL RNase H:

- 44 µL nuclease-free water
- 5 µL 10x RNase H buffer
- 1 µL 5000 U/mL RNase H
"""

p += stepwise.load(
    'serial 12µL 100U/mL 0.1 7 -m "RNase H" -d "1x RNase H reaction buffer"')

p.footnotes[2] = """\
If I could use an Echo, I would add 25 nL of 100 µM 
o210/o211, to minimize the amount of volume added to 
the sample.  But I don't think I can accurately 
pipet less than 0.5 µL by hand.
"""

p += """\
Prepare 5 µM o210-o212:

- 1 µL 100 µM oligo
- 19 µL nuclease-free water
"""
コード例 #14
0
ファイル: emcs.py プロジェクト: kalekundert/bind_dna
p += f"""\
Couple EMCS to the amine in the annealing oligo:

{emcs}

- Incubate at 37°C for 30 min [3].
"""

p.footnotes[3] = """\
Do not allow the solution to react for over 30 
min because a longer reaction time causes 
hydrolysis of the maleimide group in EMCS.
"""

p += stepwise.load('ethanol_precipitation')

p += """\
Couple the puromycin and annealing oligos:

- Resuspend the precipitated annealing oligo (now 
  coupled to EMCS) in the eluted puromycin oligo.
- Incubate at 4°C overnight.
- Add 1/20 volume 1M DTT.
- Incubate at room termperature for 30 min.
- Vortex periodically.
"""

p += """\
Perfrom another ethanol precipitation.
コード例 #15
0
p += f"""\
Setup {plural(bal31.num_reactions):# BAL-31 digestion/s} [1]:

{bal31}

- Incubate at 30°C for 10 min.
- Add EGTA to 30 mM
- Incubate at 65°C for 10 min.
"""

p.footnotes[1] = """\
The NEB protocol calls for 3 pmol of DNA ends.  
This reaction has 1 pmol DNA, which is 2 pmol 
ends.  Maybe I should use less BAL-31 to 
compensate, but I think it's close enough.
"""

p.footnotes[2] = """\
This is the Cas9 reaction buffer recommended by 
NEB.  I might instead use whatever buffer Jorge 
has been using, or another similar buffer based on 
what I actually have.
"""

# 3x regular volume, for 3 technical replicates
# per reaction.
p += load(
    "pcr dCas9-PCV2-DNA o87 o88 7 -a 65 -x 10 -p ssoadv -v 66 -m primers")

print(p)
コード例 #16
0
ファイル: attach_huh.py プロジェクト: kalekundert/bind_dna
huh = stepwise.MasterMix.from_text("""\
Reagent    Stock    Volume  MM?
========  ======  ========  ===
water             to 10 µL  yes
CutSmart     10x      1 µL  yes
dCas9       1 µM      1 µL  yes
sgRNA       1 µM      1 µL  yes
EDTA      500 mM      1 µL
HUH-DNA   200 nM      5 µL
""")

if __name__ == '__main__':
    args = docopt.docopt(__doc__)
    p = stepwise.Protocol()

    p += stepwise.load('zap')

    p += """\
In the following steps, setup these reactions:

dCas9:          −  +  +  +  +
DNA (f12,f16):  +  −  +  +  +
HUH-target:     +  −  −  +  +
EDTA:           −  −  −  −  +
"""
    huh.num_reactions = 4
    huh.extra_min_volume = '0.5 µL'

    huh['water'].name = "nuclease-free water"
    huh['dCas9'].name = "dCas9-PCV2 [1]"
    huh['sgRNA'].name = "sgRNA (f13)"
コード例 #17
0
ファイル: test_staining.py プロジェクト: kalekundert/bind_dna
- Add 20 mL 5M NaCl.
- Shake gently for 5 min.

3: Stain with GelGreen:

- Submerge gel in 3x GelGreen, 100 mM NaCl.
- Shake gently for 30 min.

4,5: Stain with Coomassie

- Submerge gel in SimplyBlue SafeStain.
- Microwave until almost boiling (45-60s).
- Shake gently for 5 min.
- Discard stain and add 100 mL water.
- Shake gently for 10 min.
- Add 20 mL 5M NaCl.
- Shake gently for 5 min.
"""

p.footnotes[1] = Footnote("""\
Stain the washed and unwashed gel pieces 
separately, because it's possible that the excess 
SDS from the unwashed gels could interfere with 
staining.
""")

p += stepwise.load('laser blue red')

p.print()

コード例 #18
0
ファイル: huh_cas9.py プロジェクト: kalekundert/bind_dna
huh['EDTA'].hold_stock_conc.conc = 30 / 2.5 * float(
    args['--buffer-divalent-conc']), 'mM'
huh['DNA'].hold_conc.stock_conc = dna_nM, 'nM'
huh['DNA'].name = ','.join(dna)

mm = args['--master-mix'].split(',')
huh['dCas9-PCV2'].master_mix = 'cas9' in mm
huh['sgRNA'].master_mix = 'sgrna' in mm
huh['DNA'].master_mix = 'dna' in mm
huh['EDTA'].master_mix = 'edta' in mm
huh['buffer'].master_mix = 'buffer' in mm

if args['--no-sgrna']:
    del huh['sgRNA']
else:
    p += stepwise.load('zap')
    huh['water'].name = 'nuclease-free water'

p += f"""\
Attach DNA to HUH-tagged dCas9 [1-3]:

{huh}

- Add each reagent in order.
- Mix after adding EDTA (and before adding DNA).
- Incubate at 37°C for 15 min.
"""

# 500 ng/band
p.footnotes[1] = """\
Invitrogen recommends loading no more than 250