当前位置: 首页>>代码示例>>Python>>正文


Python MSA.from_file方法代码示例

本文整理汇总了Python中paleomix.common.formats.msa.MSA.from_file方法的典型用法代码示例。如果您正苦于以下问题:Python MSA.from_file方法的具体用法?Python MSA.from_file怎么用?Python MSA.from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paleomix.common.formats.msa.MSA的用法示例。


在下文中一共展示了MSA.from_file方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _teardown

# 需要导入模块: from paleomix.common.formats.msa import MSA [as 别名]
# 或者: from paleomix.common.formats.msa.MSA import from_file [as 别名]
 def _teardown(self, config, temp):
     # Validate output from MAFFT
     output_file = reroot_path(temp, self._output_file)
     try:
         MSA.from_file(output_file)
     except MSAError, error:
         raise NodeError("Invalid MSA produced by MAFFT:\n%s" % (error,))
开发者ID:muslih14,项目名称:paleomix,代码行数:9,代码来源:mafft.py

示例2: _read_sequences

# 需要导入模块: from paleomix.common.formats.msa import MSA [as 别名]
# 或者: from paleomix.common.formats.msa.MSA import from_file [as 别名]
def _read_sequences(filenames):
    results = {}
    for filename in filenames:
        results[filename] = MSA.from_file(filename)
    MSA.validate(*results.values())

    return results.iteritems()
开发者ID:muslih14,项目名称:paleomix,代码行数:9,代码来源:formats.py

示例3: _run

# 需要导入模块: from paleomix.common.formats.msa import MSA [as 别名]
# 或者: from paleomix.common.formats.msa.MSA import from_file [as 别名]
    def _run(self, _config, temp):
        alignment = MSA.from_file(self._input_file)
        for (to_filter, groups) in self._filter_by.iteritems():
            alignment = alignment.filter_singletons(to_filter, groups)

        temp_filename = fileutils.reroot_path(temp, self._output_file)
        with open(temp_filename, "w") as handle:
            alignment.to_file(handle)
        fileutils.move_file(temp_filename, self._output_file)
开发者ID:MikkelSchubert,项目名称:paleomix,代码行数:11,代码来源:sequences.py

示例4: _run

# 需要导入模块: from paleomix.common.formats.msa import MSA [as 别名]
# 或者: from paleomix.common.formats.msa.MSA import from_file [as 别名]
    def _run(self, _config, temp):
        # Read and check that MSAs share groups
        msas = [MSA.from_file(filename) for filename in sorted(self.input_files)]
        MSA.validate(*msas)

        blocks = []
        for msa in msas:
            blocks.append(sequential_phy(msa, add_flag = self._add_flag))

        with open(reroot_path(temp, self._out_phy), "w") as output:
            output.write("\n\n".join(blocks))
开发者ID:muslih14,项目名称:paleomix,代码行数:13,代码来源:formats.py

示例5: _is_sufficently_covered

# 需要导入模块: from paleomix.common.formats.msa import MSA [as 别名]
# 或者: from paleomix.common.formats.msa.MSA import from_file [as 别名]
def _is_sufficently_covered(filepath, min_coverage):
    msa = MSA.from_file(filepath)
    if msa.seqlen() % 3:
        return False

    total_bases_not_covered = 0
    for fasta_record in msa:
        total_bases_not_covered += fasta_record.sequence.upper().count("N")
        total_bases_not_covered += fasta_record.sequence.count("-")

    total_bases = float(len(msa) * msa.seqlen())
    frac_covered = 1.0 - total_bases_not_covered / total_bases
    return frac_covered >= min_coverage
开发者ID:MikkelSchubert,项目名称:paleomix,代码行数:15,代码来源:select_highly_covered_genes.py

示例6: test_msa_from_file__compressed_bz2

# 需要导入模块: from paleomix.common.formats.msa import MSA [as 别名]
# 或者: from paleomix.common.formats.msa.MSA import from_file [as 别名]
def test_msa_from_file__compressed_bz2():
    expected = MSA([FASTA("This_is_BZ_FASTA!", None, "CGTNA"),
                    FASTA("This_is_ALSO_BZ_FASTA!", None,  "ACGTN")])
    results = MSA.from_file(test_file("fasta_file.fasta.bz2"))
    assert_equal(results, expected)
开发者ID:MikkelSchubert,项目名称:paleomix,代码行数:7,代码来源:msa_test.py


注:本文中的paleomix.common.formats.msa.MSA.from_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。