Semsimian Server
A simple web server for the Semsimian project, written in Rust.
Requirements:
-
- rustup >= 1.28
- rustc >= 1.87
- cargo >= 1.87
Installation:
-
Semsimian Server requires a local copy of the Phenio DB.
Download a copy ofphenio.db.gzfrom https://data.monarchinitiative.org and unpack it into$HOME/.data/oaklib: -
Clone the repository:
-
Build the project:
-
Run the server:
Usage:
In debug mode (ie. cargo build), the server will be running on http://localhost:18811.
The address and port can be configured in the Rocket.toml file, or by setting the ROCKET_ADDRESS and ROCKET_PORT environment variables.
The server exposes two endpoints:
-
/compare/<termset1>/<termset2>/<metric>:
Returns a JSON object containing the similarity score between the two termsets.termset1andtermset2: comma-separated lists of ontology terms.metric: the similarity method to use, one of:
ancestor_information_content,jaccard_similarity,phenodigm_score,cosine_similarity
-
/search/<termset>/<prefix>/<metric>?<limit>&<direction>:
Returns a JSON object containing a list of ontology terms that match the search term and prefix.termset: comma-separated list of ontology terms.prefix: string that will be used to filter the results.metric: the similarity method to use, one of:
ancestor_information_content,jaccard_similarity,phenodigm_score,cosine_similaritylimit: number, limit the number of resultsdirection: the direction of the associations to search for, one of:
bidirectional,subject_to_object,object_to_subject
Examples:
http://localhost:18811/compare/HP:0000001,HP:0000002/HP:0000003,HP:0000004/ancestor_information_content
http://localhost:18811/search/HP:0000001,HP:0000002/zfin/ancestor_information_content
**Docker Image**
A Dockerfile is provided for convenience. While it is hosted on Google Cloud Platform,
it can be built locally.
To build the image, run the following command from the root of the repository:
To run the image, run the following command: