• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python plugins.GeminiPlugin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_add_genotypes

    def test_add_genotypes(self, variant):
        adapter = GeminiPlugin()
        gemini_variant = {
            'gts': ['G/A', 'G/A', './.', './.', './.'],
            'gt_depths': [17, 19, -1, -1, -1],
            'gt_ref_depths': [10, 13, -1, -1, -1],
            'gt_alt_depths': [7, 6, -1, -1, -1],
            'gt_quals': [99, 99, -1, -1, -1],
            
        }
        ind = DotDict()
        ind.ind_index = 0
        ind.ind_id = '1'
        ind.case_id = 'Case_1'
        ind.phenotype = 2
        ind_objs = [ind]

        adapter._add_genotypes(variant, gemini_variant, ind_objs)
        
        genotype = variant.individuals[0]

        assert genotype.sample_id == ind.ind_id
        assert genotype.sample_id == ind.ind_id
        assert genotype.genotype == 'G/A'
        assert genotype.case_id == ind.case_id
        assert genotype.phenotype == ind.phenotype
        assert genotype.ref_depth == 10
        assert genotype.alt_depth == 7
        assert genotype.depth == 17
        assert genotype.genotype_quality == 99
开发者ID:J35P312,项目名称:puzzle,代码行数:30,代码来源:test_gemini_variant_extras.py


示例2: test_filters_impact_severities

 def test_filters_impact_severities(self, gemini_path):
     adapter = GeminiPlugin(db=gemini_path)
     filters = {'impact_severities':['HIGH']}
     variants = []
     for variant in adapter.variants('643594', filters=filters):
         variants.append(variant)
     assert len(variants) == 2
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:7,代码来源:test_variant_mixin.py


示例3: test_add_exac

 def test_add_exac(self, variant):
     adapter = GeminiPlugin()
     gemini_variant = {'aaf_exac_all':0.01}
     adapter._add_exac(variant, gemini_variant)
     
     assert variant.thousand_g == None
     assert len(variant.frequencies) == 1
开发者ID:J35P312,项目名称:puzzle,代码行数:7,代码来源:test_gemini_variant_extras.py


示例4: test_filters_cadd

 def test_filters_cadd(self, gemini_path):
     adapter = GeminiPlugin(db=gemini_path)
     filters = {'cadd':'20'}
     variants = []
     for variant in adapter.variants('643594', filters=filters):
         variants.append(variant)
     assert len(variants) == 4
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:7,代码来源:test_variant_mixin.py


示例5: test_is_variant

def test_is_variant(case_obj):
    adapter = GeminiPlugin()
    genotypes = ['G/A', 'G/A', 'G/G', 'G/G', './.']
    ind_objs = [
        Individual(ind_id=0, ind_index=0),
        Individual(ind_id=1, ind_index=1),
    ]
    #Mock a gemini variant
    gemini_variant = {
        'gts':genotypes,
        'alt':'A'
    }
    
    assert adapter._is_variant(gemini_variant, ind_objs)
    
    #Check with individuals that are hom ref
    ind_objs = [
        Individual(ind_id=0, ind_index=2),
        Individual(ind_id=1, ind_index=3),
    ]

    assert not adapter._is_variant(gemini_variant, ind_objs)

    #Check with individual that has no call
    ind_objs = [
        Individual(ind_id=0, ind_index=4),
    ]

    assert not adapter._is_variant(gemini_variant, ind_objs)
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:29,代码来源:test_variant_mixin.py


示例6: test_filters_gene_ids

 def test_filters_gene_ids(self, gemini_path):
     adapter = GeminiPlugin(db=gemini_path)
     filters = {'gene_ids':['HLA-DRB5']}
     variants = []
     for variant in adapter.variants('643594', filters=filters):
         variants.append(variant)
     assert len(variants) == 5
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:7,代码来源:test_variant_mixin.py


示例7: test_filters_consequence

 def test_filters_consequence(self, gemini_path):
     adapter = GeminiPlugin(db=gemini_path)
     filters = {'consequence':['stop_gained']}
     variants = []
     for variant in adapter.variants('643594', filters=filters):
         variants.append(variant)
     assert len(variants) == 2
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:7,代码来源:test_variant_mixin.py


示例8: test_add_thousand_g

 def test_add_thousand_g(self, variant):
     adapter = GeminiPlugin()
     gemini_variant = {'aaf_1kg_all':0.01}
     adapter._add_thousand_g(variant, gemini_variant)
     
     assert variant.thousand_g == 0.01
     assert len(variant.frequencies) == 1
开发者ID:J35P312,项目名称:puzzle,代码行数:7,代码来源:test_gemini_variant_extras.py


示例9: test_filters_frequency

 def test_filters_frequency(self, gemini_path):
     adapter = GeminiPlugin(db=gemini_path)
     filters = {'frequency':'0.01'}
     variants = []
     for variant in adapter.variants('643594', filters=filters):
         variants.append(variant)
     assert len(variants) == 13
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:7,代码来源:test_variant_mixin.py


示例10: test_add_gmaf_no_frequency

 def test_add_gmaf_no_frequency(self, variant):
     adapter = GeminiPlugin()
     gemini_variant = {'max_aaf_all':None}
     adapter._add_gmaf(variant, gemini_variant)
     
     assert len(variant.frequencies) == 0
     assert variant.max_freq == None
开发者ID:J35P312,项目名称:puzzle,代码行数:7,代码来源:test_gemini_variant_extras.py


示例11: test_get_all_variants

def test_get_all_variants(gemini_path):
    """Test to get some variants from the gemini adapter"""
    adapter = GeminiPlugin(db=gemini_path)
    variants = []
    for variant in adapter.variants('643594'):
        variants.append(variant)

    assert len(variants) == 14
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:8,代码来源:test_variant_mixin.py


示例12: test_filters_no_filters

    def test_filters_no_filters(self, gemini_case_obj):
        plugin = GeminiPlugin()
        plugin.add_case(gemini_case_obj)

        filters = {}
        result = plugin.variants('643594', filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants

        assert nr_of_variants == 14
开发者ID:J35P312,项目名称:puzzle,代码行数:10,代码来源:test_gemini_variant_mixin.py


示例13: test_no_filters_sv

    def test_no_filters_sv(self, gemini_sv_case_obj):
        plugin = GeminiPlugin()
        plugin.add_case(gemini_sv_case_obj)

        filters = {}
        result = plugin.variants('hapmap', filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        assert nr_of_variants == 513
开发者ID:J35P312,项目名称:puzzle,代码行数:10,代码来源:test_gemini_variant_mixin.py


示例14: test_build_gemini_query

def test_build_gemini_query():
    adapter = GeminiPlugin()
    query = "SELECT * from variants"
    extra_info = "max_aaf_all < 0.01"
    new_query = adapter.build_gemini_query(query, extra_info)
    assert new_query == "SELECT * from variants WHERE max_aaf_all < 0.01"
    
    extra_info = "cadd_score > 10"
    new_query = adapter.build_gemini_query(new_query, extra_info)
    assert new_query == "SELECT * from variants WHERE max_aaf_all < 0.01 AND cadd_score > 10"
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:10,代码来源:test_variant_mixin.py


示例15: test_variant

def test_variant(gemini_path):
    """Test to get one variant"""
    adapter = GeminiPlugin(db=gemini_path)
    variant = adapter.variant(
        case_id='643594',
        variant_id=4
    )

    assert variant['CHROM'] == '6'
    assert variant['POS'] == '32487163'
    assert type(variant['genes']) == type([])
开发者ID:J35P312,项目名称:PuzzleWin,代码行数:11,代码来源:test_variant_mixin.py


示例16: test_get_all_variants

def test_get_all_variants(gemini_case_obj):
    """Test to get some variants from the gemini adapter"""
    plugin = GeminiPlugin()
    plugin.add_case(gemini_case_obj)

    filters = {}
    result = plugin.variants('643594', filters=filters, count=1000)
    variants = result.variants
    nr_of_variants = result.nr_of_variants

    assert nr_of_variants == 14
开发者ID:J35P312,项目名称:puzzle,代码行数:11,代码来源:test_gemini_variant_mixin.py


示例17: test_filters_impact_severities_medium

    def test_filters_impact_severities_medium(self, gemini_case_obj):
        plugin = GeminiPlugin()
        plugin.add_case(gemini_case_obj)

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


示例18: test_filters_gene_ids

    def test_filters_gene_ids(self, gemini_case_obj):
        plugin = GeminiPlugin()
        plugin.add_case(gemini_case_obj)

        filters = {'gene_ids':['HLA-DRB5']}
        result = plugin.variants('643594', filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            assert 'HLA-DRB5' in variant_obj.gene_symbols
        
        assert nr_of_variants == 5
开发者ID:J35P312,项目名称:puzzle,代码行数:13,代码来源:test_gemini_variant_mixin.py


示例19: test_filters_sv_len

    def test_filters_sv_len(self, gemini_sv_case_obj):
        plugin = GeminiPlugin()
        plugin.add_case(gemini_sv_case_obj)

        filters = {'sv_len':'800'}
        result = plugin.variants('hapmap', filters=filters, count=1000)
        variants = result.variants
        nr_of_variants = result.nr_of_variants
        
        for variant_obj in variants:
            assert variant_obj.sv_len >= 800
        
        assert nr_of_variants == 176
开发者ID:J35P312,项目名称:puzzle,代码行数:13,代码来源:test_gemini_variant_mixin.py


示例20: test_variant

def test_variant(gemini_case_obj):
    """Test to get one variant"""
    plugin = GeminiPlugin()
    plugin.add_case(gemini_case_obj)

    variant = plugin.variant(
        case_id='643594',
        variant_id=4
    )

    assert variant['CHROM'] == '6'
    assert variant['POS'] == '32487163'
    assert type(variant['genes']) == type([])
开发者ID:J35P312,项目名称:puzzle,代码行数:13,代码来源:test_gemini_variant_mixin.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python plugins.VcfPlugin类代码示例发布时间:2022-05-25
下一篇:
Python pushover.Client类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap