-v, --verbose Show extra debugging output. """ 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:
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)
'CAGTGGGGCCACTAGGGACAGGATTGGTGA', 'cagaaaagccccatccttaggcctcctcct', ) pblo = ( # 'aattctaaagatcttatagtaataatacgactcactatag', 'CATCTAATTCAACAAGAATT', 'gtttcagagctatgctggaaacagcatagcaagttgaaat', ) mhf37 = ( # 'aattctaaagatcttatagtaataatacgactcactatag', 'CATCTAATTCAACAAGAATT', 'gtttcagagcatgctggaaacagcatagcaagttgaaata', ) # Create primer designers. cr21_designer = mut.PrimerDesigner() cr21_designer.backbone = ''.join(cr21) pblo_designer = mut.PrimerDesigner() pblo_designer.backbone = ''.join(pblo) pblo_designer.cut = 2 # The default cut is usually either 1 or 2. This # ensures that the reverse primer is always the same. mhf37_designer = mut.PrimerDesigner() mhf37_designer.backbone = ''.join(mhf37) mhf37_designer.cut = 2 # Load the Doench16 spacers. with open('doench_spacers.tsv') as file: doench_spacers = [x.split() for x in file.readlines()] # Decide how many spacers to use.