Example #1
0
def addQuality(dtree):
    dtree.addComment("0.     Check sequencing quality")
    dtree.addCondition(ConditionMaker.condNum("Proband_GQ", [None, 19]),
                       decision=False)
    dtree.addCondition(ConditionMaker.condNum("FS", [31, None]),
                       decision=False)
    dtree.addCondition(ConditionMaker.condNum("QD", [None, 3]), decision=False)
Example #2
0
def defineBGMTree(cond_env):
    dtree = DecisionTree(cond_env)
    addQuality(dtree)

    dtree.addComment("Exclude common variants")
    dtree.addCondition(ConditionMaker.condNum("gnomAD_AF", [0.001, None]),
                       decision=False)

    dtree.addComment("Exclude low impact variants")
    dtree.addCondition(ConditionMaker.condNum("Severity", [None, 0]),
                       decision=False)

    dtree.setFinalDecision(True)

    return dtree
Example #3
0
    def __init__(self, xl_ds, descr):
        XL_Unit.__init__(self, xl_ds, descr)
        if descr.get("family") and self.getDS().getFamilyInfo() is None:
            self.getDS()._setFamilyInfo(descr["family"])

        self.mIsOK = (self.getDS().getFamilyInfo() is not None
                      and len(self.getDS().getFamilyInfo()) > 1)
        self.mLabels = AnfisaConfig.configOption("zygosity.cases")
        self.mConfig = descr.get("config", dict())
        self.mXCondition = XL_Condition.parse(
            self.mConfig.get("x_cond",
                             ConditionMaker.condEnum("Chromosome", ["chrX"])))
Example #4
0
 def setup(self):
     self.mXCondition = self.getDS().getCondEnv().parse(
         self.mConfig.get("x_cond",
         ConditionMaker.condEnum("Chromosome", ["chrX"])))
Example #5
0
def defineFilterSchema():
    filters = FilterPrepareSetH()

    with filters.viewGroup("Inheritance"):
        filters.zygositySpecialUnit(
            "Custom",
            "/data/zygosity",
            config={"x_cond": ConditionMaker.condEnum("Chromosome", ["chrX"])})
        filters.presenceUnit("Compound_heterozygous",
                             [("True", "/_filters/nowhere")])
        filters.multiStatusUnit("Callers",
                                "/view/bioinformatics/called_by[]",
                                title="Called by",
                                research_only=False)
        filters.multiStatusUnit("Has_Variant", "/_filters/has_variant[]")

    with filters.viewGroup("Variant"):
        filters.statusUnit("Variant_Class", "/data/variant_class")
        filters.statusUnit(
            "Most_Severe_Consequence",
            "/data/most_severe_consequence",
            variants=[
                "transcript_ablation", "splice_acceptor_variant",
                "splice_donor_variant", "stop_gained", "frameshift_variant",
                "stop_lost", "start_lost", "transcript_amplification",
                "inframe_insertion", "inframe_deletion", "missense_variant",
                "protein_altering_variant",
                "incomplete_terminal_codon_variant", "stop_retained_variant",
                "synonymous_variant", "splice_region_variant",
                "coding_sequence_variant", "mature_miRNA_variant",
                "5_prime_UTR_variant", "3_prime_UTR_variant",
                "non_coding_transcript_exon_variant", "intron_variant",
                "NMD_transcript_variant", "non_coding_transcript_variant",
                "upstream_gene_variant", "downstream_gene_variant",
                "TFBS_ablation", "TFBS_amplification",
                "TF_binding_site_variant", "regulatory_region_ablation",
                "regulatory_region_amplification", "feature_elongation",
                "regulatory_region_variant", "feature_truncation",
                "intergenic_variant", "undefined"
            ],
            default_value="undefined")

    filters.multiStatusUnit("Genes",
                            "/view/general/genes[]",
                            compact_mode=True)

    with filters.viewGroup("Coordinates"):
        filters.statusUnit("Chromosome",
                           "/_filters/chromosome",
                           variants=[
                               "chr1", "chr2", "chr3", "chr4", "chr5", "chr6",
                               "chr7", "chr8", "chr9", "chr10", "chr11",
                               "chr12", "chr13", "chr14", "chr15", "chr16",
                               "chr17", "chr18", "chr19", "chr20", "chr21",
                               "chr22", "chr23", "chrX", "chrY", "undefined"
                           ],
                           research_only=False,
                           default_value="undefined")

        filters.intValueUnit("Start_Pos",
                             "/data/start",
                             title="Start Position",
                             research_only=False,
                             render_mode="neighborhood",
                             default_value=sys.maxint)
        filters.intValueUnit("End_Pos",
                             "/data/end",
                             title="End Position",
                             research_only=False,
                             default_value=0,
                             render_mode="neighborhood")
        filters.intValueUnit(
            "Dist_from_Exon",
            "/_filters/dist_from_exon",
            title="Distance From Intron/Exon Boundary (Canonical)",
            research_only=False,
            default_value=0,
            render_mode="log,<")
        filters.statusUnit("Region",
                           "/data/region_canonical",
                           title="Region (Canonical)",
                           research_only=False,
                           default_value="Other")

    with filters.viewGroup("gnomAD"):
        filters.floatValueUnit("gnomAD_AF",
                               "/_filters/gnomad_af_fam",
                               diap=(0., 1.),
                               default_value=0.,
                               title="gnomAD Allele Frequency (family)",
                               render_mode="log,<")
        filters.floatValueUnit("gnomAD_AF_Exomes",
                               "/_filters/gnomad_db_exomes_af",
                               diap=(0., 1.),
                               default_value=0.,
                               title="gnomAD Exome Allele Frequency (family)",
                               render_mode="log,<")
        filters.floatValueUnit("gnomAD_AF_Genomes",
                               "/_filters/gnomad_db_genomes_af",
                               diap=(0., 1.),
                               default_value=0.,
                               title="gnomAD Genome Allele Frequency (family)",
                               render_mode="log,<")
        filters.floatValueUnit("gnomAD_AF_Proband",
                               "/_filters/gnomad_af_pb",
                               diap=(0., 1.),
                               default_value=0.,
                               title="gnomAD Allele Frequency (proband)",
                               render_mode="log,<")
        filters.floatValueUnit("gnomAD_PopMax_AF",
                               "/_filters/gnomad_popmax_af",
                               diap=(0., 1.),
                               default_value=0.,
                               title="gnomAD PopMax Allele Frequency",
                               render_mode="log,<")
        filters.statusUnit("gnomAD_PopMax",
                           "/_filters/gnomad_popmax",
                           default_value="None",
                           title="gnomAD PopMax Ancestry")
        filters.intValueUnit(
            "gnomAD_PopMax_AN",
            "/_filters/gnomad_popmax_an",
            default_value=0,
            title="gnomAD: Number of alleles in PopMax Ancestry",
            render_mode="log,>")
        filters.intValueUnit("gnomAD_Hom",
                             "/_filters/gnomad_hom",
                             default_value=0,
                             title="gnomAD: Number of homozygous",
                             render_mode="log,>")
        filters.intValueUnit("gnomAD_Hem",
                             "/_filters/gnomad_hem",
                             default_value=0,
                             title="gnomAD: Number of hemizygous",
                             render_mode="log,>")

    with filters.viewGroup("Databases"):
        filters.presenceUnit(
            "Presence_in_Databases",
            [("ClinVar", "/view/databases/clinVar"),
             ("LMM", "/view/databases/lmm_significance"),
             ("GeneDx", "/view/databases/gene_dx_significance"),
             ("GnomAD", "/_filters/gnomad_af_fam"),
             ("HGMD", "/view/databases/hgmd_pmids[]"),
             ("OMIM", "/view/databases/omim")],
            title="Presence in Databases")

        filters.multiStatusUnit("ClinVar_Submitters",
                                "/view/databases/clinVar_submitters[]",
                                title="ClinVar Submitters",
                                compact_mode=True)

        # filters.multiStatusUnit("beacons",
        #     "/data/beacon_names",
        #     title = "Observed at")

    with filters.viewGroup("Call_Quality"):
        filters.floatValueUnit("Proband_GQ",
                               "/_filters/proband_gq",
                               title="Genotype Quality (GQ) for Proband",
                               render_mode="linear,>",
                               default_value=float('inf'))
        filters.floatValueUnit("Min_GQ",
                               "/_filters/min_gq",
                               title="Minimum GQ for the family)",
                               render_mode="linear,>",
                               default_value=float('inf'))
        filters.floatValueUnit("QD",
                               "/_filters/qd",
                               title="Quality by Depth",
                               render_mode="linear,>",
                               default_value=float('inf'))
        filters.floatValueUnit("FS",
                               "/_filters/fs",
                               "Fisher Strand Bias",
                               render_mode="linear,<",
                               default_value=0.)
        filters.multiStatusUnit("FT", "/_filters/filters[]", title="FILTER")

    with filters.viewGroup("Predictions"):
        filters.statusUnit(
            "Clinvar_Benign",
            "/_filters/clinvar_benign",
            default_value="Not in ClinVar",
            title="Categorized Benign in ClinVar by all submitters")
        filters.statusUnit(
            "Clinvar_Trusted_Benign",
            "/_filters/clinvar_trusted_benign",
            default_value="No data",
            title="Categorized Benign by Clinvar Trusted Submitters")
        filters.statusUnit("HGMD_Benign",
                           "/_filters/hgmd_benign",
                           title="Categorized Benign in HGMD",
                           default_value="Not in HGMD")

        filters.multiStatusUnit("HGMD_Tags",
                                "/view/databases/hgmd_tags[]",
                                default_value="None")
        filters.multiStatusUnit("ClinVar_Significance",
                                "/data/clinvar_significance[]",
                                title="Clinical Significance in CLinVar")
        filters.multiStatusUnit("LMM_Significance",
                                "/data/lmm",
                                title="Clinical Significance by LMM")
        filters.multiStatusUnit("GeneDx_Significance",
                                "/data/gene_dx",
                                title="Clinical Significance by GeneDx")

        filters.multiStatusUnit("Polyphen", "/view/predictions/polyphen[]")
        filters.multiStatusUnit("SIFT", "/view/predictions/sift[]")

        filters.multiStatusUnit("Polyphen_2_HVAR",
                                "/view/predictions/polyphen2_hvar[]",
                                separators="[\s\,]",
                                default_value="undef")
        filters.multiStatusUnit("Polyphen_2_HDIV",
                                "/view/predictions/polyphen2_hdiv[]",
                                separators="[\s\,]",
                                default_value="undef")

    with filters.viewGroup("Debug_Info"):
        filters.intValueUnit("Severity",
                             "/_filters/severity",
                             research_only=True,
                             default_value=-1)

    return filters
Example #6
0
def defineDefaultDecisionTree():
    dtree = DecisionTree()

    dtree.addComment("0.     Quality check")
    dtree.addCondition(ConditionMaker.condNum("Proband_GQ", [None, 19]),
                       decision=False)
    dtree.addCondition(ConditionMaker.condNum("FS", [31, None]),
                       decision=False)
    dtree.addCondition(ConditionMaker.condNum("QD", [None, 3]), decision=False)

    dtree.addComment('1.	    Present in HGMD as "DM"')
    dtree.addCondition(ConditionMaker.condEnum("HGMD_Tags", ["DM"]),
                       decision=True)

    dtree.addComment(
        '2.	    AF < 5% AND +/- bases from intronic/exonic border')
    dtree.addCondition(ConditionMaker.condNum("gnomAD_AF", [0.05, None]),
                       decision=False)
    dtree.addCondition([
        "and",
        ConditionMaker.condNum("Dist_from_Exon", [6, None]),
        ConditionMaker.condEnum("Region", ["exon"], "NOT")
    ],
                       decision=False)

    dtree.addComment(
        '2.a.	Present in ClinVar Path, Likely Path, VUS (worst annotation).')
    dtree.addCondition([
        "and",
        ConditionMaker.condEnum("Clinvar_Benign", ["True"]),
        ConditionMaker.condEnum("Clinvar_Trusted_Benign", ["False", "No data"])
    ],
                       decision=True)

    dtree.addComment('2.b.	All de novo variants')
    dtree.addCondition(ConditionMaker.condEnum("Callers",
                                               ["BGM_BAYES_DE_NOVO"]),
                       decision=True)

    dtree.addComment('2.c.	All potential LOF variants '
                     '(stop-codon, frameshift, canonical splice site).')

    dtree.addCondition(ConditionMaker.condNum("Severity", [3, None]),
                       decision=True)

    dtree.addComment('3.a.	annotated as "Missense", "synonymous" '
                     'and "splice region" variants')
    dtree.addCondition(ConditionMaker.condNum("Severity", [None, 0]),
                       decision=False)

    dtree.addComment('3.	AF < 0.0007 (GnomAD Overall) AND +/- 5 bases')
    dtree.addComment(
        'PopMax < 0.01 (minimum 2000 alleles total in ancestral group)')
    dtree.addCondition([
        "and",
        ConditionMaker.condNum("gnomAD_AF", [None, 0.0007]),
        ConditionMaker.condNum("gnomAD_PopMax_AN", [2001, None]),
        ConditionMaker.condNum("gnomAD_PopMax_AF", [None, 0.01])
    ],
                       decision=True)
    dtree.setFinalDecision(False)

    return dtree
Example #7
0
def defineHearingLossTree(cond_env):
    dtree = DecisionTree(cond_env)

    addQuality(dtree)

    dtree.addComment('1.	    Include if present in HGMD as "DM"')
    dtree.addCondition(ConditionMaker.condEnum("HGMD_Tags", ["DM"]),
                       decision=True)

    dtree.addComment(
        '2.	    Exclude unless AF < 5% AND +/- bases from intronic/exonic border'
    )
    dtree.addCondition(ConditionMaker.condNum("gnomAD_AF", [0.05, None]),
                       decision=False)
    dtree.addCondition([
        "and",
        ConditionMaker.condNum("Dist_from_Exon", [6, None]),
        ConditionMaker.condEnum("Region", ["exon"], "NOT")
    ],
                       decision=False)

    dtree.addComment(
        '2.a.	Include if present in ClinVar Path, Likely Path, VUS (worst annotation), unless annotated benign by trusted submitter'
    )
    dtree.addCondition([
        "and",
        ConditionMaker.condEnum("Clinvar_Benign", ["True"]),
        ConditionMaker.condEnum("Clinvar_Trusted_Benign", ["False", "No data"])
    ],
                       decision=True)

    dtree.addComment('2.b.	Include all de-novo variants')
    dtree.addCondition(ConditionMaker.condEnum("Callers",
                                               ["BGM_BAYES_DE_NOVO"]),
                       decision=True)

    dtree.addComment('2.c.	Include all potential LOF variants '
                     '(stop-codon, frameshift, canonical splice site).')

    dtree.addCondition(ConditionMaker.condNum("Severity", [3, None]),
                       decision=True)

    dtree.addComment('3.a.	For the rest: exclude "Missense", "synonymous" '
                     'and "splice region" variants')
    dtree.addCondition(ConditionMaker.condNum("Severity", [None, 0]),
                       decision=False)

    dtree.addComment(
        '3.	Include: AF < 0.0007 (GnomAD Overall) AND +/- 5 bases')
    dtree.addComment(
        'And: PopMax < 0.01 (minimum 2000 alleles total in ancestral group)')
    dtree.addCondition([
        "and",
        ConditionMaker.condNum("gnomAD_AF", [None, 0.0007]),
        ConditionMaker.condNum("gnomAD_PopMax_AN", [2001, None]),
        ConditionMaker.condNum("gnomAD_PopMax_AF", [None, 0.01])
    ],
                       decision=True)
    dtree.setFinalDecision(False)

    return dtree