Git Product home page Git Product logo

igvf-catalog's Introduction

CircleCI

igvf-catalog

Catalog API repository for the IGVF project.

Running with Docker Compose

Clone repository and make sure your Docker server is running.

When running for the first time, or if you want to load new data.

Make sure data/parsed_data is empty, otherwise duplicates might be created. Load data and initialize the database:

$ docker compose -f docker-compose-loader.yml up --build

After the python container exits either hit ctrl+C or run:

$ docker compose -f docker-compose-loader.yml down

When data has been loaded and you want to start the services:

Run:

$ docker compose -f docker-compose-serve.yml up

An ArangoDB client should be available at localhost:8529. Default username and password are: igvf.

The HTTP server with a Swagger interface displaying our endpoints will be available at: http://localhost:2023. The TRPC interface is available at http://localhost:2023/trpc.

Running with a remote Arango instance:

In docker-compose-serve.yml define the environment variables IGVF_CATALOG_ARANGODB_URI, IGVF_CATALOG_ARANGODB_USERNAME and IGVF_CATALOG_ARANGODB_PASSWORD with appropriate values, and that database will be used as the backend instead of the one running in docker locally.

Running tests

We use Jest for Typescript testing and Pytest for Python testing. For running tests, inside of the docker container:

  1. For typescript tests: npm test.
  2. For python tests: cd data && pytest.

If running tests outside of the docker container, you will need to install the project dependencies:

  1. npm install
  2. cd data && pip install -r requirements.txt (we suggest the use of a virtual environment to manage your Python packages)

Using the TRPC server in a Typescript project

If your project is in Typescript, you can execute remote procedure calls (RPCs) by importing this repository into your project and calling available procedures. The example below shows how to fetch gene data using tRPC.

import { createTRPCProxyClient, httpBatchLink } from '@trpc/client'
import { igvfCatalogRouter } from './routers/_app'

async function main (): Promise<void> {
  const trpc = createTRPCProxyClient<igvfCatalogRouter>({
    links: [
      httpBatchLink({ url: 'http://localhost:2023/trpc' })
    ]
  })

  // tRPC call to fetch gene data
  const gene = await trpc.genes.query({
    gene_id: 'ENSG00000160336'
  })

  console.log(gene)
}

void main()

The object trpc in this example can be inspected for a full list of all available remote procedures available. The full list is the same available at http://localhost:2023/.

Automatic linting

This repo includes configuration for pre-commit hooks. To use pre-commit, install pre-commit, and activate the hooks:

pip install pre-commit==3.2.1
pre-commit install

Live demo

Visit our beta Swagger page at: https://api.catalog.igvf.org.

For any feature requests and bug reports please open a ticket at: https://github.com/IGVF-DACC/igvfd/issues.

igvf-catalog's People

Contributors

pedrohr avatar mingjiecn avatar shengchd avatar ottojolanki avatar hitz avatar slobentanzer avatar corismall avatar

Stargazers

Anshul Kundaje avatar Ivy avatar  avatar  avatar Wenjin avatar

Watchers

 avatar  avatar  avatar  avatar

igvf-catalog's Issues

Accessing source data

Hi,

As far as I understood, right now this API builds the knowledge graph only with the sample data stored in data/samples/. May I ask how did you generate them? For example for the eQTL data, how could I access the total amount of available data? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.