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


Python Variant.set_extra方法代碼示例

本文整理匯總了Python中xbrowse.Variant.set_extra方法的典型用法代碼示例。如果您正苦於以下問題:Python Variant.set_extra方法的具體用法?Python Variant.set_extra怎麽用?Python Variant.set_extra使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xbrowse.Variant的用法示例。


在下文中一共展示了Variant.set_extra方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_variants_from_note_tuples

# 需要導入模塊: from xbrowse import Variant [as 別名]
# 或者: from xbrowse.Variant import set_extra [as 別名]
def get_variants_from_note_tuples(project, note_tuples):
    variants = []
    for note_t in note_tuples:
        variant = get_datastore(project.project_id).get_single_variant(
            project.project_id, note_t[3], note_t[0], note_t[1], note_t[2]
        )
        if not variant:
            variant = Variant(note_t[0], note_t[1], note_t[2])
            get_annotator().annotate_variant(variant, project.get_reference_population_slugs())
            # variant.annotation = get_annotator().get_variant(note_t[0], note_t[1], note_t[2])
        variant.set_extra("family_id", note_t[3])
        variant.set_extra("project_id", project.project_id)
        variants.append(variant)
    return variants
開發者ID:batsal,項目名稱:xbrowse,代碼行數:16,代碼來源:lookups.py

示例2: get_variants_from_variant_tuples

# 需要導入模塊: from xbrowse import Variant [as 別名]
# 或者: from xbrowse.Variant import set_extra [as 別名]
def get_variants_from_variant_tuples(project, variant_tuples):
    variants = []
    for t in variant_tuples:
        variant = get_datastore(project.project_id).get_single_variant(
            project.project_id,
            t[3],
            t[0],
            t[1],
            t[2]
        )
        if not variant:
            variant = Variant(t[0], t[1], t[2])
            get_annotator().annotate_variant(variant, project.get_reference_population_slugs())
            
        variant.set_extra('family_id', t[3])
        variant.set_extra('project_id', project.project_id)
        variants.append(variant)
    return variants
開發者ID:burkesquires,項目名稱:xbrowse,代碼行數:20,代碼來源:lookups.py

示例3: get_variants_from_variant_tuples

# 需要導入模塊: from xbrowse import Variant [as 別名]
# 或者: from xbrowse.Variant import set_extra [as 別名]
def get_variants_from_variant_tuples(project, variant_tuples, user=None):
    datastore = get_datastore(project)
    population_slugs = project.get_reference_population_slugs()

    variant_tuples_by_family_id = {}
    for xpos, ref, alt, family_id in variant_tuples:
        if family_id not in variant_tuples_by_family_id:
            variant_tuples_by_family_id[family_id] = []
        variant_tuples_by_family_id[family_id].append((xpos, ref, alt))

    variants = []
    for family_id, variant_tuples in variant_tuples_by_family_id.items():
        variants_for_family = datastore.get_multiple_variants(
            project.project_id,
            family_id,
            variant_tuples,
            user=user
        )
        for (xpos, ref, alt), variant in zip(variant_tuples, variants_for_family):
            if not variant:
                variant = Variant(xpos, ref, alt)
                get_annotator().annotate_variant(variant, population_slugs)
                variant.set_extra('created_variant', True)

            variant.set_extra('family_id', family_id)
            variant.set_extra('project_id', project.project_id)
            variants.append(variant)

    return variants
開發者ID:macarthur-lab,項目名稱:seqr,代碼行數:31,代碼來源:lookups.py


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