def export(self): """Export selected text to new text window.""" seq = self.get_selection_or_sequence() if not seq: return np = NotePad() tid = np.text_id() tid.insert('end', seq)
def gcframe(self, direction='both'): seq = self.get_selection_or_sequence() if not seq: return np = NotePad() tid = np.text_id() tid.insert('end', self.translator.gcframe(seq, self.current_codon_table_id, direction))
def extract(self): seq = self.get_selection_or_sequence() frame = self.frame_int.get() if not seq: return aa_seq = self.translator.frame(seq, frame, self.current_codon_table_id) aa_seq = re.sub('(.{50})', '\\1\n', str(aa_seq)) np = NotePad() tid = np.text_id() tid.insert('end', '>frame%d\n%s' % (frame, aa_seq))
def gcframe(self, direction='both'): seq = self.get_selection_or_sequence() if not seq: return np = NotePad() tid = np.text_id() tid.insert( 'end', self.translator.gcframe(seq, self.current_codon_table_id, direction))
def translate(self): seq = self.get_selection_or_sequence() frame = self.frame_int.get() if not seq: return np = NotePad() tid = np.text_id() tid.insert('end', self.translator.frame_nice(seq, frame, self.current_codon_table_id))
def gcframe(self, direction="both"): """Run pretty print multiple frame translations.""" seq = self.get_selection_or_sequence() if not seq: return np = NotePad() tid = np.text_id() tid.insert( "end", self.translator.gcframe(seq, self.current_codon_table_id, direction) )
def translate(self): seq = self.get_selection_or_sequence() frame = self.frame_int.get() if not seq: return np = NotePad() tid = np.text_id() tid.insert( 'end', self.translator.frame_nice(seq, frame, self.current_codon_table_id))
def extract(self): """Make single frame translation and display aa sequence as fasta.""" seq = self.get_selection_or_sequence() frame = self.frame_int.get() if not seq: return aa_seq = self.translator.frame(seq, frame, self.current_codon_table_id) aa_seq = re.sub("(.{50})", "\\1\n", str(aa_seq)) np = NotePad() tid = np.text_id() tid.insert("end", ">frame%d\n%s" % (frame, aa_seq))
def translate(self): """Run pretty print single frame translation.""" seq = self.get_selection_or_sequence() frame = self.frame_int.get() if not seq: return np = NotePad() tid = np.text_id() tid.insert( "end", self.translator.frame_nice(seq, frame, self.current_codon_table_id) )
def statistics(self): seq = self.get_selection_or_sequence() if not seq: return seq = seq.upper() aa = {'A': 0, 'C': 0, 'G': 0, 'T': 0, 'N': 0} for nt in seq: if nt not in aa: nt = 'N' aa[nt] = aa[nt] + 1 GC = (100.0 * (aa['G'] + aa['C'])) / len(seq) np = NotePad() tid = np.text_id() tid.insert( 'end', "%s\n\n" % (time.strftime('%y %b %d, %X\n', time.localtime(time.time()))) + "Length = %d\nA=%d C=%d G=%d T=%d other=%d\nGC=%f\n\n" % (len(seq), aa['A'], aa['C'], aa['G'], aa['T'], aa['N'], GC))
def statistics(self): seq = self.get_selection_or_sequence() if not seq: return seq = seq.upper() aa = {'A': 0, 'C': 0, 'G': 0, 'T': 0, 'N': 0} for nt in seq: if nt not in aa: nt = 'N' aa[nt] = aa[nt] + 1 GC = (100.0 * (aa['G'] + aa['C'])) / len(seq) np = NotePad() tid = np.text_id() tid.insert('end', "%s\n\n" % (time.strftime('%y %b %d, %X\n', time.localtime(time.time()))) + "Length = %d\nA=%d C=%d G=%d T=%d other=%d\nGC=%f\n\n" % (len(seq), aa['A'], aa['C'], aa['G'], aa['T'], aa['N'], GC))
def statistics(self): """Calculate statistics of sequence and display in new window.""" seq = self.get_selection_or_sequence() if not seq: return seq = seq.upper() aa = {"A": 0, "C": 0, "G": 0, "T": 0, "N": 0} for nt in seq: if nt not in aa: nt = "N" aa[nt] = aa[nt] + 1 GC = (100.0 * (aa["G"] + aa["C"])) / len(seq) np = NotePad() tid = np.text_id() tid.insert( "end", "%s\n\n" % (time.strftime("%y %b %d, %X\n", time.localtime(time.time()))) + "Length = %d\nA=%d C=%d G=%d T=%d other=%d\nGC=%f\n\n" % (len(seq), aa["A"], aa["C"], aa["G"], aa["T"], aa["N"], GC))