本文整理匯總了Python中puzzle.plugins.VcfPlugin.variants方法的典型用法代碼示例。如果您正苦於以下問題:Python VcfPlugin.variants方法的具體用法?Python VcfPlugin.variants怎麽用?Python VcfPlugin.variants使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類puzzle.plugins.VcfPlugin
的用法示例。
在下文中一共展示了VcfPlugin.variants方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_filters_no_filter
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例2: test_variants_case_with_ped
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [as 別名]
def test_variants_case_with_ped():
vcf_plugin = VcfPlugin(root_path=vcf, case_lines=individuals, case_type='ped')
variants = vcf_plugin.variants(case_id='636808')
variant = next(variants)
assert variant['CHROM'] == 'X'
assert int(variant['POS']) == 84563218
assert variant['index'] == 1
variant = next(variants)
assert variant['CHROM'] == '2'
assert int(variant['POS']) == 233349186
assert variant['index'] == 2
示例3: test_variants_case_no_ped
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [as 別名]
def test_variants_case_no_ped():
vcf_plugin = VcfPlugin(root_path=vcf)
variants = vcf_plugin.variants(case_id='hapmap.vcf')
variant = next(variants)
assert variant['CHROM'] == 'X'
assert int(variant['POS']) == 84563218
assert variant['index'] == 1
variant = next(variants)
assert variant['CHROM'] == '2'
assert int(variant['POS']) == 233349186
assert variant['index'] == 2
示例4: test_filters_frequency
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例5: test_filters_impact_severities_high
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例6: test_filters_cadd
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例7: test_filters_consequence
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例8: test_filters_gene_ids
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例9: test_variants_case
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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
示例10: test_filters_range
# 需要導入模塊: from puzzle.plugins import VcfPlugin [as 別名]
# 或者: from puzzle.plugins.VcfPlugin import variants [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