{"id":42060213,"url":"https://github.com/statgen/bravo_api","last_synced_at":"2026-01-26T07:38:53.490Z","repository":{"id":140592791,"uuid":"350481608","full_name":"statgen/bravo_api","owner":"statgen","description":"Server side data processing and retrieval endpoints for BRAVO","archived":false,"fork":false,"pushed_at":"2025-07-30T17:44:55.000Z","size":2970,"stargazers_count":1,"open_issues_count":16,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-30T20:34:16.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statgen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-22T20:34:38.000Z","updated_at":"2025-05-02T20:40:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c131a44-0998-48bc-a2de-293f48eb7e18","html_url":"https://github.com/statgen/bravo_api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/statgen/bravo_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statgen%2Fbravo_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statgen%2Fbravo_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statgen%2Fbravo_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statgen%2Fbravo_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statgen","download_url":"https://codeload.github.com/statgen/bravo_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statgen%2Fbravo_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28769853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T06:37:25.426Z","status":"ssl_error","status_checked_at":"2026-01-26T06:37:23.039Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-26T07:38:52.219Z","updated_at":"2026-01-26T07:38:53.476Z","avatar_url":"https://github.com/statgen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bravo API\n\nThe server side application of the BRowse All Variants Online (BRAVO) project.\n\n## Installation\nFor running an instance of Bravo API, install as a package.\n```\npython -m pip install git+https://github.com/statgen/bravo_api.git@main\n```\nSee [Development](#Development) section for developer installation.\n\n## Running\n\n```sh\n#!/bin/sh\n\n# Example run script for local development\n\n# Activate venv if present.\n[ -d 'venv' ] \u0026\u0026 source 'venv/bin/activate'\n\nexport FLASK_APP=bravo_api\n\n# Confige file is relative to the instance directory.\nexport BRAVO_API_INSTANCE_DIR='/var/local/bravo/instance'\nexport BRAVO_API_CONFIG_FILE='config.py'\n\nflask run --port 9090\n```\nOr use gunicorn in production instead of `flask run`\n```sh\ngunicorn -b 127.0.0.1:9090 -w 5 -k gevent \"bravo_api:create_app()\"\n```\n\n## Dependencies\n\n### Runtime Data\nThe runtime data on disk needs to be present before running.\n\n```\n/var/local/bravo/data\n└── runtime\n    ├── cache\n    ├── coverage\n    ├── crams\n    └── reference\n```\n\nThe paths to the runtime data needs to be specified in the config.py\n```py\nBASE_DIR = os.path.join(os.sep, 'var', 'local', 'bravo', 'data', 'runtime')\n\nCOVERAGE_DIR = os.path.join(BASE_DIR, 'coverage')\nSEQUENCES_DIR = os.path.join(BASE_DIR, 'crams')\nSEQUENCES_CACHE_DIR = os.path.join(BASE_DIR, 'cache')\nREFERENCE_SEQUENCE = os.path.join(BASE_DIR, 'reference', 'chr11_hs38DH.fa')\n```\n\n### MongoDB\nMongoDB needs to be pupulated with the basis data prior to running the api.\n\n```\n/var/local/bravo/data/basis/\n├── qc_metrics\n│   └── metrics.json.gz\n├── reference\n│   ├── canonical_transcripts.tsv.gz\n│   ├── gencode.v38.annotation.gtf.gz\n│   ├── hgcn_genenames.tsv.gz\n│   └── omim_ensembl_refs.tsv.gz\n└── vcfs\n    ├── chr11.bravo.vcf.gz\n    └── chr11.bravo.vcf.gz.tbi\n```\n\nThe package provides commands to load the basis data.\n```sh\nexport BRAVO_API_CONFIG_FILE='/path/to/config.py'\nvenv/bin/flask load-genes \\\n  data/basis/reference/canonical_transcripts.tsv.gz \\\n  data/basis/reference/omim_ensembl_refs.tsv.gz \\\n  data/basis/reference/hgcn_genenames.tsv.gz \\\n  data/basis/reference/gencode.v38.annotation.gtf.gz\n\nvenv/bin/flask load-snv 2 data/basis/vcfs/*.vcf.gz\n\nvenv/bin/flask load-qc-metrics \\\n\tdata/basis/qc_metrics/metrics.json.gz\n```\n\n### Pysam S3 Support\nThe pysam wheel provided from pypi does not include S3 support.\nPysam needs to be build with the \"--enable-s3\" option.\n\n```sh\nHTSLIB_CONFIGURE_OPTIONS=\"--enable-s3\"\npip install pysam --force-reinstall --no-binary :all:\n```\n\n## Development\nCheckout and install as editable package with development and testing extras.\n```\ngit clone https://github.com/statgen/bravo_api.git\ncd bravo_api\npython -m pip install -e .[dev,test]\n```\n\n### Testing\nWhen installed as editable package, run `pytest` from root dir or anywhere in tests dir.\n\n```\n# Run the tests\npytest\n```\n\nTop level testconf.py in the tests directory prevents marked tests from running.\nIn order to run marked tests in addition to the unmarked, provide a match expression.\n\n```\n# Run integration tests\npytest -m 'integration'\n```\n\n#### Autorunning tests\nA low overhead (not constantly polling) method of running `pytest` anytime a .py file is changed\ncan be achieved using `fd` and `entr` in a separate terminal.\nOnly thing this won't pick up is new files.\n\n```sh\nfd '.*\\.py$' | entr -c pytest\n```\n\nSee [notes.md](notes.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatgen%2Fbravo_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatgen%2Fbravo_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatgen%2Fbravo_api/lists"}