本文整理匯總了Python中process.sequence.AlignmentList.filter_segregating_sites方法的典型用法代碼示例。如果您正苦於以下問題:Python AlignmentList.filter_segregating_sites方法的具體用法?Python AlignmentList.filter_segregating_sites怎麽用?Python AlignmentList.filter_segregating_sites使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類process.sequence.AlignmentList
的用法示例。
在下文中一共展示了AlignmentList.filter_segregating_sites方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: AlignmentVariationFilters
# 需要導入模塊: from process.sequence import AlignmentList [as 別名]
# 或者: from process.sequence.AlignmentList import filter_segregating_sites [as 別名]
class AlignmentVariationFilters(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_variation_filter_min(self):
self.aln_obj.add_alignment_files(variable_data)
self.aln_obj.filter_segregating_sites(None, None)
self.assertEqual(len(self.aln_obj.alignments), 3)
def test_variation_var_sites(self):
self.aln_obj.add_alignment_files(variable_data)
self.aln_obj.filter_segregating_sites(1, 2)
self.assertEqual(len(self.aln_obj.alignments), 0)
def test_variation_var_sites2(self):
self.aln_obj.add_alignment_files(variable_data)
self.aln_obj.filter_segregating_sites(1, 3)
self.assertEqual(len(self.aln_obj.alignments), 1)
def test_variation_inf_min(self):
self.aln_obj.add_alignment_files(variable_data)
self.aln_obj.filter_informative_sites(None, None)
self.assertEqual(len(self.aln_obj.alignments), 3)
def test_variation_inf_sites(self):
self.aln_obj.add_alignment_files(variable_data)
self.aln_obj.filter_informative_sites(1, 4)
self.assertEqual(len(self.aln_obj.alignments), 1)
def test_variation_inf_sites2(self):
self.aln_obj.add_alignment_files(variable_data)
self.aln_obj.filter_informative_sites(1, 1)
print(self.aln_obj.alignments)
self.assertEqual(len(self.aln_obj.alignments), 1)