Skip to content

Commit

Permalink
Merge pull request #16 from Clinical-Genomics/fix_updated_jax_ontolog…
Browse files Browse the repository at this point in the history
…y_interface

Fix #15 - JAX ontology interface change
  • Loading branch information
dnil authored Jan 28, 2025
2 parents fe8d12c + e5924e8 commit 1510e58
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 29 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

### [1.2.2]
#### Fixed
- Adding manual HPO terms was broken - updated JAX Ontology API Term Interface to fix

### [1.2.1]
#### Fixed
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-ts",
"private": true,
"version": "1.2.1",
"version": "1.2.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
24 changes: 2 additions & 22 deletions src/hpoJax.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
export interface TermResponse {
details: Details;
relations: Relations;
}

export interface Relations {
termCount: number;
parents: Parent[];
children: Parent[];
}

export interface Parent {
name: string;
id: number;
childrenCount: number;
ontologyId: string;
}

export interface Details {
name: string;
id: string;
altTermIds: string[];
definition: string;
comment: string;
synonyms: string[];
isObsolete: boolean;
xrefs: string[];
pubmedXrefs: string[];
xrefs?: string[];
descendantCount?: number;
}
8 changes: 4 additions & 4 deletions src/utils/lookupHpoTerm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function lookupHpoTerm(term: string): Promise<IResult> {
);
if (ret.ok) {
const res = (await ret.json()) as TermResponse;
return { term, label: res.details.name };
return { term, label: res.name };
} else {
return { error: 'Unknown HPO term' };
}
Expand All @@ -20,9 +20,9 @@ async function lookupHpoTerm(term: string): Promise<IResult> {
export interface IJaxTerm {
name: string;
id: string;
childrenCount: number;
ontologyId: string;
synonym?: string;
descendantCount: number;
xrefs?: string[];
synonyms: string[];
}
export interface TermsResponse {
error?: string;
Expand Down

0 comments on commit 1510e58

Please sign in to comment.