本文整理匯總了Python中process.sequence.AlignmentList.iter_columns方法的典型用法代碼示例。如果您正苦於以下問題:Python AlignmentList.iter_columns方法的具體用法?Python AlignmentList.iter_columns怎麽用?Python AlignmentList.iter_columns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類process.sequence.AlignmentList
的用法示例。
在下文中一共展示了AlignmentList.iter_columns方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: LoadAlignmentsTest
# 需要導入模塊: from process.sequence import AlignmentList [as 別名]
# 或者: from process.sequence.AlignmentList import iter_columns [as 別名]
#.........這裏部分代碼省略.........
def test_bad_file_removal_from_db(self):
self.aln_obj = AlignmentList(unequal_file, sql_db=sql_db)
self.aln_obj.add_alignment_files(dna_data_fas)
s = 0
for tx, _, _ in self.aln_obj.iter_alignments():
if tx == "Seq1":
s += 1
self.assertEqual(s, 0)
def test_load_no_data(self):
self.aln_obj = AlignmentList(no_data, sql_db=sql_db)
def test_alternative_missing(self):
self.aln_obj = AlignmentList(alternative_missing, sql_db=sql_db)
aln = self.aln_obj.alignments.values()[0]
self.assertEqual(aln.sequence_code[1], "?")
def test_dna_missing_default(self):
self.aln_obj = AlignmentList(single_dna, sql_db=sql_db)
aln = self.aln_obj.alignments.values()[0]
self.assertEqual(aln.sequence_code[1], "n")
def test_protein_missing_default(self):
self.aln_obj = AlignmentList(protein_no_missing, sql_db=sql_db)
aln = self.aln_obj.alignments.values()[0]
self.assertEqual(aln.sequence_code[1], "x")
def test_dna_missing_eval(self):
self.aln_obj = AlignmentList(concatenated_medium_nexus, sql_db=sql_db)
aln = self.aln_obj.alignments.values()[0]
self.assertEqual(aln.sequence_code[1], "n")
def test_protein_missing_eval(self):
self.aln_obj = AlignmentList(protein_normal_missing, sql_db=sql_db)
aln = self.aln_obj.alignments.values()[0]
self.assertEqual(aln.sequence_code[1], "x")
def test_non_ascii_taxon_names(self):
self.aln_obj = AlignmentList(non_ascii, sql_db=sql_db)
non_ascii_tx = [x for x in self.aln_obj.taxa_names if
x == '\xc3\xa9!"#$%&/=?\'~\xc2\xba\xc2\xaa^"><']
self.assertEqual(len(non_ascii_tx), 1)
def test_non_ascii_iteration(self):
self.aln_obj = AlignmentList(non_ascii, sql_db=sql_db)
non_ascii_tx = []
for tx, _, _ in self.aln_obj.iter_alignments():
if tx == '\xc3\xa9!"#$%&/=?\'~\xc2\xba\xc2\xaa^"><':
non_ascii_tx.append(tx)
self.assertEqual(len(non_ascii_tx), 1)
def test_non_ascii_get_taxaidx(self):
self.aln_obj = AlignmentList(non_ascii, sql_db=sql_db)
aln = self.aln_obj.alignments.values()[0]
non_ascii_tx = [x for x in aln.taxa_idx
if x == '\xc3\xa9!"#$%&/=?\'~\xc2\xba\xc2\xaa^"><']
self.assertEqual(len(non_ascii_tx), 1)
def test_non_ascii_iter_columns(self):
self.aln_obj = AlignmentList(non_ascii, sql_db=sql_db)
tx_list, _, _ = next(self.aln_obj.iter_columns(include_taxa=True))
non_ascii_tx = [x for x in tx_list
if x == '\xc3\xa9!"#$%&/=?\'~\xc2\xba\xc2\xaa^"><']
self.assertEqual(len(non_ascii_tx), 1)