Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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))
Пример #4
0
 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))
Пример #5
0
 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))
Пример #6
0
 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))
Пример #7
0
 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))
Пример #8
0
 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)
     )
Пример #9
0
 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))
Пример #10
0
 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))
Пример #11
0
 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)
     )
Пример #12
0
    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))
Пример #13
0
    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))
Пример #14
0
    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))