Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Score a variant object according to Henriks score model. Input: A variant object and a list of genetic models.

        def score_variant(variants, prefered_models = []):
    """Score a variant object according to Henriks score model. Input: A variant object and a list of genetic models."""
    
    if  prefered_models == ['NA']:
        prefered_models = []
    
    for variant_id in variants:
        variant = variants[variant_id]
        score = 0
        # Models of inheritance
        variant_models = get_genetic_models(variant.get('Inheritance_model', {}))
        
        # Predictors
        mutation_taster = variant.get('Mutation_taster', None)
        avsift = variant.get('SIFT', None)
        
        if 'Poly_phen_hdiv' in variant:
            poly_phen = variant.get('Poly_phen_hdiv', None)
        else:
            poly_phen = variant.get('Poly_phen', None)
        
        # Annotations:
        functional_annotation = variant.get('Functional_annotation', None)
        if functional_annotation:
            try:
                functional_annotation = {gene_info.split(':')[0]:gene_info.split(':')[1] for gene_info in functional_annotation.split(',')}
            except IndexError:
                functional_annotation = None
        
        # Frequency in databases:
        thousand_genomes_frequency = variant.get('1000G', None)
        dbsnp_frequency = variant.get('Dbsnp129', None)
        dbsnp_id = variant.get('Dbsnp_nonflagged', None)
        hbvdb = variant.get('HBVDB', None)
        
        # Filter
        
        filt = variant.get('GT_call_filter', None)
        
        # Conservation scores:
            # Base
        gerp_base = variant.get('GERP', None)
            # Region
        mce64way = variant.get('Phast_cons_lements', None)
        gerp_region = variant.get('GERP_elements', None)
            
            
        phylop = variant.get('Phylo_p', None)
        
        segdup = variant.get('Genomic_super_dups', None)
        
        hgmd = variant.get('HGMD', None)
        
        
        
        score += check_inheritance(variant_models, prefered_models)
        score += check_predictions(mutation_taster, avsift, poly_phen)
        score += check_functional_annotation(functional_annotation)
        score += check_frequency_score(thousand_genomes_frequency, dbsnp_frequency, hbvdb, dbsnp_id)
        score += check_filter(filt)
        score += check_region_conservation(mce64way, gerp_region)
        score += check_base_conservation(gerp_base)
        score += check_phylop_score(phylop)
        score += check_segmental_duplication(segdup)
        score += check_hgmd(hgmd)
        variant['Individual_rank_score'] = score
        
    return
        


src/m/i/mip_family_analysis-0.9.3/Mip_Family_Analysis/Utils/variant_consumer.py   mip_family_analysis(Download)
            genetic_models.check_genetic_models(next_batch, self.family, self.verbosity, proc_name = proc_name)
            fixed_variants = self.fix_variants(next_batch)
            score_variants.score_variant(fixed_variants, self.family.models_of_inheritance)
            self.make_print_version(fixed_variants)