connectivity-search-backend

Django backend for hetnet connectivity search

https://github.com/greenelab/connectivity-search-backend

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.2%) to scientific vocabulary

Keywords

backend database django hetio hetmech hetnet-connectivity-search hetnets
Last synced: 6 months ago · JSON representation ·

Repository

Django backend for hetnet connectivity search

Basic Info
  • Host: GitHub
  • Owner: greenelab
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage: https://search-api.het.io
  • Size: 1.37 MB
Statistics
  • Stars: 6
  • Watchers: 6
  • Forks: 2
  • Open Issues: 5
  • Releases: 0
Topics
backend database django hetio hetmech hetnet-connectivity-search hetnets
Created over 7 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License Citation

README.md

connectivity search backend

CircleCI

This django application powers the API available at https://search-api.het.io/.

Environment

This repository uses conda to manage its environment as specified in environment.yml. Install the environment with:

shell conda env create --file=environment.yml

Then use conda activate hetmech-backend and conda deactivate to activate or deactivate the environment.

Secrets

Users must supply dj_hetmech/secrets.yml with the database connection information and two optional parameters for Django settings. See dj_hetmech/secrets-template.yml for what fields should be defined. These secrets will determine whether django connects to a local database or a remote database and other security settings in Django.

Notebooks

Use the following command to launch Jupyter Notebook in your browser for interactive development:

shell python manage.py shell_plus --notebook

Server

A local development server can be started with the command:

shell python manage.py runserver

This exposes the API at http://localhost:8000/v1/.

Database

This project uses a PostgreSQL database. The deployed version of this application uses a remote database. Public read-only access is available with the following configuration:

yaml name: connectivity_db user: read_only_user password: tm8ut9uzqx7628swwkb9 host: search-db.het.io port: 5432

To erect a new database locally for development, run:

```shell

https://docs.docker.com/samples/library/postgres/

docker run \ --name connectivitydb \ --env POSTGRESDB=connectivitydb \ --env POSTGRESUSER=djhetmech \ --env POSTGRESPASSWORD=not_secure \ --volume "$(pwd)"/database:/var/lib/postgresql/data \ --publish 5432:5432 \ --detach \ postgres:12.4 ```

Populating the database

To populate the database from scratch, use the populate_database management command (source). Here is an example workflow:

```shell

migrate database to the current Django models

python manage.py makemigrations python manage.py migrate --run-syncdb

view the populate_database usage docs

python manage.py populate_database --help

wipe the existing database (populate_database assumes empty tables)

python manage.py flush --no-input

populate the database (will take a long time)

python manage.py populate_database --max-metapath-length=3 --reduced-metapaths --batch-size=12000

output database information and table summaries

python manage.py database_info ```

Another option to load the database is to import it from the connectivity-search-pg_dump.sql.gz database dump, which will save time if you are interested in loading the full database (i.e. without --reduced-metapaths). This 5 GB file is available on Zenodo (TODO: update latest database dump to Zenodo).

To load connectivity-search-pg_dump.sql.gz into a new database, modify the following command:

shell zcat hetmech-pg_dump.sql.gz | psql --user=dj_hetmech --dbname=connectivity_db --host=HOST

connectivity-search-pg_dump.sql.gz was exported from the development Docker database with the command:

```shell docker exec connectivitydb \ pgdump \ --host=localhost --username=djhetmech --dbname=connectivitydb \ --create --clean \ --compress=8 \

connectivity-search-pg_dump.sql.gz ```

Owner

  • Name: Greene Laboratory
  • Login: greenelab
  • Kind: organization
  • Email: casey@greenelab.com
  • Location: Aurora, CO

Greene Laboratory at the University of Colorado Anschutz

Citation (CITATION.cff)

cff-version: 1.2.0
title: >-
  greenelab/connectivity-search-backend repository:
  Django backend for hetnet connectivity search
message: >-
  This citation is for the code repository.
  To cite Hetnet connectivity search more generally,
  see the manuscript at <https://greenelab.github.io/connectivity-search-manuscript/>.
type: software
authors:
  - given-names: Daniel
    family-names: Himmelstein
    orcid: 'https://orcid.org/0000-0002-3012-7446'
  - given-names: Dongbo
    family-names: Hu
    orcid: 'https://orcid.org/0000-0001-7870-8242'
  - given-names: Faisal
    family-names: Alquaddoomi
    orcid: 'https://orcid.org/0000-0003-4297-8747'
  - given-names: Casey
    family-names: Greene
    orcid: 'https://orcid.org/0000-0001-8713-9213'
identifiers:
  - type: swh
    value: 'swh:1:rev:28d9626d75c5fa78b03ae0cb18b32f90bcf1fe8f'
    description: Software Heritage Revision Snapshot
  - type: swh
    value: 'swh:1:dir:3438157eac00e6b353a806c375d976c7e1760cbf'
    description: Software Heritage Directory Snapshot
repository-code: 'https://github.com/greenelab/connectivity-search-backend'
url: 'https://search-api.het.io'
repository-artifact: 'https://zenodo.org/record/3978766'
abstract: Source code for the connectivity search database and API.
keywords:
  - django
  - database
  - backend
  - hetio
  - hetmech
  - hetnets
  - hetnet-connectivity-search
license: BSD-3-Clause

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 26
  • Total pull requests: 57
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 5
  • Total pull request authors: 2
  • Average comments per issue: 4.31
  • Average comments per pull request: 2.09
  • Merged pull requests: 55
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • dhimmel (16)
  • vincerubinetti (6)
  • dongbohu (2)
  • LuciaWL001 (1)
  • siyuniu (1)
Pull Request Authors
  • dhimmel (40)
  • dongbohu (17)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

environment.yml conda
  • django 3.0.7.*
  • django-cors-headers 3.2.1.*
  • django-extensions 2.2.9.*
  • django-filter 2.3.0.*
  • djangorestframework 3.11.0.*
  • graphviz 2.42.3.*
  • gunicorn 20.0.4.*
  • ipykernel 5.3.0.*
  • markdown 3.2.2.*
  • neo4j-python-driver 4.2.1.*
  • numpy 1.18.5.*
  • pandas 1.0.5.*
  • pip 20.1.1.*
  • psycopg2 2.8.5.*
  • pydot 1.4.1.*
  • python 3.8.3.*
  • pyyaml 5.3.1.*
  • requests 2.24.0.*
  • scipy 1.4.1.*
  • sqlparse 0.3.1.*