Skip to content

Commit

Permalink
Change for #337 - expand disease types to (D, C, S, ?)
Browse files Browse the repository at this point in the history
  • Loading branch information
julesjacobsen committed May 22, 2019
1 parent 78da782 commit 0d1bc8b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public List<Disease> 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', 'S', '?')" +
"AND d.GENE_ID = ?";

try (Connection connection = dataSource.getConnection()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ public ModelServiceImpl(DataSource phenotypeDataSource) {

@Override
public List<GeneModel> 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 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;";
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', 'S', '?')";
return runGeneDiseaseModelQuery(modelQuery);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,19 @@ public void testGetUnconfirmedDiseaseDataAssociatedWithGeneId() {
List<Disease> expected = Lists.newArrayList(disease) ;
assertThat(instance.getDiseaseDataAssociatedWithGeneId(3333), equalTo(expected));
}

@Test
public void testGetSusceptibilityDiseaseDataAssociatedWithGeneId() {
Disease disease = Disease.builder()
.diseaseId("OMIM:234567")
.diseaseName("Test susceptibility disease association")
.diseaseType(Disease.DiseaseType.SUSCEPTIBILITY)
.inheritanceMode(InheritanceMode.UNKNOWN)
.associatedGeneId(4444)
.associatedGeneSymbol("GENE4")
.phenotypeIds(ImmutableList.of("HP:0000002"))
.build();
List<Disease> expected = Lists.newArrayList(disease) ;
assertThat(instance.getDiseaseDataAssociatedWithGeneId(4444), equalTo(expected));
}
}
10 changes: 7 additions & 3 deletions exomiser-core/src/test/resources/sql/diseaseDaoTestData.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ 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),
('OMIM:123456', null, 'Test unconfirmed disease association', 3333, '?', null);
('OMIM:123456', null, 'Test unconfirmed disease association', 3333, '?', null),
('OMIM:234567', null, 'Test susceptibility disease association', 4444, 'S', 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'),
('OMIM:123456', 'HP:0000002');
('OMIM:123456', 'HP:0000002'),
('OMIM:234567', 'HP:0000002');


insert into ENTREZ2SYM VALUES
(2263, 'FGFR2'),
(2260, 'FGFR1'),
(2222, 'GENE2'),
(3333, 'GENE3');
(3333, 'GENE3'),
(4444, 'GENE4');

0 comments on commit 0d1bc8b

Please sign in to comment.