scout/utils/acmg.py
def get_acmg(acmg_terms):
    """Use the algorithm described in ACMG paper to get a ACMG calssification

    Args:
        acmg_terms(set(str)): A collection of prediction terms

    Returns:
        prediction(int):
                0 - Uncertain Significanse
                1 - Benign
                2 - Likely Benign
                3 - Likely Pathogenic
                4 - Pathogenic
    """
    prediction = 'uncertain_significance'
    # This variable indicates if Pathogenecity Very Strong exists
    pvs = False
    # Collection of terms with Pathogenecity Strong
    ps_terms = []
    # Collection of terms with Pathogenecity moderate
    pm_terms = []
    # Collection of terms with Pathogenecity supporting
    pp_terms = []
    # This variable indicates if Benign impact stand-alone exists
    ba = False
    # Collection of terms with Benign evidence Strong
    bs_terms = []
    # Collection of terms with supporting Benign evidence
    bp_terms = []
    for term in acmg_terms:
        if term.startswith('PVS'):
            pvs = True
        elif term.startswith('PS'):
            ps_terms.append(term)
        elif term.startswith('PM'):
            pm_terms.append(term)
        elif term.startswith('PP'):
            pp_terms.append(term)
        elif term.startswith('BA'):
            ba = True
        elif term.startswith('BS'):
            bs_terms.append(term)
        elif term.startswith('BP'):
            bp_terms.append(term)

    # We need to start by checking for Pathogenecity
    pathogenic = is_pathogenic(pvs, ps_terms, pm_terms, pp_terms)
    likely_pathogenic = is_likely_pathogenic(pvs, ps_terms, pm_terms, pp_terms)
    benign = is_benign(ba, bs_terms)
    likely_benign = is_likely_benign(bs_terms, bp_terms)

    if (pathogenic or likely_pathogenic):
        if (benign or likely_benign):
            prediction = 'uncertain_significance'
        elif pathogenic:
            prediction = 'pathogenic'
        else:
            prediction = 'likely_pathogenic'
    else:
        if benign:
            prediction = 'benign'
        if likely_benign:
            prediction = 'likely_benign'

    return prediction
def get_acmg(acmg_terms):
    """Use the algorithm described in ACMG paper to get a ACMG calssification

    Args:
        acmg_terms(set(str)): A collection of prediction terms

    Returns:
        prediction(int):
                0 - Uncertain Significanse
                1 - Benign
                2 - Likely Benign
                3 - Likely Pathogenic
                4 - Pathogenic
    """
    prediction = 'uncertain_significance'
    # This variable indicates if Pathogenecity Very Strong exists
    pvs = False
    # Collection of terms with Pathogenecity Strong
    ps_terms = []
    # Collection of terms with Pathogenecity moderate
    pm_terms = []
    # Collection of terms with Pathogenecity supporting
    pp_terms = []
    # This variable indicates if Benign impact stand-alone exists
    ba = False
    # Collection of terms with Benign evidence Strong
    bs_terms = []
    # Collection of terms with supporting Benign evidence
    bp_terms = []
    for term in acmg_terms:
        if term.startswith('PVS'):
            pvs = True
        elif term.startswith('PS'):
            ps_terms.append(term)
        elif term.startswith('PM'):
            pm_terms.append(term)
        elif term.startswith('PP'):
            pp_terms.append(term)
        elif term.startswith('BA'):
            ba = True
        elif term.startswith('BS'):
            bs_terms.append(term)
        elif term.startswith('BP'):
            bp_terms.append(term)

    # We need to start by checking for Pathogenecity
    pathogenic = is_pathogenic(pvs, ps_terms, pm_terms, pp_terms)
    likely_pathogenic = is_likely_pathogenic(pvs, ps_terms, pm_terms, pp_terms)
    benign = is_benign(ba, bs_terms)
    likely_benign = is_likely_benign(bs_terms, bp_terms)

    if (pathogenic or likely_pathogenic):
        if (benign or likely_benign):
            prediction = 'uncertain_significance'
        elif pathogenic:
            prediction = 'pathogenic'
        else:
            prediction = 'likely_pathogenic'
    else:
        if benign:
            prediction = 'benign'
        if likely_benign:
            prediction = 'likely_benign'

    return prediction
Use the algorithm described in ACMG paper to get a ACMG calssification

    Args:
        acmg_terms(set(str)): A collection of prediction terms

    Returns:
        prediction(int):
                0 - Uncertain Significanse
                1 - Benign
                2 - Likely Benign
                3 - Likely Pathogenic
                4 - Pathogenic