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


Python RarefactionMaker.rarefy_to_files方法代码示例

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


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

示例1: main

# 需要导入模块: from qiime.rarefaction import RarefactionMaker [as 别名]
# 或者: from qiime.rarefaction.RarefactionMaker import rarefy_to_files [as 别名]
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    if not os.path.exists(opts.output_path):
        os.makedirs(opts.output_path)
    maker = RarefactionMaker(opts.input_path, opts.depth, opts.depth, 1, opts.num_reps)
    maker.rarefy_to_files(
        opts.output_path, False, include_lineages=opts.lineages_included, empty_otus_removed=(not opts.keep_empty_otus)
    )
开发者ID:colinbrislawn,项目名称:qiime,代码行数:11,代码来源:multiple_rarefactions_even_depth.py

示例2: main

# 需要导入模块: from qiime.rarefaction import RarefactionMaker [as 别名]
# 或者: from qiime.rarefaction.RarefactionMaker import rarefy_to_files [as 别名]
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    if opts.step <= 0:
        option_parser.error("nonpositive step not allowed (%s was supplied)" % \
          (opts.step,))
    create_dir(opts.output_path, fail_on_exist=False)
    maker = RarefactionMaker(opts.input_path, opts.min, opts.max,
        opts.step, opts.num_reps)
    maker.rarefy_to_files(opts.output_path, False,
        include_lineages=opts.lineages_included,
        empty_otus_removed=(not opts.keep_empty_otus))
开发者ID:Ecogenomics,项目名称:FrankenQIIME,代码行数:14,代码来源:multiple_rarefactions.py

示例3: test_rarefy_to_files

# 需要导入模块: from qiime.rarefaction import RarefactionMaker [as 别名]
# 或者: from qiime.rarefaction.RarefactionMaker import rarefy_to_files [as 别名]
    def test_rarefy_to_files(self):
        """rarefy_to_files should write valid files
        
        """
        maker = RarefactionMaker(self.otu_table_fp, 0, 1, 1, 1)
        maker.rarefy_to_files(self.rare_dir,include_full=True,include_lineages=False)

        fname = os.path.join(self.rare_dir,"rarefaction_1_0.biom")
        otu_table = parse_biom_table(open(fname,'U'))

        self.assertFloatEqual(otu_table.SampleIds, self.otu_table.SampleIds[:2])
        # third sample had 0 seqs, so it's gone
        self.assertFloatEqual(otu_table.ObservationIds, self.otu_table.ObservationIds)
开发者ID:DDomogala3,项目名称:qiime,代码行数:15,代码来源:test_rarefaction.py

示例4: test_rarefy_to_files

# 需要导入模块: from qiime.rarefaction import RarefactionMaker [as 别名]
# 或者: from qiime.rarefaction.RarefactionMaker import rarefy_to_files [as 别名]
    def test_rarefy_to_files(self):
        """rarefy_to_files should write valid files

        """
        maker = RarefactionMaker(self.otu_table_fp, 1, 2, 1, 1)
        maker.rarefy_to_files(
            self.rare_dir,
            include_full=True,
            include_lineages=False)

        fname = os.path.join(self.rare_dir, "rarefaction_1_0.biom")
        otu_table = load_table(fname)

        self.assertItemsEqual(
            otu_table.ids(),
            self.otu_table.ids()[:2])
开发者ID:cuttlefishh,项目名称:qiime,代码行数:18,代码来源:test_rarefaction.py

示例5: test_rarefy_to_files

# 需要导入模块: from qiime.rarefaction import RarefactionMaker [as 别名]
# 或者: from qiime.rarefaction.RarefactionMaker import rarefy_to_files [as 别名]
    def test_rarefy_to_files(self):
        """rarefy_to_files should write valid files

        """
        maker = RarefactionMaker(self.otu_table_fp, 0, 1, 1, 1)
        maker.rarefy_to_files(
            self.rare_dir,
            include_full=True,
            include_lineages=False)

        fname = os.path.join(self.rare_dir, "rarefaction_1_0.biom")
        with biom_open(fname, 'U') as biom_file:
            otu_table = Table.from_hdf5(biom_file)

        self.assertItemsEqual(
            otu_table.sample_ids,
            self.otu_table.sample_ids[:2])
开发者ID:jrherr,项目名称:qiime,代码行数:19,代码来源:test_rarefaction.py

示例6: main

# 需要导入模块: from qiime.rarefaction import RarefactionMaker [as 别名]
# 或者: from qiime.rarefaction.RarefactionMaker import rarefy_to_files [as 别名]
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    if opts.step <= 0:
        option_parser.error("step must be greater than 0")

    create_dir(opts.output_path, fail_on_exist=False)
    maker = RarefactionMaker(opts.input_path, opts.min, opts.max,
                             opts.step, opts.num_reps)

    if opts.subsample_multinomial:
        subsample_f = partial(subsample, replace=True)
    else:
        subsample_f = subsample

    maker.rarefy_to_files(opts.output_path,
                          False,
                          include_lineages=opts.lineages_included,
                          empty_otus_removed=(not opts.keep_empty_otus),
                          subsample_f=subsample_f)
开发者ID:AhmedAbdelfattah,项目名称:qiime,代码行数:22,代码来源:multiple_rarefactions.py


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