https://github.com/biocommons/seqrepo-rest-service

OpenAPI-based REST interface to biological sequences and sequence metadata

https://github.com/biocommons/seqrepo-rest-service

Science Score: 26.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .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 (10.1%) to scientific vocabulary

Keywords

bioinformatics genome-analysis genomics sequencing variant-analysis variation
Last synced: 5 months ago · JSON representation

Repository

OpenAPI-based REST interface to biological sequences and sequence metadata

Basic Info
  • Host: GitHub
  • Owner: biocommons
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 310 KB
Statistics
  • Stars: 4
  • Watchers: 4
  • Forks: 5
  • Open Issues: 3
  • Releases: 1
Topics
bioinformatics genome-analysis genomics sequencing variant-analysis variation
Created almost 7 years ago · Last pushed 12 months ago
Metadata Files
Readme License Codeowners

README.md

seqrepo-rest-api

Provides SeqRepo and GA4GH RefGet REST interfaces to biological sequences and sequence metadata from an existing seqrepo sequence repository.

Description

Specific, named biological sequences provide the reference and coordinate sysstem for communicating variation and consequential phenotypic changes. Several databases of sequences exist, with significant overlap, all using distinct names. Furthermore, these systems are often difficult to install locally.

Clients refer to sequences and metadata using familiar identifiers, such as NM_000551.3 or GRCh38:1, or any of several hash-based identifiers. The interface supports fast slicing of arbitrary regions of large sequences.

A "fully-qualified" identifier includes a namespace to disambiguate accessions (e.g., "1" in GRCh37 and GRCh38). If the namespace is provided, seqrepo uses it as-is. If the namespace is not provided and the unqualified identifier refers to a unique sequence, it is returned; otherwise, ambiguous identifiers will raise an error.

SeqRepo favors identifiers from identifiers.org whenever available. Examples include refseq and ensembl.

This repository is the REST interface only. The underlying data is provided by seqrepo.

This repository also implements the GA4GH refget (v1) protocol at <baseurl>/refget/.

Released under the Apache License, 2.0.

Links: Issues | Docker image

Citation

Hart RK, Prlić A (2020)
SeqRepo: A system for managing local collections of biological sequences.
PLoS ONE 15(12): e0239883. https://doi.org/10.1371/journal.pone.0239883

Examples

OpenAPI docs

The REST interface is implemented with OpenAPI. Current and interactive documentation is available at the base url for the endpoint.

OpenAPI UI Screenshot

Fetch Sequence

Fetch sequence by an accession:

$ curl -f http://0.0.0.0:5000/seqrepo/1/sequence/NP_001274413.1
MERSFVWLSCLDSDSCNLTFRLGEVESHACSPSLLWNLLTQYLPPGAGHILRTYNFPVLSCVSSCHLIGGKMPEN

Or not:

$ curl -f http://0.0.0.0:5000/seqrepo/1/sequence/bogus
curl: (22) The requested URL returned error: 404 NOT FOUND

Popular digests are also available:

$ curl -f http://0.0.0.0:5000/seqrepo/1/sequence/MD5:d52770ec477d0c9ee01fa034aff62cb4
MERSFVWLSCLDSDSCNLTFRLGEVESHACSPSLLWNLLTQYLPPGAGHILRTYNFPVLSCVSSCHLIGGKMPEN

With range:

# 👉 Seqrepo uses interbase coordinates.
$ curl -f "http://0.0.0.0:5000/seqrepo/1/sequence/NP_001274413.1?start=5&end=10"
VWLSC

Fetch Metadata

$ curl -f "http://0.0.0.0:5000/seqrepo/1/metadata/GRCh38:1"
{
  "added": "2016-08-27T21:17:00Z",
  "aliases": [
    "GRCh38:1",
    "GRCh38:chr1",
    "GRCh38.p1:1",
    "GRCh38.p1:chr1",
    ⋮
    "GRCh38.p9:chr1",
    "MD5:6aef897c3d6ff0c78aff06ac189178dd",
    "refseq:NC_000001.11",
    "SEGUID:FCUd6VJ6uikS/VWLbhGdVmj2rOA",
    "SHA1:14251de9527aba2912fd558b6e119d5668f6ace0",
    "sha512t24u:Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
    "ga4gh:SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO"
  ],
  "alphabet": "ACGMNRT",
  "length": 248956422
}

Development

$ make devready
$ source venv/bin/activate

Running a local instance

Once installed as above, you should be able to:

$ seqrepo-rest-service /usr/local/share/seqrepo/2021-01-29

The navigate to the URL shown in the console output.

Building and running a docker image

A docker image can be built with this repo or pulled from docker hub. In either case, the container requires an existing local seqrepo sequence repository.

To build a docker image in this repo:

make docker-image

This will create biocommons/seqrepo-rest-service:latest, like this:

$ docker images 
REPOSITORY                        TAG     IMAGE ID       CREATED          SIZE
biocommons/seqrepo-rest-service   latest  ad9ca051c5c9   2 minutes ago    627MB

This docker image is periodically pushed to docker hub.

Invoke the docker image like this this:

docker run \
  --name seqrepo-rest-service \
  --detach --rm -p 5000:5000 \
  -v /usr/local/share/seqrepo/2021-01-29:/mnt/seqrepo \
  biocommons/seqrepo-rest-service \
  seqrepo-rest-service /mnt/seqrepo

Where the command line options are as follows: * --name seqrepo-rest-service: Assigns the name seqrepo-rest-service to the container * --detach: Runs the container in background and prints the container ID * --rm: Automatically removes the container when it exits * -p 5000:5000: Publishes a container’s port(s), 5000:5000, to the local host * -v /usr/local/share/seqrepo/2021-01-29:/mnt/seqrepo: Binds the local volume, /usr/local/share/seqrepo/2021-01-29 to the address /mnt/seqrepo within the container * biocommons/seqrepo-rest-service: Specifies the docker image (as built above) * seqrepo-rest-service: Specifies the console name or entry point seqrepo_rest_service.cli:main * /mnt/seqrepo: Specifies the SeqRepo instance directory, as corresponding to the volume above

You should then be able to fetch a test sequence like this:

$ curl 'http://127.0.0.1:5000/seqrepo/1/sequence/refseq:NM_000551.3?end=20'
CCTCGCCTCCGTTACAACGG

If things aren't working, check the logs with docker logs -f seqrepo-rest-service.

Owner

  • Name: biocommons
  • Login: biocommons
  • Kind: organization

a collection of open source bioinformatics tools

GitHub Events

Total
  • Issues event: 1
  • Watch event: 2
  • Delete event: 2
  • Push event: 1
  • Pull request event: 4
  • Fork event: 2
Last Year
  • Issues event: 1
  • Watch event: 2
  • Delete event: 2
  • Push event: 1
  • Pull request event: 4
  • Fork event: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 months
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • reece (2)
  • theferrit32 (1)
Pull Request Authors
  • jsstevenson (5)
  • jPleyte (2)
  • bpeterman (1)
  • melissacline (1)
  • korikuzma (1)
  • theferrit32 (1)
Top Labels
Issue Labels
bug (1) stale (1) closed-by-stale (1) keep alive (1)
Pull Request Labels
resurrected (3) bug (1) keep alive (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 20 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 3
pypi.org: seqrepo-rest-service

SeqRepo REST Service

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 20 Last month
Rankings
Dependent packages count: 10.0%
Forks count: 15.4%
Stargazers count: 27.8%
Average: 30.2%
Dependent repos count: 67.7%
Maintainers (3)
Last synced: 6 months ago

Dependencies

.github/workflows/build-and-push-image.yml actions
  • actions/checkout v3 composite
  • docker/build-push-action v2 composite
  • docker/login-action v1 composite
  • docker/metadata-action v3 composite
.github/workflows/labels.yml actions
  • actions/checkout v3 composite
  • crazy-max/ghaction-github-labeler v4 composite
.github/workflows/python-package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/stale.yml actions
  • actions/stale v8 composite
Dockerfile docker
  • ubuntu 22.04 build
pyproject.toml pypi
setup.py pypi