def compute_primers(): # Get the part names. sequence_name = request.form['sequence_name'] sequence = request.form['sequence'].replace('\n','') backbone = request.form['backbone'] # Validation checks if not validate_sequence_characters(sequence): return error('Sequence contains non-ATGC letters') if not validate_sequence_length(sequence): return error('Sequence length has to be at least 100 n.t.') else: # Create a SeqRecord object. part = SeqRecord(Seq(sequence.upper(), alphabet=generic_dna), name=sequence_name, id=sequence_name) backbone_part = plasmids[backbone] p = PrimerDesigner() p.set_sequences([part, backbone_part]) p.construct_graph() nodes = p.nodes(data=True) edges = p.edges(data=True) protocol = p.pcr_protocol() return render_template('primers.html', nodes=nodes, edges=edges, protocol=protocol)
def compute_mutagenesis_primers(self): """ Using the sequence fragments to be assembled together, computes for each step the primers that are to be used to assemble the mutated fragments. """ for step, frags in self.fragments.items(): # Run the standard PrimerDesigner protocol. p = PrimerDesigner() p.set_sequences(frags) # Ensure to set the filename attribute. p.filename = 'step{step}'.format(step=step) p.construct_graph() p.compute_assembly_primers() p.compute_junction_sequencing_primers() p.compute_pcr_protocol() self.primer_designers[step] = p