def test_cellmesh_query_species(self): print('mouse_results') genes = ['HLA-DRB5', 'HLA-DQA1', 'HCG24', 'ARHGEF1', 'HLA-DPB1', 'SCN4A', 'TEAD2', 'HLA-DRB1', 'LST1', 'HLA-DQB1', 'AIM1L'] results = cellmesh.hypergeometric_test(genes, species='mouse') print(results[0]) genes = ['MYH11', 'CNN1', 'ACTA2', 'MYL9', 'OPTC'] results = cellmesh.hypergeometric_test(genes, species='mouse') print(results[0]) self.assertEqual(results[0][1], 'Myocytes, Smooth Muscle') results = cellmesh.hypergeometric_test(genes, species='both') print(results[0]) self.assertEqual(results[0][1], 'Myocytes, Smooth Muscle')
def test_cellmesh_query_basic(self): genes = ['HLA-DRB5', 'HLA-DQA1', 'HCG24', 'ARHGEF1', 'HLA-DPB1', 'SCN4A', 'TEAD2', 'HLA-DRB1', 'LST1', 'HLA-DQB1', 'AIM1L'] results = cellmesh.hypergeometric_test(genes) print(results[0]) self.assertEqual(results[0][1], 'Dendritic Cells') genes = ['MYH11', 'CNN1', 'ACTA2', 'MYL9', 'OPTC'] results = cellmesh.hypergeometric_test(genes) print(results[0]) self.assertEqual(results[0][1], 'Myocytes, Smooth Muscle')
def test_anatomy_query(self): genes = ['Tnnt2', 'Ifit1', 'Ifit3', 'Ifit3b', 'Rsad2', 'Psd', 'Tbx20', 'Gata4', 'Iigp1', 'Lum', 'Cd34', 'Corin', 'Pgam2', 'Dcn'] results = cellmesh.hypergeometric_test(genes, db_dir=cellmesh.ANATOMY_DB_DIR) print(results[0])
if query_method == 'cellmarker': results = cellmarker.hypergeometric_test( top_genes, species=species) top_cells = [x[0] for x in results] elif query_method == 'cellmarker_prob': results = cellmarker_prob_method.prob_test( top_genes, species=species) top_cells = [x[0] for x in results] elif query_method == 'panglao': results = cellmarker.hypergeometric_test( top_genes, species=species, db_dir=cellmarker.PANGLAO_DB_DIR) top_cells = [x[0] for x in results] elif query_method == 'cellmesh': results = cellmesh.hypergeometric_test(top_genes, species=species) top_cells = [x[1] for x in results] elif query_method == 'cellmesh_tfidf': results = cellmesh.normed_hypergeometric_test( top_genes, species=species) top_cells = [x[1] for x in results] elif query_method == 'aggregate': results = query_aggregation.cellmarker_cellmesh_hypergeometric_test( top_genes) top_cells = [x[1] for x in results[1:]] results = results[1:] elif query_method == 'aggregate_2': results = query_aggregation.cellmarker_cellmesh_tfidf_hypergeometric_test( top_genes) top_cells = [x[1] for x in results[1:]] results = results[1:]