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


Python VcfPlugin.add_case方法代码示例

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


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

示例1: test_individual

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_individual(case_obj):
    adapter=VcfPlugin()
    adapter.add_case(case_obj)
    
    ind_id = "ADM1059A1"
    ind_obj = adapter.individual(ind_id)
    assert ind_obj.ind_id == ind_id
开发者ID:J35P312,项目名称:puzzle,代码行数:9,代码来源:test_vcf_case_mixin.py

示例2: test_filters_no_filter

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_no_filter(self, case_obj):
        plugin = VcfPlugin()
        plugin.add_case(case_obj)
        case_id = case_obj.case_id

        filters = {}
        result = plugin.variants(case_id, filters=filters, count=1000)
        
        assert result.nr_of_variants == 108
开发者ID:J35P312,项目名称:puzzle,代码行数:11,代码来源:test_vcf_variant_mixin.py

示例3: test_variant

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_variant(case_obj):
    vcf_plugin = VcfPlugin()
    vcf_plugin.add_case(case_obj)

    variant = vcf_plugin.variant(case_obj.case_id, 'X_155239821_G_A')
    assert variant['CHROM'] == 'X'
    assert int(variant['POS']) == 155239821

    # get 10th variant
    variant = vcf_plugin.variant(case_obj.case_id, '3_124998098_C_A')
    assert variant['index'] == 10
开发者ID:J35P312,项目名称:puzzle,代码行数:13,代码来源:test_vcf_variant_mixin.py

示例4: test_filters_frequency

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_frequency(self, case_obj):
        plugin = VcfPlugin()
        plugin.add_case(case_obj)
        case_id = case_obj.case_id

        filters = {'frequency':'0.001'}
        result = plugin.variants(case_id, filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        for variant_obj in variants:
            assert variant_obj.max_freq <= 0.001
        
        assert nr_of_variants == 88
开发者ID:J35P312,项目名称:puzzle,代码行数:15,代码来源:test_vcf_variant_mixin.py

示例5: test_filters_impact_severities_high

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_impact_severities_high(self, case_obj):
        plugin = VcfPlugin()
        plugin.add_case(case_obj)
        case_id = case_obj.case_id

        filters = {'impact_severities':['HIGH']}
        result = plugin.variants(case_id, filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            assert variant_obj.impact_severity == 'HIGH'
        
        assert nr_of_variants == 7
开发者ID:J35P312,项目名称:puzzle,代码行数:16,代码来源:test_vcf_variant_mixin.py

示例6: test_filters_cadd

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_cadd(self, case_obj):
        plugin = VcfPlugin()
        plugin.add_case(case_obj)
        case_id = case_obj.case_id

        filters = {'cadd':'20'}
        result = plugin.variants(case_id, filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            variant_obj.cadd_score >= 20
        
        assert nr_of_variants == 50
开发者ID:J35P312,项目名称:puzzle,代码行数:16,代码来源:test_vcf_variant_mixin.py

示例7: test_filters_consequence

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_consequence(self, case_obj):
        plugin = VcfPlugin()
        plugin.add_case(case_obj)
        case_id = case_obj.case_id

        filters = {'consequence':['frameshift_variant']}
        result = plugin.variants(case_id, filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            assert 'frameshift_variant' in variant_obj.consequences
        
        assert nr_of_variants == 4
开发者ID:J35P312,项目名称:puzzle,代码行数:16,代码来源:test_vcf_variant_mixin.py

示例8: test_filters_gene_ids

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_gene_ids(self, case_obj):
        plugin = VcfPlugin()
        plugin.add_case(case_obj)
        case_id = case_obj.case_id

        filters = {'gene_ids':['POF1B']}
        result = plugin.variants(case_id, filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            assert 'POF1B' in variant_obj.gene_symbols
        
        assert nr_of_variants == 1
开发者ID:J35P312,项目名称:puzzle,代码行数:16,代码来源:test_vcf_variant_mixin.py

示例9: test_variants_case

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_variants_case(case_obj):
    vcf_plugin = VcfPlugin()
    vcf_plugin.add_case(case_obj)
    #case_id is 'hapmap.vcf' since no ped file is given
    result = vcf_plugin.variants(case_id=case_obj.case_id)
    variants = result.variants
    variant = variants[0]
    assert variant['CHROM'] == 'X'
    assert int(variant['POS']) == 84563218
    assert variant['index'] == 1

    variant = variants[1]
    assert variant['CHROM'] == '2'
    assert int(variant['POS']) == 233349186
    assert variant['index'] == 2
开发者ID:J35P312,项目名称:puzzle,代码行数:17,代码来源:test_vcf_variant_mixin.py

示例10: select_plugin

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def select_plugin(self, case_obj):
        """Select and initialize the correct plugin for the case."""
        if case_obj.variant_mode == "vcf":
            logger.debug("Using vcf plugin")
            plugin = VcfPlugin(case_obj.variant_type)
        elif case_obj.variant_mode == "gemini":
            logger.debug("Using gemini plugin")
            plugin = GeminiPlugin(case_obj.variant_type)

        # Add case to plugin
        plugin.add_case(case_obj)

        self.variant_type = case_obj.variant_type

        case_id = case_obj.case_id
        return plugin, case_id
开发者ID:robinandeer,项目名称:puzzle,代码行数:18,代码来源:store.py

示例11: test_filters_range

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
    def test_filters_range(self, case_obj, indexed_vcf_file):
        plugin = VcfPlugin()
        case_obj.variant_source = indexed_vcf_file
        case_obj.compressed = True
        case_obj.tabix_index = True
        
        plugin.add_case(case_obj)
        case_id = case_obj.case_id
        start = 1771120
        end = 1771130

        filters = {'range':{'chromosome':'1', 'start':start, 'end':end}}
        result = plugin.variants(case_id, filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            assert variant_obj.start >= start
            assert variant_obj.stop <= end
        
        assert nr_of_variants == 1
开发者ID:J35P312,项目名称:puzzle,代码行数:23,代码来源:test_vcf_variant_mixin.py

示例12: test_individuals

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_individuals(case_obj):
    adapter=VcfPlugin()
    adapter.add_case(case_obj)
    
    individuals = [ind for ind in adapter.individuals()]
    assert len(individuals) == 3
开发者ID:J35P312,项目名称:puzzle,代码行数:8,代码来源:test_vcf_case_mixin.py

示例13: test_case

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_case(case_obj):
    adapter=VcfPlugin()
    adapter.add_case(case_obj)
    case_id = "636808"
    case_obj = adapter.case(case_id)
    assert case_obj.case_id == case_id
开发者ID:J35P312,项目名称:puzzle,代码行数:8,代码来源:test_vcf_case_mixin.py

示例14: test_add_case

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_add_case(case_obj):
    adapter=VcfPlugin()
    adapter.add_case(case_obj)
    assert len(adapter.individual_objs) == 3
    case_obj = adapter.case_objs[0]
    assert case_obj.name == "636808"
开发者ID:J35P312,项目名称:puzzle,代码行数:8,代码来源:test_vcf_case_mixin.py

示例15: test_cases

# 需要导入模块: from puzzle.plugins import VcfPlugin [as 别名]
# 或者: from puzzle.plugins.VcfPlugin import add_case [as 别名]
def test_cases(case_obj):
    adapter=VcfPlugin()
    adapter.add_case(case_obj)
    case_id = "636808"
    case_obj = adapter.cases()[0]
    assert case_obj.name == "636808"
开发者ID:J35P312,项目名称:puzzle,代码行数:8,代码来源:test_vcf_case_mixin.py


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