當前位置: 首頁>>代碼示例>>Python>>正文


Python sequence.AlignmentList類代碼示例

本文整理匯總了Python中process.sequence.AlignmentList的典型用法代碼示例。如果您正苦於以下問題:Python AlignmentList類的具體用法?Python AlignmentList怎麽用?Python AlignmentList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AlignmentList類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_alternative_missing

    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], "?")
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:7,代碼來源:test_load_process_data.py

示例2: test_non_ascii_taxon_names

    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)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:7,代碼來源:test_load_process_data.py

示例3: test_protein_missing_eval

    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")
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:7,代碼來源:test_load_process_data.py

示例4: test_dna_missing_eval

    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")
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:7,代碼來源:test_load_process_data.py

示例5: test_dna_missing_default

    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")
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:7,代碼來源:test_load_process_data.py

示例6: setUp

    def setUp(self):

        if not os.path.exists(temp_dir):
            os.makedirs(temp_dir)

        self.aln_obj = AlignmentList(dna_data_fas, sql_db=sql_db)
        self.aln_obj.partitions.reset(cur=self.aln_obj.cur,)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:7,代碼來源:test_partitions.py

示例7: test_single_partition

    def test_single_partition(self):

        self.aln_obj = AlignmentList([dna_data_fas[0]],
                                     db_con=self.aln_obj.con,
                                     db_cur=self.aln_obj.cur,
                                     sql_db=sql_db)

        self.assertTrue(self.aln_obj.partitions.is_single())
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:8,代碼來源:test_partitions.py

示例8: test_non_ascii_iter_columns

    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)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:10,代碼來源:test_load_process_data.py

示例9: test_non_ascii_get_taxaidx

    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)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:10,代碼來源:test_load_process_data.py

示例10: test_no_end_colon_interleave

    def test_no_end_colon_interleave(self):

        self.aln_obj = AlignmentList(bad_no_end_interleave, sql_db=sql_db)

        aln_obj = self.aln_obj.alignments.values()[0]
        data = [aln_obj.name,
                aln_obj.locus_length,
                len(aln_obj.taxa_idx)]

        self.assertEqual(data, ["bad_no_end_interleave.nex",
                                898,
                                12])
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:12,代碼來源:test_load_process_data.py

示例11: test_non_ascii_iteration

    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)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:12,代碼來源:test_load_process_data.py

示例12: test_bad_wrong_size_nexus

    def test_bad_wrong_size_nexus(self):

        self.aln_obj = AlignmentList(bad_wrong_size, sql_db=sql_db)

        aln_obj = self.aln_obj.alignments.values()[0]
        data = [aln_obj.name,
                aln_obj.locus_length,
                len(aln_obj.taxa_idx)]

        self.assertEqual(data, ["bad_wrong_size.nex",
                                898,
                                12])
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:12,代碼來源:test_load_process_data.py

示例13: test_bad_file_removal_from_db

    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)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:12,代碼來源:test_load_process_data.py

示例14: test_concat_custom_fileset_from_phy_partfile

    def test_concat_custom_fileset_from_phy_partfile(self):

        self.aln_obj.clear_alignments()
        self.aln_obj.con.close()
        self.aln_obj = AlignmentList(dna_data_fas, sql_db=sql_db)
        self.aln_obj.partitions.read_from_file(concatenated_small_parNex[0])

        self.aln_obj.update_active_alignments(
            [join(data_path, "BaseConc1.fas"),
             join(data_path, "BaseConc2.fas")])

        self.aln_obj.concatenate()

        key_data = [
            sorted(self.aln_obj.partitions.partitions.keys()),
            sorted(self.aln_obj.partitions.partitions_alignments.keys()),
            sorted(self.aln_obj.partitions.models.keys())]

        self.expect_equal(key_data, [["BaseConc1.fas", "BaseConc2.fas"]] * 3)
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:19,代碼來源:test_partitions.py

示例15: test_import_new_partscheme

    def test_import_new_partscheme(self):

        self.aln_obj.clear_alignments()
        self.aln_obj.con.close()

        self.aln_obj = AlignmentList(concatenated_medium_nexus,
                                     sql_db=sql_db)

        self.aln_obj.partitions.reset()

        self.aln_obj.partitions.read_from_file(concatenated_small_par[0],
                                               no_aln_check=True)

        res = self.aln_obj.partitions.get_partition_names()

        self.assertEqual(res, ["BaseConc1.fas", "BaseConc2.fas",
                               "BaseConc3.fas", "BaseConc4.fas",
                               "BaseConc5.fas", "BaseConc6.fas",
                               "BaseConc7.fas"])
開發者ID:ODiogoSilva,項目名稱:TriFusion,代碼行數:19,代碼來源:test_partitions.py


注:本文中的process.sequence.AlignmentList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。