当前位置: 首页>>代码示例>>Python>>正文


Python NotePad.text_id方法代码示例

本文整理汇总了Python中xbb_utils.NotePad.text_id方法的典型用法代码示例。如果您正苦于以下问题:Python NotePad.text_id方法的具体用法?Python NotePad.text_id怎么用?Python NotePad.text_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xbb_utils.NotePad的用法示例。


在下文中一共展示了NotePad.text_id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: export

# 需要导入模块: from xbb_utils import NotePad [as 别名]
# 或者: from xbb_utils.NotePad import text_id [as 别名]
 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)
开发者ID:abradle,项目名称:biopython,代码行数:10,代码来源:xbb_widget.py

示例2: gcframe

# 需要导入模块: from xbb_utils import NotePad [as 别名]
# 或者: from xbb_utils.NotePad import text_id [as 别名]
 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))
开发者ID:abradle,项目名称:biopython,代码行数:11,代码来源:xbb_widget.py

示例3: extract

# 需要导入模块: from xbb_utils import NotePad [as 别名]
# 或者: from xbb_utils.NotePad import text_id [as 别名]
 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))
开发者ID:abradle,项目名称:biopython,代码行数:12,代码来源:xbb_widget.py

示例4: translate

# 需要导入模块: from xbb_utils import NotePad [as 别名]
# 或者: from xbb_utils.NotePad import text_id [as 别名]
 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))
开发者ID:abradle,项目名称:biopython,代码行数:12,代码来源:xbb_widget.py

示例5: statistics

# 需要导入模块: from xbb_utils import NotePad [as 别名]
# 或者: from xbb_utils.NotePad import text_id [as 别名]
    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))
开发者ID:abradle,项目名称:biopython,代码行数:23,代码来源:xbb_widget.py


注:本文中的xbb_utils.NotePad.text_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。