本文整理汇总了Python中process.sequence.AlignmentList.filter_missing_data方法的典型用法代码示例。如果您正苦于以下问题:Python AlignmentList.filter_missing_data方法的具体用法?Python AlignmentList.filter_missing_data怎么用?Python AlignmentList.filter_missing_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类process.sequence.AlignmentList
的用法示例。
在下文中一共展示了AlignmentList.filter_missing_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AlignmentMissingFiltersTest
# 需要导入模块: from process.sequence import AlignmentList [as 别名]
# 或者: from process.sequence.AlignmentList import filter_missing_data [as 别名]
class AlignmentMissingFiltersTest(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_filter_default(self):
self.aln_obj.add_alignment_files(
["trifusion/tests/data/missing_data.phy",
"trifusion/tests/data/missing_data2.phy"]
)
self.aln_obj.filter_missing_data(25, 50)
s = []
for aln in self.aln_obj:
s.append(aln.locus_length)
self.assertEqual(s, [42, 43])
def test_filter_and_concat(self):
self.aln_obj.add_alignment_files(
["trifusion/tests/data/missing_data.phy",
"trifusion/tests/data/missing_data2.phy"]
)
self.aln_obj.filter_missing_data(25, 50, table_out="master_out")
self.aln_obj.concatenate(table_in="master_out")
self.assertEqual(self.aln_obj.size, 85)
def test_no_filters(self):
self.aln_obj.add_alignment_files(
["trifusion/tests/data/missing_data.phy",
"trifusion/tests/data/missing_data2.phy"]
)
self.aln_obj.filter_missing_data(100, 100)
s = []
for aln in self.aln_obj:
s.append(aln.locus_length)
self.assertEqual(s, [50, 50])
def test_no_missing(self):
self.aln_obj.add_alignment_files(
["trifusion/tests/data/missing_data.phy",
"trifusion/tests/data/missing_data2.phy"]
)
self.aln_obj.filter_missing_data(0, 0)
s = []
for aln in self.aln_obj:
s.append(aln.locus_length)
self.assertEqual(s, [0, 19])
def test_no_data_aln_default_filters(self):
self.aln_obj.add_alignment_files(
["trifusion/tests/data/missing_data3.phy"]
)
self.aln_obj.filter_missing_data(25, 50)
s = None
for aln in self.aln_obj:
s = aln.locus_length
self.assertEqual(s, 0)
def test_no_data_aln_no_filters(self):
self.aln_obj.add_alignment_files(
["trifusion/tests/data/missing_data3.phy"]
)
self.aln_obj.filter_missing_data(100, 100)
s = None
for aln in self.aln_obj:
s = aln.locus_length
self.assertEqual(s, 50)