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


Python SearchPath._check_forbidden_seqs方法代码示例

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


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

示例1: test_check_forbidden_seqs_none

# 需要导入模块: from cogent.seqsim.searchpath import SearchPath [as 别名]
# 或者: from cogent.seqsim.searchpath.SearchPath import _check_forbidden_seqs [as 别名]
    def test_check_forbidden_seqs_none(self):
        """Should return False if path includes no forbidden seqs"""
        
        #a seq that isn't in the standard fixed forbidden lib
        allowed_seq = ["C", "U", "A", "T"]        
        
        test = SearchPath(SearchPathHelper.alphabets, \
                SearchPathHelper.standard_forbid_seq)
        test._add_node(SearchNode(SearchNodeHelper.alphabet))

        #add more values, and cheat so as to make them something known
        for known_val in allowed_seq:
            curr_node = SearchNode(SearchNodeHelper.alphabet)
            curr_node._options[0] = known_val #torque the node's innards
            test._add_node(curr_node)
        #next bad_val
        
        real_result = test._check_forbidden_seqs()
        self.assertEquals(real_result, False)            
开发者ID:miklou,项目名称:pycogent,代码行数:21,代码来源:test_searchpath.py

示例2: test_check_forbidden_seqs_fixed

# 需要导入模块: from cogent.seqsim.searchpath import SearchPath [as 别名]
# 或者: from cogent.seqsim.searchpath.SearchPath import _check_forbidden_seqs [as 别名]
 def test_check_forbidden_seqs_fixed(self):
     """Should return True if path includes a fixed forbidden seq"""
     
     forbidden_seq = ["G", "U", "A"]     
     user_input = ["".join(forbidden_seq)]
     user_input.extend(SearchPathHelper.standard_forbid_seq)
     
     test = SearchPath(SearchPathHelper.alphabets, user_input)
     test._add_node(SearchNode(SearchNodeHelper.alphabet))
     
     #add more values, and cheat so as to make them something forbidden
     for bad_val in forbidden_seq:
         curr_node = SearchNode(SearchNodeHelper.alphabet)
         curr_node._options[0] = bad_val #torque the node's innards
         test._add_node(curr_node)
     #next bad_val
     
     real_result = test._check_forbidden_seqs()
     self.assertEquals(real_result, True)            
开发者ID:miklou,项目名称:pycogent,代码行数:21,代码来源:test_searchpath.py


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