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


Python MSA.join方法代碼示例

本文整理匯總了Python中paleomix.common.formats.msa.MSA.join方法的典型用法代碼示例。如果您正苦於以下問題:Python MSA.join方法的具體用法?Python MSA.join怎麽用?Python MSA.join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在paleomix.common.formats.msa.MSA的用法示例。


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

示例1: _run

# 需要導入模塊: from paleomix.common.formats.msa import MSA [as 別名]
# 或者: from paleomix.common.formats.msa.MSA import join [as 別名]
    def _run(self, _config, temp):
        merged_msas = []
        for (name, files_dd) in sorted(self._infiles.iteritems()):
            partitions = files_dd["partitions"]
            msas = dict((key, []) for key in partitions)
            for filename in files_dd["filenames"]:
                msa = MSA.from_file(filename)
                if self._excluded:
                    msa = msa.exclude(self._excluded)

                for (key, msa_part) in msa.split(partitions).iteritems():
                    msas[key].append(msa_part)

            msas.pop("X", None)
            for (key, msa_parts) in sorted(msas.iteritems()):
                merged_msa = MSA.join(*msa_parts)
                if self._reduce:
                    merged_msa = merged_msa.reduce()

                if merged_msa is not None:
                    merged_msas.append(("%s_%s" % (name, key),
                                        merged_msa))

        out_fname_phy = reroot_path(temp, self._out_prefix + ".phy")
        with open(out_fname_phy, "w") as output_phy:
            final_msa = MSA.join(*(msa for (_, msa) in merged_msas))
            output_phy.write(interleaved_phy(final_msa))

        partition_end = 0
        out_fname_parts = reroot_path(temp, self._out_prefix + ".partitions")
        with open(out_fname_parts, "w") as output_part:
            for (name, msa) in merged_msas:
                length = msa.seqlen()
                output_part.write("DNA, %s = %i-%i\n"
                                  % (name,
                                     partition_end + 1,
                                     partition_end + length))
                partition_end += length
開發者ID:muslih14,項目名稱:paleomix,代碼行數:40,代碼來源:formats.py

示例2: test_msa_join__missing_arguments

# 需要導入模塊: from paleomix.common.formats.msa import MSA [as 別名]
# 或者: from paleomix.common.formats.msa.MSA import join [as 別名]
def test_msa_join__missing_arguments():
    MSA.join()
開發者ID:MikkelSchubert,項目名稱:paleomix,代碼行數:4,代碼來源:msa_test.py

示例3: test_msa_join__three_msa

# 需要導入模塊: from paleomix.common.formats.msa import MSA [as 別名]
# 或者: from paleomix.common.formats.msa.MSA import join [as 別名]
def test_msa_join__three_msa():
    expected = MSA((FASTA("nc",    None, "ACGTGAAAG"),
                    FASTA("nm",    None, "TGACTTGAG"),
                    FASTA("miRNA", None, "UCAGACCAU")))
    result = MSA.join(_JOIN_MSA_1, _JOIN_MSA_2, _JOIN_MSA_3)
    assert_equal(result, expected)
開發者ID:MikkelSchubert,項目名稱:paleomix,代碼行數:8,代碼來源:msa_test.py

示例4: test_msa_join__two_msa

# 需要導入模塊: from paleomix.common.formats.msa import MSA [as 別名]
# 或者: from paleomix.common.formats.msa.MSA import join [as 別名]
def test_msa_join__two_msa():
    expected = MSA((FASTA("nc",    None, "ACGTGA"),
                    FASTA("nm",    None, "TGACTT"),
                    FASTA("miRNA", None, "UCAGAC")))
    result = MSA.join(_JOIN_MSA_1, _JOIN_MSA_2)
    assert_equal(result, expected)
開發者ID:MikkelSchubert,項目名稱:paleomix,代碼行數:8,代碼來源:msa_test.py

示例5: test_msa_join__single_msa

# 需要導入模塊: from paleomix.common.formats.msa import MSA [as 別名]
# 或者: from paleomix.common.formats.msa.MSA import join [as 別名]
def test_msa_join__single_msa():
    result = MSA.join(_JOIN_MSA_1)
    assert_equal(result, _JOIN_MSA_1)
開發者ID:MikkelSchubert,項目名稱:paleomix,代碼行數:5,代碼來源:msa_test.py


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