Skip to content

Commit

Permalink
Update DefaultDiseaseDao and ModelServiceImpl to select disease model…
Browse files Browse the repository at this point in the history
…s with type 'D', 'C' or '?'
  • Loading branch information
julesjacobsen committed May 17, 2019
1 parent eeefb36 commit 78da782
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 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', '?')" +
"AND d.GENE_ID = ?";

try (Connection connection = dataSource.getConnection()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -62,7 +62,7 @@ public ModelServiceImpl(DataSource phenotypeDataSource) {
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";
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,19 @@ public void testGetCnvDiseaseDataAssociatedWithGeneId() {
List<Disease> 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<Disease> expected = Lists.newArrayList(disease) ;
assertThat(instance.getDiseaseDataAssociatedWithGeneId(3333), equalTo(expected));
}
}
9 changes: 6 additions & 3 deletions exomiser-core/src/test/resources/sql/diseaseDaoTestData.sql
Original file line number Diff line number Diff line change
@@ -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');
(2222, 'GENE2'),
(3333, 'GENE3');

0 comments on commit 78da782

Please sign in to comment.