ebi-uniprot / uniprot-disease

REST API for UniProtKB supporting data diseases see https://www.uniprot.org/diseases/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uniprot-disease

REST API for UniProtKB supporting data diseases see https://www.uniprot.org/diseases/

UniProtKB (Universal Protein Knowledge Base) is a collection of functional information on proteins. Proteins can be involved in the human diseases. Diseases will have their definitions, acronyms, alternative names and other properties/information. User (website/machine) can use this REST API to search or get all information about human diseases referred in UniProtKB.

Standalone application, you need java8 and maven to startup.

Technologies

  • Java 8
  • Spring boot 2.0.1
  • Embedded mongodb 2.0.3
  • Maven 3.5.2
  • Junit 5.01
  • Mockito 2.18.3
  • Jackson 2.9.5
  • Assertj 3.9.1
  • Docker 17.12
  • Apache commons-csv 1.5
  • Swagger 2
  • Springfox

Getting started

  1. Download diseases data file from ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/docs/humdisease.txt on local file system
  2. Download/clone the code from github git clone https://github.com/ebi-uniprot/uniprot-disease.git
  3. Open file uniprot-disease/src/main/resources/application.properties and change the value spring.mongodb.embedded.storage.database-dir= with the path where you want to create your mongo database
  4. Go to uniprot-disease directory from terminal/command prompt
  5. run command mvn package
  6. For First time only (import data into database from txt file) run command java -jar target/uniprot-disease-0.0.1-SNAPSHOT.jar humdisease.txt
  7. It will delete existing database first and then start to import data
  8. Note: I have downloaded humdisease.txt file in same directory. You have to give the complete path of file if it is not in same directory
  9. Server will remain started and entertain requests
  10. If you want to stop server and just want to import data use java -jar target/uniprot-disease-0.0.1-SNAPSHOT.jar humdisease.txt --stopserver
  11. To start server second time (without import) use java -jar target/uniprot-disease-0.0.1-SNAPSHOT.jar

Endpoints

Endpoint Description
http://localhost:8080/accession/DI-04904 Return the single disease exact match on accession=DI-04904 (case-sensitive)
http://localhost:8080/acronym/achp Return the single disease exact match on acronym=ACHP (case-innsensitive)
http://localhost:8080/identifier/acatalasemia Return single disease exact match on identifier=Acatalasemia (case-insensitive)
http://localhost:8080/identifier/all/1A Returns the collection of all the matching diseases which have word "1A" after ignoring case in identifiers.
http://localhost:8080/search/lyase 3KTD Returns the unique collection of all the matching diseases which contains the words "lyase" or "3KTD" after ignoring case in identifier or accession or acronym or synonyms (alternative names) or definition.
http://localhost:8080/like/s?size=5 Return a list of matching diseases which's identifier contain character "s". Returning elements contains only identifier, acronym and accession. Size is optional, if not present default return size of list will be 10
http://localhost:8080/v2/api-docs API documentation in JSON format
http://localhost:8080/swagger-ui.html API documentation for user (Web-UI)

Getting started with Docker

You can build image locally as well as use docker hub to pull image.

to pull from docker hub and start container in backgroud

docker run -d --name disease -p8080:8080 impo/disease_api:2018_05

Need any help regarding docker commands see docker for quick reference.

Code Explanation

  1. Package name convention, using the plural for packages with homogeneous contents and the singular for packages with heterogeneous contents.
  2. Main Class uk.ac.ebi.uniprot.uniprotdisease.UniprotDiseaseApplication
  3. Single Controller for API uk.ac.ebi.uniprot.uniprotdisease.controller.DefaultController
  4. Controller interacting with service and service interacting with repository
  5. Import/Parse files logic is in uk.ac.ebi.uniprot.uniprotdisease.import_data package
  6. Dataset while never (too slow) grow, therefore making following to make application fast
    1. While importing loading all lines from file to memory
    2. Create / persist list of all (5000) object into database at once

License

This software is licensed under the Apache 2 license, quoted below.

Copyright (c) 2018, ebi-uniprot

Licensed under the Apache License, Version 2.0. You may not use this project except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

REST API for UniProtKB supporting data diseases see https://www.uniprot.org/diseases/

License:Apache License 2.0


Languages

Language:Java 96.6%Language:Dockerfile 3.4%