def cancers(site_type): result = pan_cancer_analysis(site_type) counts = counts_by('cancer_type', result['all_active_mutations']) cancer_by_code = {cancer.code: cancer.name for cancer in Cancer.query} return (counts.keys(), counts.values(), [ f'{cancer_by_code[cancer_type]}: {count} mutations' for cancer_type, count in counts.items() ])
def cancers_ontology(site_type, significant=True, vector=False): result = pan_cancer_analysis(site_type) cancer_by_code = {cancer.code: cancer.name for cancer in Cancer.query} mutations = cancer_mutations(result, significant=significant) terms = counts_by('cancer_name', mutations) return ontology_plots(terms, 'cancers', vector, [0, 70, 75, 80, 85, 90, 95], allow_misses=False, limit_to=['diseases', 'mondo'])
def merged_cancer_mutations(site_type): all_cancer_mutations = [cancer_mutations(pan_cancer_analysis(site_type))] ad_per_cancer = per_cancer_analysis(site_type) for cancer_type, result in ad_per_cancer.items(): mutations = cancer_mutations(result, cancer_type=cancer_type) all_cancer_mutations.append(mutations)
def pan_cancer_active_driver_with_bg(site_type): result = pan_cancer_analysis(site_type.name) return active_driver_gene_ontology(result['profile_against_genes_with_sites'])
def pan_cancer_active_driver(site_type): result = pan_cancer_analysis(site_type.name) return active_driver_gene_ontology(result['profile'])