diff --git a/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDao.java b/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDao.java index d9c4f5646..e02cc7af3 100644 --- a/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDao.java +++ b/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDao.java @@ -101,7 +101,7 @@ public List getDiseaseDataAssociatedWithGeneId(int geneId) { "FROM entrez2sym e, disease_hp dhp, disease d " + "WHERE dhp.disease_id = d.DISEASE_ID " + "AND e.entrezid = d.GENE_ID " + - "AND d.TYPE in ('D', 'C')" + + "AND d.TYPE in ('D', 'C', '?')" + "AND d.GENE_ID = ?"; try (Connection connection = dataSource.getConnection()) { diff --git a/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/service/ModelServiceImpl.java b/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/service/ModelServiceImpl.java index d150f91ad..c613ea39a 100644 --- a/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/service/ModelServiceImpl.java +++ b/exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/prioritisers/service/ModelServiceImpl.java @@ -1,7 +1,7 @@ /* * The Exomiser - A tool to annotate and prioritize genomic variants * - * Copyright (c) 2016-2017 Queen Mary University of London. + * Copyright (c) 2016-2019 Queen Mary University of London. * Copyright (c) 2012-2016 Charité Universitätsmedizin Berlin and Genome Research Ltd. * * This program is free software: you can redistribute it and/or modify @@ -62,7 +62,7 @@ public ModelServiceImpl(DataSource phenotypeDataSource) { public List getHumanGeneDiseaseModels() { // We only connect to human2mouse_orthologs to get the human_gene_symbol but if there is no orthology mapping we get 0 results and no disease hit at all - this is daft! // Tried to replace with the below - should be more successful - String modelQuery = "SELECT distinct 'HUMAN' as organism, gene_id as entrez_id, symbol as human_gene_symbol, d.disease_id as disease_id, d.diseasename as disease_term, hp_id as pheno_ids FROM entrez2sym e, disease_hp M, disease d WHERE e.entrezid=d.gene_id and M.disease_id=d.disease_id"; + String modelQuery = "SELECT distinct 'HUMAN' as organism, gene_id as entrez_id, symbol as human_gene_symbol, d.disease_id as disease_id, d.diseasename as disease_term, hp_id as pheno_ids FROM entrez2sym e, disease_hp M, disease d WHERE e.entrezid=d.gene_id and M.disease_id=d.disease_id AND d.TYPE in ('D', 'C', '?')"; //String modelQuery = "SELECT 'HUMAN' as organism, gene_id as entrez_id, human_gene_symbol, d.disease_id as disease_id, d.diseasename as disease_term, hp_id as pheno_ids FROM human2mouse_orthologs hm, disease_hp M, disease d WHERE hm.entrez_id=d.gene_id AND M.disease_id=d.disease_id;"; return runGeneDiseaseModelQuery(modelQuery); } diff --git a/exomiser-core/src/test/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDaoTest.java b/exomiser-core/src/test/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDaoTest.java index f268e397f..f0c0f3966 100644 --- a/exomiser-core/src/test/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDaoTest.java +++ b/exomiser-core/src/test/java/org/monarchinitiative/exomiser/core/prioritisers/dao/DefaultDiseaseDaoTest.java @@ -97,4 +97,19 @@ public void testGetCnvDiseaseDataAssociatedWithGeneId() { List expected = Lists.newArrayList(cnv) ; assertThat(instance.getDiseaseDataAssociatedWithGeneId(2222), equalTo(expected)); } + + @Test + public void testGetUnconfirmedDiseaseDataAssociatedWithGeneId() { + Disease disease = Disease.builder() + .diseaseId("OMIM:123456") + .diseaseName("Test unconfirmed disease association") + .diseaseType(Disease.DiseaseType.UNCONFIRMED) + .inheritanceMode(InheritanceMode.UNKNOWN) + .associatedGeneId(3333) + .associatedGeneSymbol("GENE3") + .phenotypeIds(ImmutableList.of("HP:0000002")) + .build(); + List expected = Lists.newArrayList(disease) ; + assertThat(instance.getDiseaseDataAssociatedWithGeneId(3333), equalTo(expected)); + } } diff --git a/exomiser-core/src/test/resources/sql/diseaseDaoTestData.sql b/exomiser-core/src/test/resources/sql/diseaseDaoTestData.sql index 29aaba833..1637cd617 100644 --- a/exomiser-core/src/test/resources/sql/diseaseDaoTestData.sql +++ b/exomiser-core/src/test/resources/sql/diseaseDaoTestData.sql @@ -1,14 +1,17 @@ insert into disease values ('OMIM:101600', 'OMIM:176943', 'Craniofacial-skeletal-dermatologic dysplasia', 2263, 'D', 'D'), ('OMIM:101600', 'OMIM:136350', 'Pfeiffer syndrome', 2260, 'D', 'D'), -('ORPHA:11111', null, 'Test CNV disease', 2222, 'C', null); +('ORPHA:11111', null, 'Test CNV disease', 2222, 'C', null), +('OMIM:123456', null, 'Test unconfirmed disease association', 3333, '?', null); insert into disease_hp values ('OMIM:101600', 'HP:0000174,HP:0000194,HP:0000218,HP:0000238,HP:0000244,HP:0000272,HP:0000303,HP:0000316,HP:0000322,HP:0000324,HP:0000327,HP:0000348,HP:0000431,HP:0000452,HP:0000453,HP:0000470,HP:0000486,HP:0000494,HP:0000508,HP:0000586,HP:0000678,HP:0001156,HP:0001249,HP:0002308,HP:0002676,HP:0002780,HP:0003041,HP:0003070,HP:0003196,HP:0003272,HP:0003307,HP:0003795,HP:0004209,HP:0004322,HP:0004440,HP:0005048,HP:0005280,HP:0005347,HP:0006101,HP:0006110,HP:0009602,HP:0009773,HP:0010055,HP:0010669,HP:0011304'), -('ORPHA:11111', 'HP:0000001'); +('ORPHA:11111', 'HP:0000001'), +('OMIM:123456', 'HP:0000002'); insert into ENTREZ2SYM VALUES (2263, 'FGFR2'), (2260, 'FGFR1'), -(2222, 'GENE2'); \ No newline at end of file +(2222, 'GENE2'), +(3333, 'GENE3'); \ No newline at end of file