Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ontology files and dependencies in README #5

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Module for expanding terms to children.
pnpm i @biothings-explorer/node-expansion
```

### Dependencies
1. Java 11+ (to run `robot.jar`)
2. Download the script and JAR from [ROBOT](http://robot.obolibrary.org/). The script for Mac & Linux is already downloaded.

## Usage

- by default, the module will expand terms to all descendants
Expand Down Expand Up @@ -62,3 +66,6 @@ console.log(getDescendants(['GO:0022010', 'DOID:0060524', 'DOID:4'], recursive=f
node download.js
```
- downloads, converts, and parses all the owl files listed in the config file

## References
R.C. Jackson, J.P. Balhoff, E. Douglass, N.L. Harris, C.J. Mungall, and J.A. Overton. ROBOT: A tool for automating ontology workflows. BMC Bioinformatics, vol. 20, July 2019.
10 changes: 4 additions & 6 deletions __test__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ test('go', () => {
expect(descendants['GO:0032553']).toContain('GO:0032559');
});

//HP:0003812 -> HP:0003829 -> HP:0003831
//Phenotypic variability -> Incomplete penetrance -> Age-dependent penetrance
//HP:0003812 -> HP:0003828
//Phenotypic variability -> Variable expressivity
test('hp', () => {
let curies = ['HP:0003812'];
let descendants = getDescendants(curies);
expect(descendants['HP:0003812']).toContain('HP:0003829');
expect(descendants['HP:0003812']).toContain('HP:0003831');
expect(descendants['HP:0003812']).toContain('HP:0003828');
});

//MONDO:0001517 -> MONDO:0001955 -> MONDO:0024275
Expand All @@ -57,8 +56,7 @@ test('umls', () => {
test('multiple', () => {
let curies = ['HP:0003812', 'MONDO:0001517'];
let descendants = getDescendants(curies);
expect(descendants['HP:0003812']).toContain('HP:0003829');
expect(descendants['HP:0003812']).toContain('HP:0003831');
expect(descendants['HP:0003812']).toContain('HP:0003828');
expect(descendants['MONDO:0001517']).toContain('MONDO:0001955');
expect(descendants['MONDO:0001517']).toContain('MONDO:0024275');
});
Expand Down
2 changes: 1 addition & 1 deletion data/chebi-parsed.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/doid-parsed.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/go-parsed.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/hp-parsed.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/mondo-parsed.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ for (let ontology of Object.values(ONTOLOGIES)) {
console.log(`Done downloading ${url} with code ${code}`);

// use robot to convert owl to json
// http://robot.obolibrary.org/
child_process.execSync(
`../robot convert -i ../data/${ontology.name}.owl --format json -o ../data/${ontology.name}.json`,
);
Expand Down
Loading