def overridden_mock_result_list( result_list_name="overridden_mock_result_list", association=GeneToDiseaseAssociation.class_name, domain=ConceptSpace( category=Disease.class_name, id_prefixes=['MONDO'] ), relationship='related_to', range=ConceptSpace( category=Gene.class_name, id_prefixes=['HGNC'] ) ): rl = ResultList( result_list_name=result_list_name, source='ncats', association=association, domain=domain, relationship=relationship, range=range ) rl.attributes.append(_a) rl.concepts.append(mock_concept()) rl.concepts.append(mock_concept(identifier=mock_identifier_2())) rl.results.append(_r) return rl
def __init__(self, input_genes): super( GeneToGeneDepMapBiclusters, self ).__init__(module=BiclusterByGene( bicluster_url= 'https://smartbag-crispridepmap.ncats.io/biclusters_DepMap_gene_to_cellline_v1_gene/', bicluster_bicluster_url= 'https://smartbag-crispridepmap.ncats.io/biclusters_DepMap_gene_to_cellline_v1_bicluster/', target_prefix=''), metadata=ModuleMetaData( name="Mod9B - Gene-to-Gene Bicluster", source='DepMap Biclustering', association=GeneToGeneAssociation, domain=ConceptSpace(Gene, ['NCBI']), relationship='related_to', range=ConceptSpace(Gene, ['NCBI']))) input_gene_set = self.get_simple_input_identifier_list(input_genes) asyncio.run(self.module.gene_to_gene_biclusters_async(input_gene_set)) sorted_list_of_output_genes = self.module.gene_to_gene_bicluster_summarize( input_gene_set) self.results = pd.DataFrame.from_records(sorted_list_of_output_genes)
def __init__(self, input_genes): super( GeneToGeneBiclusters, self ).__init__(module=BiclusterByGene( bicluster_url= 'https://bicluster.renci.org/RNAseqDB_bicluster_gene_to_tissue_v3_gene/', bicluster_bicluster_url= 'https://bicluster.renci.org/RNAseqDB_bicluster_gene_to_tissue_v3_bicluster/', target_prefix='NCBI'), metadata=ModuleMetaData( name="Mod9B - Gene-to-Gene Bicluster", source='RNAseqDB Biclustering', association=GeneToGeneAssociation, domain=ConceptSpace(Gene, ['ENSEMBL']), relationship='related_to', range=ConceptSpace(Gene, ['ENSEMBL']), )) input_gene_set = self.get_simple_input_identifier_list(input_genes) asyncio.run(self.module.gene_to_gene_biclusters_async(input_gene_set)) sorted_list_of_output_genes = self.module.gene_to_gene_bicluster_summarize( input_gene_set) self.results = pd.DataFrame.from_records(sorted_list_of_output_genes)
def __init__(self, input_genes, action='InteractionActions', rows=50): super(ChemicalGeneInteractionSet, self).__init__(module=ChemicalGeneInteractions(), metadata=ModuleMetaData( name="Module 1B: Chemical Gene Interaction", source='Chemical Toxicology Database (CTD)', association=ChemicalToGeneAssociation, domain=ConceptSpace(Gene, ['HGNC']), relationship='interacts_with', range=ConceptSpace(ChemicalSubstance, ['ChemicalID']))) input_gene_set = self.get_input_data_frame(input_genes) self.results = self.module.get_gene_chemical_interactions( input_gene_set, action, rows)
def __init__(self, input_genes, threshold): super(FunctionallySimilarGenes, self).__init__(module=FunctionalSimilarity('human'), metadata=ModuleMetaData( name="Mod1A Functional Similarity", source='Monarch Biolink', association=FunctionalAssociation, domain=ConceptSpace(Gene, ['HGNC']), relationship='related_to', range=ConceptSpace(Gene, ['HGNC']), )) input_gene_data_frame = self.get_input_data_frame(input_genes) self.results = self.module.compute_similarity(input_gene_data_frame, threshold)
def __init__(self, input_genes, threshold): super(PhenotypicallySimilarGenes, self).__init__( module=PhenotypeSimilarity('human'), metadata=ModuleMetaData( name="Mod1B1 Phenotype Similarity", source='Monarch Biolink', association=GeneToPhenotypicFeatureAssociation, domain=ConceptSpace(Gene, ['HGNC']), relationship='has_phenotype', range=ConceptSpace(Gene, ['HGNC']), ) ) input_gene_data_frame = self.get_input_data_frame(input_genes) self.results = self.module.compute_similarity(input_gene_data_frame, threshold)
def __init__(self, input_genes, threshold=0): super(GeneInteractionSet, self).__init__(module=GeneInteractions(), metadata=ModuleMetaData( name="Module 1E - Gene Interaction", source='Monarch Biolink', association=GeneToGeneAssociation, domain=ConceptSpace(Gene, ['HGNC']), relationship='interacts_with', range=ConceptSpace(Gene, ['HGNC']), )) input_gene_data_frame = self.get_input_data_frame(input_genes) # TODO: add schema check self.results = self.module.get_interactions(input_gene_data_frame, threshold)
def __init__(self, input_genes): super(GeneToTissueBiclusters, self).__init__( module=BiclusterByGeneToTissue(), metadata=ModuleMetaData( name="Mod9A - Gene-to-Tissue Bicluster", source='RNAseqDB Biclustering', association=GeneToExpressionSiteAssociation, domain=ConceptSpace(Gene, ['ENSEMBL']), relationship='related_to', range=ConceptSpace(AnatomicalEntity, ['MONDO', 'DOID', 'UBERON']), )) input_gene_set = self.get_simple_input_identifier_list(input_genes) most_common_tissues = asyncio.run( self.module.gene_to_tissue_biclusters_async(input_gene_set)) self.results = pd.DataFrame.from_records(most_common_tissues)
def __init__(self, input_tissues): super(TissueToTissueBicluster, self).__init__( module=BiclusterByTissueToTissue(), metadata=ModuleMetaData( name="Mod9A - Tissue-to-Tissue Bicluster", source='RNAseqDB Biclustering', association=AnatomicalEntityToAnatomicalEntityAssociation, domain=ConceptSpace(AnatomicalEntity, ['UBERON']), relationship='related_to', range=ConceptSpace(AnatomicalEntity, ['UBERON']), )) input_tissue_ids = self.get_simple_input_identifier_list(input_tissues) most_common_tissues = asyncio.run( self.module.tissue_to_tissue_biclusters_async(input_tissue_ids)) self.results = pd.DataFrame.from_records(most_common_tissues, columns=["hit_id", "score"])
def __init__(self, input_phenotypes): super(PhenotypeToDiseaseBiclusters, self).__init__( module=BiclusterByPhenotypeToDisease(), metadata=ModuleMetaData( name="Mod9A - Phenotype-to-Disease Bicluster", source='RNAseqDB Biclustering', association=DiseaseToPhenotypicFeatureAssociation, domain=ConceptSpace(PhenotypicFeature, ['HP']), relationship='has_phenotype', range=ConceptSpace(Disease, ['MONDO']))) input_phenotype_ids: List[str] = self.get_simple_input_identifier_list( input_phenotypes) most_common_diseases = asyncio.run( self.module.phenotype_to_disease_biclusters_async( input_phenotype_ids)) self.results = pd.DataFrame.from_records(most_common_diseases, columns=["hit_id", "score"])
def __init__(self, disease_id, disease_name='', query_biolink=True): super(DiseaseAssociatedGeneSet, self).__init__(module=LookUp(), metadata=ModuleMetaData( name="Mod2.0 - Disease Associated Genes", source='Monarch Biolink', association=GeneToDiseaseAssociation, domain=ConceptSpace(Disease, ['MONDO']), relationship='gene_associated_with_condition', range=ConceptSpace(Gene, ['HGNC']), )) # get genes associated with disease from Biolink self.results = self.module.disease_geneset_lookup( disease_id, disease_name, query_biolink) if not self.results.empty: self.disease_associated_genes = self.results[[ 'hit_id', 'hit_symbol' ]].to_dict(orient='records') else: self.disease_associated_genes = []
source='ncats', association=association, domain=domain, relationship=relationship, range=range) rl.attributes.append(_a) rl.concepts.append(mock_concept()) rl.concepts.append(mock_concept(identifier=mock_identifier_2())) rl.results.append(_r) return rl _json_test_file = "result_list_test.json" _mock_uberon_concept_space = ConceptSpace(category=Disease, id_prefixes=['UBERON']) _mock_upheno_concept_space = ConceptSpace(category=PhenotypicFeature, id_prefixes=['UPHENO']) _mock_hgnc_concept_space = ConceptSpace(category=Gene, id_prefixes=['HGNC']) _mock_mondo_concept_space = ConceptSpace(category=Disease, id_prefixes=['MONDO']) class TestResultList(TestCase): def test_default_result_list_to_json(self): rl = default_mock_result_list() print("\n\nDefault ResultList JSON output: \n", rl.to_json())
def mock_concept_space(): cs = ConceptSpace(category=mock_concept_space_category, id_prefixes=[mock_concept_space_id_prefixes]) return cs