예제 #1
0
 def toJSon(self):
     return ConditionMaker.condEnum(*self.mData)
예제 #2
0
def condition_good_confidence():
    return [
        ConditionMaker.condEnum("FT", ["PASS"]),
        ConditionMaker.condNum("Max_GQ", min_val=50),
        ConditionMaker.condNum("FS", max_val=30)
    ]
예제 #3
0
def setupSolutions_Case(app_config, base_pack):
    # BGM Filters, should belong to "Undiagnosed Patients Solution Pack"
    base_pack.regFilter("BGM_De_Novo", [
        condition_consequence_xBrowse(),
        ConditionMaker.condEnum("Callers", ["BGM_BAYES_DE_NOVO", "RUFUS"])
    ],
                        requires={"trio_base", "WS"})

    base_pack.regFilter("BGM_Homozygous_Rec", [
        condition_consequence_xBrowse(),
        ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
        ConditionMaker.condEnum("Callers", ["BGM_HOM_REC"]),
        ConditionMaker.condEnum("Transcript_source", ["Ensembl"]),
        ConditionMaker.condFunc("Inheritance_Mode", dict(),
                                ["Homozygous Recessive"])
    ],
                        requires={"trio_base", "WS"})

    base_pack.regFilter("BGM_Compound_Het", [
        condition_consequence_xBrowse(),
        ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
        ConditionMaker.condEnum("Callers", ["BGM_CMPD_HET"]),
        ConditionMaker.condEnum("Transcript_source", ["Ensembl"]),
        ConditionMaker.condFunc("Compound_Het", {"approx": "transcript"},
                                ["Proband"])
    ],
                        requires={"trio_base", "WS"})

    base_pack.regFilter("BGM_Autosomal_Dominant", [
        condition_consequence_xBrowse(),
        ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
        ConditionMaker.condEnum("Callers", ["BGM_DE_NOVO"]),
        ConditionMaker.condEnum("Transcript_source", ["Ensembl"])
    ],
                        requires={"trio_base", "WS"})

    # Standard mendelian Filters, should belong to
    # "Undiagnosed Patients Solution Pack"
    base_pack.regFilter(
        "X_Linked",
        condition_high_quality() + [
            condition_consequence_xBrowse(),
            ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
            ConditionMaker.condEnum("Transcript_source", ["Ensembl"]),
            ConditionMaker.condFunc("Inheritance_Mode", dict(), ["X-linked"])
        ],
        requires={"trio_base", "WS"})

    base_pack.regFilter(
        "Mendelian_Homozygous_Rec",
        condition_high_quality() + condition_all_genotypes_called() +
        clinVar_not_benign() + [
            condition_consequence_xBrowse(),
            ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
            ConditionMaker.condEnum("Transcript_source", ["Ensembl"]),
            ConditionMaker.condFunc("Inheritance_Mode", dict(),
                                    ["Homozygous Recessive"]),
            ConditionMaker.condEnum("Proband_Zygosity", ["Homozygous"])
        ],
        requires={"trio_base", "WS"})

    base_pack.regFilter(
        "Mendelian_Compound_Het",
        condition_high_quality() + clinVar_not_benign() + [
            condition_consequence_xBrowse(),
            ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
            ConditionMaker.condEnum("Transcript_source", ["Ensembl"]),
            ConditionMaker.condFunc("Compound_Het", {"approx": "transcript"},
                                    ["Proband"])
        ],
        requires={"trio_base", "WS"})

    base_pack.regFilter(
        "Mendelian_Auto_Dom",
        condition_high_quality() + clinVar_not_benign() + [
            condition_consequence_xBrowse(),
            ConditionMaker.condEnum("Transcript_biotype", ["protein_coding"]),
            ConditionMaker.condEnum("Transcript_source", ["Ensembl"]),
            ConditionMaker.condFunc("Inheritance_Mode", dict(),
                                    ["Autosomal Dominant"]),
            ConditionMaker.condEnum("Proband_Zygosity", ["Heterozygous"])
        ],
        requires={"trio_base", "WS"})

    base_pack.regFilter(
        "InSilico_Possibly_Damaging",
        condition_high_confidence() + [
            ConditionMaker.condEnum("Rules",
                                    [stdNm("Possibly_Damaging_Predictions")])
        ],
        requires={"WS"})

    base_pack.regFilter(
        "InSilico_Damaging",
        condition_high_confidence() +
        [ConditionMaker.condEnum("Rules", [stdNm("Damaging_Predictions")])],
        requires={"WS"})

    # SEQaBOO Filters, should belong to "Hearing Loss Solution Pack"
    # base_pack.regFilter("SEQaBOO_Hearing_Loss_v_01", [
    #     ConditionMaker.condEnum("Rules",
    #        [stdNm("SEQaBOO_Hearing_Loss_v_01")]),
    #     ConditionMaker.condEnum("Rules", [stdNm("ACMG59")], "NOT")],
    #     requires = {"WS"})
    # base_pack.regFilter("SEQaBOO_Hearing_Loss_v_02", [
    #     ConditionMaker.condEnum("Rules",
    #        [stdNm("SEQaBOO_Hearing_Loss_v_02")]),
    #     ConditionMaker.condEnum("Rules", [stdNm("ACMG59")], "NOT")],
    #     requires = {"WS"})
    # base_pack.regFilter("SEQaBOO_Hearing_Loss_v_03", [
    #     ConditionMaker.condEnum("Rules",
    #        [stdNm("SEQaBOO_Hearing_Loss_v_03")]),
    #     ConditionMaker.condEnum("Rules", [stdNm("ACMG59")], "NOT")],
    #     requires = {"WS"})
    # base_pack.regFilter("SEQaBOO_Hearing_Loss_v_03_5", [
    #     ConditionMaker.condEnum("Rules",
    #        [stdNm("SEQaBOO_Hearing_Loss_v_03")]),
    #     ConditionMaker.condEnum("Panels", ["All_Hearing_Loss"])],
    #     requires = {"WS"})
    # base_pack.regFilter("SEQaBOO_Hearing_Loss_v_4", [
    #     ConditionMaker.condEnum("Rules", [stdNm("Hearing Loss, v.4")])],
    #     requires = {"WS"})
    base_pack.regFilter(
        "SEQaBOO_Hearing_Loss_v_5",
        [ConditionMaker.condEnum("Rules", [stdNm("Hearing Loss, v.5")])],
        requires={"WS"})
    base_pack.regFilter(
        "SEQaBOO_Hearing_Quick",
        [ConditionMaker.condEnum("Rules", [stdNm("Hearing Loss Quick")])],
        requires={"WS"})

    # SEQaBOO Filters, should belong to "Base Solution Pack"
    base_pack.regFilter("SEQaBOO_ACMG59",
                        [ConditionMaker.condEnum("Rules", [stdNm("ACMG59")])],
                        requires={"WS"})
    # base_pack.regFilter("SEQaBOO_ACMG59", [
    #     ConditionMaker.condEnum("Rules", [stdNm("SEQaBOO_ACMG59")]),
    #     ConditionMaker.condEnum("Rules", [stdNm("ACMG59")], "AND")],
    #     requires = {"WS"})

    base_pack.regFilter(
        "Loss_Of_Function",
        condition_high_quality() +
        [ConditionMaker.condEnum("Most_Severe_Consequence", LoF_CSQ)])

    base_pack.regFilter(
        "Non_Synonymous",
        condition_high_quality() + [
            ConditionMaker.condEnum("Most_Severe_Consequence",
                                    NON_SYNONYMOUS_CSQ)
        ])

    base_pack.regFilter(
        "UTR_and_Worse",
        condition_high_quality() + [
            ConditionMaker.condEnum(
                "Most_Severe_Consequence", LOW_IMPACT_CSQ, join_mode="NOT")
        ])

    base_pack.regFilter("Impact_Splicing",
                        condition_high_confidence() + impacting_splicing())

    base_pack.regFilter(
        "ClinVar_VUS_or_Worse",
        condition_high_confidence() + [
            ConditionMaker.condEnum("Clinvar_stars", ["1", "2", "3", "4"]),
            ConditionMaker.condEnum("Clinvar_conflicts", ["True"],
                                    join_mode="NOT"),
            ConditionMaker.condEnum("Clinvar_Benign", ["VUS or Pathogenic"])
        ],
        requires={"XL"})

    base_pack.regFilter("In_Silico_Damaging",
                        condition_high_confidence() + [
                            ConditionMaker.condEnum("Polyphen_2_HVAR", ["D"]),
                            ConditionMaker.condEnum("SIFT", ["deleterious"])
                        ],
                        requires={"XL"})

    # base_pack.regFilter("Impact_Splicing",
    #     condition_high_quality() + impacting_splicing())

    # Production Decision Trees
    base_pack.regDTree("BGM Research",
                       cfgPathSeq(["bgm_xbrowse.pyt"]),
                       requires={"trio_base"})
    base_pack.regDTree("BGM Red Button",
                       cfgPathSeq(["bgm_strict.pyt"]),
                       requires={"trio_base"})
    base_pack.regDTree("Trio Candidates",
                       cfgPathSeq(["quality.pyt", "rare.pyt", "trio.pyt"]),
                       requires={"trio_base"})
    base_pack.regDTree(
        "All Rare Variants",
        cfgPathSeq(["quality.pyt", "rare.pyt", "return_true.pyt"]))
    # base_pack.regDTree("Hearing Loss, v.4",
    #    cfgPathSeq(["quality.pyt", "hearing_loss.pyt"]))
    base_pack.regDTree("Hearing Loss, v.5",
                       cfgPathSeq(["quality.pyt", "hearing_loss_v5.pyt"]))
    base_pack.regDTree("Hearing Loss Quick",
                       cfgPathSeq(["quality.pyt", "hearing_loss_ws.pyt"]),
                       requires={"WS"})
    base_pack.regDTree("ACMG59 Variants",
                       cfgPathSeq(["quality.pyt", "acmg59.pyt"]))
    base_pack.regDTree("Damaging_Predictions", cfgPathSeq(["damaging.pyt"]))
    base_pack.regDTree("Possibly_Damaging_Predictions",
                       cfgPathSeq(["possibly_damaging.pyt"]))

    # Test trees
    # base_pack.regDTree("Q Test",
    #     cfgPathSeq(["quality.pyt", "return_true.pyt"]))
    # base_pack.regDTree("R Test",
    #     cfgPathSeq(["rare.pyt", "return_true.pyt"]))
    # base_pack.regDTree("T Test",
    #     [cfgPath("trio.pyt")],
    #     requires = {"trio_base"})
    # base_pack.regDTree("H Test",
    #     [cfgPath("hearing_loss.pyt")])

    base_pack.regZone("Gene", "Symbol")
    base_pack.regZone("Gene List", "Panels")
    base_pack.regZone("Sample", "Has_Variant")
    base_pack.regZone("Cohort", "Variant_in", requires={"cohorts"})
    base_pack.regZone("Tag", "_tags")

    demo_tab_schema = ReportTabSchema("demo", use_tags=True)
    demo_tab_schema.addField("gene(s)", "/_view/general/genes[]")
    demo_tab_schema.addField("variant", "/__data/label")
    demo_tab_schema.addField("gnomAD_AF", "/_filters/gnomad_af_fam")
    base_pack.regTabSchema(demo_tab_schema)
예제 #4
0
def condition_consequence_xBrowse():
    return ConditionMaker.condEnum("Transcript_consequence",
                                   MODERATE_IMPACT_CSQ)
예제 #5
0
def clinVar_not_benign():
    return [
        ConditionMaker.condEnum("Clinvar_Trusted_Simplified", ["benign"],
                                "NOT")
    ]