Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

184 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TIN-X API

This is the backend API for TIN-X.

TIN-X (Target Importance and Novelty eXplorer) is an interactive visualization tool for illuminating associations between diseases and potential drug targets and is publicly available via https://datascience.unm.edu/tin-x/. TIN-X uses natural language processing to identify disease and protein mentions within PubMed content using previously published tools for named entity recognition (NER) of gene/protein and disease names.

See also the repo TIN-X UI.

References

  • "TIN-X version 3: update with expanded dataset and modernized architecture for enhanced illumination of understudied targets", Vincent T. Metzger, Daniel C. Cannon, Jeremy J. Yang, Stephen L. Mathias, Cristian G. Bologa, Anna Waller, Stephan C. Schürer, Dušica Vidović, Keith J. Kelleher, Timothy K. Sheils, Lars Juhl Jensen, Christophe G. Lambert, Tudor I. Oprea, Jeremy S. Edwards, PeerJ 12:e17470, https://doi.org/10.7717/peerj.17470 (2024).
  • "TIN-X: target importance and novelty explorer", Daniel C Cannon, Jeremy J Yang, Stephen L Mathias, Oleg Ursu, Subramani Mani, Anna Waller, Stephan C Schürer, Lars Juhl Jensen, Larry A Sklar, Cristian G Bologa, Tudor I. Oprea, Bioinformatics, Volume 33, Issue 16, 2601–2603, (2017) https://doi.org/10.1093/bioinformatics/btx200

Documentation

In-progress with 2026 maintenance updates, docs/old has some (outdated) documentation.

Development

Launching the Dev Environment

Prerequisites:

  1. Clone the tinx-ui repo alongside this one (i.e. ../tinx-ui/).
  2. Copy .env.example to .env and fill in credentials:
    cp .env.example .env
    # edit .env — at minimum change MYSQL_ROOT_PASSWORD and DB_PASSWORD
  3. Generate the MySQL tuning config:
    ./tune.sh
    This reads DB_CPUS and DB_MEMORY from .env and writes mysql-tuning.cnf.

Start all services:

docker compose -f docker-compose-dev.yml up --build

This brings up four services:

Service Description Default port
ui Dev server for the TIN-X UI (hot-reload) 8080
api Django REST API 8000
db MySQL 8.0 via unmtransinfo/tinx_db — downloads and restores the TIN-X database on first boot internal only
solr Solr 6.6.6 search index internal only

First-time startup will take a while as the db service downloads and restores the database dump (likely several hours).

After the database is ready, rebuild the Solr search index:

docker compose -f docker-compose-dev.yml exec api python manage.py rebuild_index

If running the development version of TIN-X on another server (e.g., shishito.health.unm.edu), one can use SSH port-forwarding to access the api:

# Replace 8000 with your TINX_API_PORT
ssh -L 8000:localhost:8000 shishito.health.unm.edu

Then one can go to http://localhost:8000/ to view the API in-browser.

The same goes for the UI, just use TINX_UI_HTTP_PORT instead of 8000 above.

Note: The production docker-compose.yml is being updated and is not yet ready for use. Use docker-compose-dev.yml for now.

Running tests

You will first need to launch the development environment using the instructions above. Then, one can run tests with:

docker compose -f docker-compose-dev.yml exec api python manage.py test api.tests --verbosity=2

Upgrading Dependencies

If one finds they need to update dependencies (requirements.txt), the following steps can be followed:

  1. If a new package is required, add it to requirements.in
  2. Setup and activate a Python (v3.12) virtual environment. For example, with conda use:
    conda create -n tinx-api python=3.12 && conda activate tinx-api
    
  3. Install pip-tools: pip install pip-tools
  4. Compile new requirements: pip-compile --upgrade
  5. (Optional) Test the update locally in your environment: pip-sync

Note: If you need to update the Python version, make sure to adjust the steps above accordingly and to update the Python image in the Dockerfile.

Code Formatting with Pre-commit Hooks

This project uses pre-commit hooks to automatically format Python code with isort and Black, and formats Docker Compose files with DCLint before each commit.

Setup (one-time):

pre-commit install

Running hooks manually:

You can run all pre-commit hooks manually without committing:

pre-commit run --all-files

TODO:

  • Create GitHub actions workflow to publish built API image to DockerHub
  • Update docker-compose.yml, remove unnecessary prod dependencies (certbot, nginx)

Releases

Packages

Used by

Contributors

Languages