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


Python plugins.GeminiPlugin類代碼示例

本文整理匯總了Python中puzzle.plugins.GeminiPlugin的典型用法代碼示例。如果您正苦於以下問題:Python GeminiPlugin類的具體用法?Python GeminiPlugin怎麽用?Python GeminiPlugin使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GeminiPlugin類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


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