本文整理汇总了Python中process.sequence.AlignmentList.filter_codon_positions方法的典型用法代码示例。如果您正苦于以下问题:Python AlignmentList.filter_codon_positions方法的具体用法?Python AlignmentList.filter_codon_positions怎么用?Python AlignmentList.filter_codon_positions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类process.sequence.AlignmentList
的用法示例。
在下文中一共展示了AlignmentList.filter_codon_positions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AlignmentCodonFilters
# 需要导入模块: from process.sequence import AlignmentList [as 别名]
# 或者: from process.sequence.AlignmentList import filter_codon_positions [as 别名]
class AlignmentCodonFilters(unittest.TestCase):
def setUp(self):
if not os.path.exists(temp_dir):
os.makedirs(temp_dir)
self.aln_obj = AlignmentList([],sql_db=sql_db)
def tearDown(self):
self.aln_obj.clear_alignments()
self.aln_obj.con.close()
shutil.rmtree(temp_dir)
def test_codon_filter_pos1(self):
self.aln_obj.add_alignment_files(codon_filter)
self.aln_obj.filter_codon_positions([True, False, False],
table_out="master_out")
s = []
for _, seq, _ in self.aln_obj.iter_alignments("master_out"):
s.append(seq)
self.assertEqual(s, ["a" * 16] * 10)
def test_codon_filter_pos2(self):
self.aln_obj.add_alignment_files(codon_filter)
self.aln_obj.filter_codon_positions([False, True, False],
table_out="master_out")
s = []
for _, seq, _ in self.aln_obj.iter_alignments("master_out"):
s.append(seq)
self.assertEqual(s, ["t" * 16] * 10)
def test_codon_filter_pos3(self):
self.aln_obj.add_alignment_files(codon_filter)
self.aln_obj.filter_codon_positions([False, False, True],
table_out="master_out")
s = []
for _, seq, _ in self.aln_obj.iter_alignments("master_out"):
s.append(seq)
self.assertEqual(s, ["g" * 16] * 10)
def test_codon_filter_pos12(self):
self.aln_obj.add_alignment_files(codon_filter)
self.aln_obj.filter_codon_positions([True, True, False],
table_out="master_out")
s = []
for _, seq, _ in self.aln_obj.iter_alignments("master_out"):
s.append(seq)
self.assertEqual(s, ["at" * 16] * 10)
def test_codon_filter_pos13(self):
self.aln_obj.add_alignment_files(codon_filter)
self.aln_obj.filter_codon_positions([True, False, True],
table_out="master_out")
s = []
for _, seq, _ in self.aln_obj.iter_alignments("master_out"):
s.append(seq)
self.assertEqual(s, ["ag" * 16] * 10)
def test_codon_filter_all(self):
self.aln_obj.add_alignment_files(codon_filter)
self.aln_obj.filter_codon_positions([True, True, True])
s = []
for _, seq, _ in self.aln_obj.iter_alignments():
s.append(seq)
self.assertEqual(s, ["atg" * 16] * 10)