Skip to content

Commit b2466dd

Browse files
authored
Merge pull request #248 from TheJacksonLaboratory/develop
Release/1.7.21
2 parents 8418c7b + cc0b145 commit b2466dd

39 files changed

+1391674
-1537291
lines changed

client/angular.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"scripts": []
2828
},
2929
"configurations": {
30-
"dev": {
30+
"development": {
3131
"budgets": [
3232
{
3333
"type": "anyComponentStyle",
@@ -79,8 +79,8 @@
7979
"browserTarget": "hpo:build"
8080
},
8181
"configurations": {
82-
"dev": {
83-
"browserTarget": "hpo:build:dev"
82+
"development": {
83+
"browserTarget": "hpo:build:development"
8484
},
8585
"production": {
8686
"browserTarget": "hpo:build:production"

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"name": "hpo-web",
3-
"version": "1.8.5",
3+
"version": "1.8.7",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
7-
"start": "ng serve --configuration=dev",
8-
"build": "ng build --aot --configuration=dev --base-href /app/",
9-
"buildProd": "ng build --aot --configuration=production --base-href /app/",
10-
"buildWatch": "ng build --aot --configuration=dev --watch=true --base-href /app/",
11-
"test": "ng test --watch false --progress=false",
7+
"start": "ng serve --configuration=development",
8+
"build": "ng build --configuration=development --base-href /app/",
9+
"buildProd": "ng build --configuration=production --base-href /app/",
10+
"test": "ng test --watch=false --progress=false",
1211
"lint": "ng lint",
1312
"e2e": "ng e2e"
1413
},

client/src/app/app.component.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h3 class="center menuTitle">Menu</h3>
2222
<button mat-menu-item (click)="mobileNavigate('resourcesMenu')"> Resources
2323
<mat-icon>arrow_right</mat-icon>
2424
</button>
25-
<button mat-menu-item (click)="sidenav.close()" routerLink="community"> Community</button>
25+
<button mat-menu-item (click)="sidenav.close()" routerLink="/community"> Community</button>
2626
</div>
2727
<div *ngIf="mobileNavSection == 'toolsMenu'">
2828
<button mat-menu-item routerLink="browse/profile-search"> Profile Search</button>
@@ -48,20 +48,21 @@ <h3 class="center menuTitle">Menu</h3>
4848
</div>
4949

5050
<div *ngIf="mobileNavSection == 'resourcesMenu'">
51-
<button mat-menu-item (click)="sidenav.close()" routerLink="faq"> FAQ</button>
51+
<button mat-menu-item (click)="sidenav.close()" routerLink="resources/faq"> FAQ</button>
52+
<button mat-menu-item routerLink="contact/"> Contact Us</button>
5253
<button mat-menu-item routerLink="resources/clinician-guide"> Clinicians Guide</button>
5354
<button mat-menu-item routerLink="resources/contributing"> Contributing</button>
5455
</div>
5556
<div *ngIf="mobileNavSection == 'dataMenu'">
56-
<button mat-menu-item (click)="sidenav.close()" routerLink="download/ontology"> Ontology</button>
57-
<button mat-menu-item (click)="sidenav.close()" routerLink="download/annotation"> Annotations</button>
57+
<button mat-menu-item (click)="sidenav.close()" routerLink="data/ontology"> Ontology</button>
58+
<button mat-menu-item (click)="sidenav.close()" routerLink="data/annotations"> Annotations</button>
5859
<button mat-menu-item (click)="mobileNavigate('translationMenu')">Translation
5960
<mat-icon>arrow_right</mat-icon>
6061
</button>
6162
<a mat-menu-item href="/api/hpo/docs"> API</a>
6263
</div>
6364

64-
<div *ngIF="mobileNavSection == 'translationMenu'">
65+
<div *ngIf="mobileNavSection == 'translationMenu'">
6566
<button mat-menu-item (click)="sidenav.close()" routerLink="data/layperson"> Layperson Synonyms</button>
6667
<button mat-menu-item (click)="sidenav.close()" routerLink="data/translations"> Translations and Mapping
6768
</button>

client/src/app/browser/models/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export interface Disease {
1111
db?: string;
1212
dbId?: string;
1313
diseaseId?: string;
14+
15+
mondoId?: string;
1416
diseaseName?: string;
1517
dbGenes?: Gene[];
1618
dbObjectId?: string;

client/src/app/browser/pages/disease/disease.component.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
<mat-card class="item-summary mat-elevation-z6">
1414
<mat-card-content>
1515
<span class="item-title">{{disease.diseaseName}}&nbsp;</span>
16-
<span class="item-id">{{disease.diseaseId}}</span>
16+
<a class="item-id" [href]="getExternalTermIdUrlFromId(disease.diseaseId)" target="_blank">
17+
{{disease.diseaseId}}
18+
<mat-icon>open_in_new</mat-icon>
19+
</a>
20+
<a *ngIf="disease.mondoId" class="item-id" [href]="getExternalTermIdUrlFromId(disease.mondoId)" target="_blank">
21+
{{disease.mondoId}}
22+
<mat-icon>open_in_new</mat-icon>
23+
</a>
1724
<hr class="underline-hr">
1825
<mat-list>
1926
<mat-list-item>{{disease.description}}</mat-list-item>
@@ -70,15 +77,14 @@ <h3 class="category-title">{{catTermSource.catLabel}}
7077
<mat-header-cell *matHeaderCellDef>Source(s)</mat-header-cell>
7178
<mat-cell [ngClass]="{'source-cell': row.sources.length > 1}" *matCellDef="let row">
7279
<ng-container *ngFor="let source of row.sources">
73-
<div class="source" *ngIf="isPubmed(source)">
74-
<a [href]="getPubmedUrl(source)" target="_blank">
80+
<div class="source" *ngIf="isTermIdExpected(source,'PMID')">
81+
<a [href]="getExternalTermIdUrlFromId(source)" target="_blank">
7582
PubMed <i class="material-icons-outlined">library_books</i>
7683
</a>
7784
</div>
78-
<div class="source" *ngIf="!isPubmed(source)">
79-
<a [href]="getExternalDiseaseUrl(source)" target="_blank">
80-
<span *ngIf="isSourceOmim(source)">OMIM &nbsp;</span>
81-
<span *ngIf="isSourceOrpha(source)">ORPHA &nbsp;</span>
85+
<div class="source" *ngIf="!isTermIdExpected(source, 'PMID')">
86+
<a [href]="getExternalTermIdUrlFromId(source)" target="_blank">
87+
<span>{{getDiseaseDatabaseName(source)}} &nbsp;</span>
8288
<i class="material-icons">open_in_new</i>
8389
</a>
8490
</div>

client/src/app/browser/pages/disease/disease.component.ts

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {DialogService} from '../../../shared/dialog-excel-download/dialog.servic
1414
})
1515
export class DiseaseComponent {
1616
query: string;
17-
disease: Disease = {'db': '', 'dbObjectId': '0', 'dbName': '', 'dbReference': ''};
17+
disease: Disease = {};
1818
termAssoc: Term[] = [];
1919
geneAssoc: Gene[] = [];
2020
termColumns = ['ontologyId', 'name', 'onset', 'frequency', 'sources'];
@@ -49,6 +49,7 @@ export class DiseaseComponent {
4949
this.diseaseService.searchMonarch(this.query)
5050
.subscribe((mData) => {
5151
this.disease.description = mData.description;
52+
this.disease.mondoId = mData.id;
5253
});
5354
this.isLoading = false;
5455
}, (error) => {
@@ -95,35 +96,29 @@ export class DiseaseComponent {
9596
});
9697
}
9798

98-
isPubmed(source: string) {
99-
return source.startsWith('PMID:');
100-
}
101-
102-
getPubmedUrl(source: string) {
103-
return 'https://www.ncbi.nlm.nih.gov/pubmed/' + source.split(':')[1];
104-
}
105-
106-
getExternalDiseaseUrl(source: string) {
107-
const sourceParts = source.split(':');
108-
if (sourceParts[0].startsWith('OMIM')) {
109-
return 'https://omim.org/entry/' + sourceParts[1];
110-
} else if (sourceParts[0].startsWith('ORPHA')) {
111-
return 'https://www.orpha.net/consor/cgi-bin/OC_Exp.php?Lng=EN&Expert=' + sourceParts[1];
99+
getExternalTermIdUrlFromId(termId?: string) {
100+
if(!termId){
101+
return '';
102+
}
103+
const sourceParts = termId.split(':');
104+
if (this.isTermIdExpected(termId, "OMIM")) {
105+
return `https://omim.org/entry/${sourceParts[1]}`;
106+
} else if (this.isTermIdExpected(termId, "ORPHA")) {
107+
return `https://www.orpha.net/consor/cgi-bin/OC_Exp.php?Lng=EN&Expert=${sourceParts[1]}`
108+
} else if (this.isTermIdExpected(termId, "MONDO")){
109+
return `https://monarchinitiative.org/disease/${termId}`;
110+
} else if(this.isTermIdExpected(termId, "PMID")){
111+
return `https://www.ncbi.nlm.nih.gov/pubmed/${sourceParts[1]}`;
112112
}
113113
}
114114

115-
isSourceOrpha(source: string) {
116-
const sourceParts = source.split(':');
117-
if (sourceParts[0].startsWith('ORPHA')) {
118-
return true;
119-
}
115+
isTermIdExpected(diseaseId: string, expected: string) {
116+
return diseaseId != "" && diseaseId != null && expected != "" && expected != null
117+
? diseaseId.toUpperCase().includes(expected) : false;
120118
}
121119

122-
isSourceOmim(source: string) {
123-
const sourceParts = source.split(':');
124-
if (sourceParts[0].startsWith('OMIM')) {
125-
return true;
126-
}
120+
getDiseaseDatabaseName(diseaseId){
121+
return diseaseId != "" && diseaseId != null ? diseaseId.split(':')[0] : '';
127122
}
128123

129124
applyGeneFilter(filterValue: string) {

client/src/app/browser/pages/search-results/search-results.component.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<div class="results-component">
2-
32
<div class="container">
4-
53
<div fxLayout="row" fxLayoutAlign="center">
64
<div fxFlex="80">
75
<!-- Disease Banner -->
86
<mat-card class="item-summary mat-elevation-z6">
97
<mat-card-content>
108
<span class="item-title">Search Results For "{{query}}"</span>
9+
<br>
10+
<i>
11+
Not seeing what you're looking for?
12+
<a href="https://github.com/obophenotype/human-phenotype-ontology/issues/new/choose" target="_blank">
13+
Contribute a term
14+
</a>
15+
</i>
1116
</mat-card-content>
1217
</mat-card>
1318

client/src/app/browser/services/disease/disease.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {Injectable} from '@angular/core';
2-
import {HttpClient, HttpHeaders} from '@angular/common/http';
2+
import { HttpClient, HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
33
import {environment} from '../../../../environments/environment';
44
import {Observable} from 'rxjs';
55

66
@Injectable()
77
export class DiseaseService {
8-
options = {
8+
options: any = {
99
headers: new HttpHeaders({
1010
'Accept': 'application/json'
1111
})
@@ -20,6 +20,9 @@ export class DiseaseService {
2020
}
2121

2222
searchMonarch(query: string): Observable<any> {
23+
const monarch_options = this.options;
24+
monarch_options.params = new HttpParams().set("fetch_objects", false).set("unselect_evidence", true)
25+
.set("exclude_automatic_assertions", false).set("get_association_counts", false).set("rows", 1);
2326
return this.http
2427
.get(environment.HPO_MONARCH_DISEASE_URL + query, this.options);
2528
}

client/src/app/shared/navbar/navbar.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
</mat-menu>
5252
<mat-menu #otherMenu="matMenu">
5353
<button mat-menu-item routerLink="data/translations"> Translations and Mapping</button>
54-
<button mat-menu-item routerLink="data/indigenous-languages"> Indigenous Languages</button>
5554
<button mat-menu-item routerLink="data/layperson"> Layperson Synonyms</button>
5655
</mat-menu>
5756
<!-- ------ -->

client/src/app/shared/utility/utility.service.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@ export class UtilityService {
1010

1111
constructor(private http: HttpClient) { }
1212

13+
1314
openExternalUrl(url: string) {
1415
window.open(url, '_blank').focus();
1516
}
1617

18+
downloadFile(url: string) {
19+
const link = document.createElement('a');
20+
link.setAttribute('target', '_blank');
21+
link.setAttribute('href', url);
22+
document.body.appendChild(link);
23+
link.click();
24+
link.remove();
25+
}
26+
1727
getMostRecentReleaseHPO() {
1828
return this.http.get(environment.HPO_GITHUB_REPO_URL + '/releases?per_page=1').pipe(
1929
map((versions: []) => {

client/src/app/static/about/about.component.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="about-us container" fxLayout="row wrap">
22
<h1 class="center pageTitle" fxFlexFill>The Human Phenotype Ontology</h1>
3-
<div fxFlex=70 fxFlexOffset="15">
3+
<div fxFlex="100" fxFlex.gt-sm=70 fxFlexOffset.gt-sm="15">
44
<h3 class="sub-title">Who we are!</h3>
55
<p>
66
The Human Phenotype Ontology (HPO) project provides an ontology of medically relevant phenotypes,
@@ -39,7 +39,7 @@ <h3 class="sub-title">Who we are!</h3>
3939
href="https://www.sciencedirect.com/topics/medicine-and-dentistry/human-phenotype-ontology"
4040
mat-stroked-button target="_blank">HPO on Science Direct</a>
4141
</div>
42-
<div class="about-us-banner" fxFlex="70" fxFlexOffset="15" fxLayout="row" fxLayoutAlign="space-evenly center">
42+
<div class="about-us-banner" fxFlex="100" fxFlex.gt-sm=70 fxFlexOffset.gt-sm="15" fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign="space-evenly center">
4343
<div class="banner-card" routerLink="/community">
4444
<div class="icon-wrapper">
4545
<mat-icon>groups</mat-icon>
@@ -59,7 +59,7 @@ <h3>Publications</h3>
5959
<h3>Cite Us</h3>
6060
</div>
6161
</div>
62-
<div class="history" fxFlex="70" fxFlexOffset="15">
62+
<div class="history" fxFlex="100" fxFlex.gt-sm=70 fxFlexOffset.gt-sm="15">
6363
<h3 class="sub-title">Where it started!</h3>
6464
<p>The Human Phenotype Ontology was initially developed at the <a href="https://www.charite.de/" target="__blank">Charité University Hospital</a> in Berlin, Germany by
6565
Peter N Robinson and Sebastian K&ouml;hler with support from Sandra Doelken and Sebastian Bauer. Very soon after the
@@ -82,18 +82,21 @@ <h3 class="sub-title">Where it started!</h3>
8282
<mat-icon>keyboard_arrow_right</mat-icon>
8383
</a>
8484
</div>
85-
<div class="contact-banner" fxFlex="70" fxFlexOffset="15" fxLayout="row" fxLayout.lt-md="column"
85+
<div class="contact-banner" fxFlex="100" fxFlex.gt-sm=70 fxFlexOffset.gt-sm="15" fxLayout="column" fxLayout.gt-sm="row"
8686
fxLayoutAlign="center center">
8787
<div class="contact-banner-title-wrapper" fxFlex fxLayout="row" fxLayoutAlign="center center">
8888
<h2 class="contact-banner-title" fxFlex>
8989
<mat-icon class="contact-icon">contact_support</mat-icon>
9090
Still have some questions?
9191
</h2>
9292
</div>
93-
<div class="contact-banner-btn-wrapper" fxFlex.lt-md="100" fxLayout="row"
93+
<div class="contact-banner-btn-wrapper" fxFlex.lt-md="120" fxLayout="column" fxLayout.gt-sm="row"
9494
fxLayoutAlign.gt-sm="end center" fxLayoutAlign="space-evenly center">
9595
<button class="contact-btn" mat-stroked-button routerLink="/faq">Frequently Asked Questions</button>
9696
<button class="contact-btn" mat-stroked-button routerLink="/contact">Contact us</button>
97+
<button class="contact-btn" mat-stroked-button (click)="utilityService.openExternalUrl('https://github.com/obophenotype/human-phenotype-ontology/issues/new/choose')">
98+
Contribute
99+
</button>
97100
</div>
98101
</div>
99102
</div>

client/src/app/static/about/about.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
border-color: white;
7575
}
7676

77-
& .contact-btn:last-child {
77+
& .contact-btn {
7878
margin-left: 1rem;
7979
}
8080
}

client/src/app/static/about/about.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { UtilityService } from "../../shared/utility/utility.service";
23

34
@Component({
45
selector: 'app-about',
@@ -7,7 +8,7 @@ import { Component, OnInit } from '@angular/core';
78
})
89
export class AboutComponent implements OnInit {
910

10-
constructor() { }
11+
constructor(public utilityService: UtilityService) { }
1112

1213
ngOnInit(): void {
1314
}

client/src/app/static/data/annotations-download/annotations-download.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container" fxLayout="row wrap">
22
<h1 class="pageTitle center" fxFlexFill>Download Annotations</h1>
3-
<div class="download-banner-wrapper mat-elevation-z4" fxFlex=40 (click)="utilityService.openExternalUrl(hpoaUrl)">
4-
<mat-icon>download</mat-icon>
3+
<div *ngIf="version" class="download-banner-wrapper mat-elevation-z4" fxFlex=100 fxFlex.gt-md=40 (click)="utilityService.downloadFile(hpoaUrl)">
4+
<mat-icon fxHide fxShow.gt-sm>download</mat-icon>
55
<h3 class="download-banner-title">Download HPO annotations ({{version}})</h3>
66
</div>
77
<div fxFlex="100">
@@ -12,7 +12,6 @@ <h3>Current format</h3>
1212
description is available <a
1313
href="https://hpo-annotation-qc.readthedocs.io/en/latest/annotationFormat.html#phenotype-hpoa-format"
1414
target="_blank">here</a>.</p>
15-
1615
<ul>
1716
<li><a href="http://purl.obolibrary.org/obo/hp/hpoa/phenotype.hpoa" target="__blank">http://purl.obolibrary.org/obo/hp/hpoa/phenotype.hpoa</a>
1817
</li>

client/src/app/static/data/annotations-download/annotations-download.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { environment } from "../../../../environments/environment";
23
import { UtilityService } from '../../../shared/utility/utility.service';
34

45
@Component({
@@ -8,7 +9,7 @@ import { UtilityService } from '../../../shared/utility/utility.service';
89
})
910
export class AnnotationsDownloadComponent implements OnInit {
1011

11-
readonly hpoaUrl = 'http://purl.obolibrary.org/obo/hp/hpoa/phenotype.hpoa';
12+
readonly hpoaUrl = `${environment.HPO_ANNOTATION_FILE_PURL}`;
1213
version: string;
1314
constructor(public utilityService: UtilityService) {}
1415

0 commit comments

Comments
 (0)