backbone = ('gaattctaaagatctttgacagctagctcagtcctaggtataatactagt' '{}' 'gttttagtactctggaaacagaatctactaaaacaaggcaaaatgccgtg') spacers = [ #'g1', 'g2', 'g3', 'g4', 'g5', 'r1', 'r2', 'r3', 'r4', ] results = {} args = docopt.docopt(__doc__) dna = lambda x: backbone.format(sgrna_sensor.spacer(x, species='sa').dna) for spacer in spacers: designer = primers.PrimerDesigner() designer.name = 'sa_' + spacer designer.backbone = dna('n21') designer.construct = dna(spacer) designer.verbose = args['--verbose'] results.update(designer.design_primers()) results = primers.consolidate_duplicate_primers(results) primers.report_primers_to_table(results)
def calc_energy_from_row(row): spacer = sgrna_sensor.spacer(row.spacer).seq insert = inserts[row.design] return calc_energy(spacer, insert)
""" import docopt import shlex import sgrna_sensor import sgrna_sensor.primers as mut args = docopt.docopt(__doc__) primers = {} context = "gatctttgacagctagctcagtcctaggtataatactagt{}gtttcagagctatgctggaaacagcatagcaagttgaaat" for name in args['<spacers>']: designer = mut.PrimerDesigner() designer.name = name designer.tm = args['--tm'] designer.verbose = args['--verbose'] spacer = sgrna_sensor.spacer(name) designer.construct = context.format(spacer.dna) designer.backbone = context.format("") primers.update(designer.design_primers()) primers = mut.consolidate_duplicate_primers(primers) if args['--table']: mut.report_primers_to_table(primers) else: mut.report_primers_for_elim(primers)
return fc.mfe_dimer()[1] elif args['--algorithm'] == 'pf-dimer': fc = RNA.fold_compound(f'{spacer}&{insert}') return fc.pf_dimer()[1] else: raise ValueError(f"unknown algorithm: '{args['--algorithm']}'") def calc_energy_from_row(row): spacer = sgrna_sensor.spacer(row.spacer).seq insert = inserts[row.design] return calc_energy(spacer, insert) if args['<spacer>'] and args['<design>']: spacer = sgrna_sensor.spacer(args['<spacer>'], species=args['--species']).rna insert = inserts[args['<design>']] print(f"Spacer: {spacer}") print(f"Insert: {insert}") print(f"ΔG: {calc_energy(spacer, insert)}") else: df = densiometry.load_cleavage_data_from_xlsx_dir('densiometry') df = densiometry.calc_mean_change(df) # Drop all the controls df = df[df.design.isin(inserts.keys())] # Calculate the minimum free energy (MFE) for binding between the spacer # and the aptamer insert. df['binding_energy'] = df.apply(calc_energy_from_row, axis='columns')
#!/usr/bin/env python3 import yaml from sgrna_sensor import from_name, t7_promoter as t7, spacer, aptamer from sgrna_sensor import render_latex_table components = [ ('T7 promoter', t7()), ('AAVS spacer', spacer('aavs')), ('sgG1 spacer', spacer('gfp1')), ('sgR1 spacer', spacer('rfp1')), ('sgG2 spacer', spacer('gfp2')), ('sgR2 spacer', spacer('rfp2')), ('folA spacer', spacer('fol1')), ('Theophylline (theo) aptamer', aptamer('theo')), ('3-Methylxanthine (3mx) aptamer', aptamer('3mx')), ('Thiamine pyrophosphate (tpp) aptamer', aptamer('tpp')), ('Positive control', from_name('on')), (r'Negative control (G63C, G64C)', from_name('off')), (r'\ligrnaF{}', from_name('mhf/30')), (r'\ligrnaF[2]{}', from_name('mhf/37')), (r'\ligrnaF[3]{}', from_name('w30/65')), (r'\ligrnaF[4]{}', from_name('w30/64/1')), (r'\ligrnaB{}', from_name('rxb/11/1')), (r'\ligrnaB[2]{}', from_name('w11/2')), (r'\ligrnaB[3]{}', from_name('m11/ga')), ] with open('manual_alignments.yml') as file: manual_alignments = yaml.load(file)