Giter Site home page Giter Site logo

graphql-api's Introduction

RegulonDB-WS GraphQL API

License RegulonDBVersion Status

Description

API web services to connect RegulonDB MongoDB collections. Functional services currently:

  • Data
    • Gene
    • Operon
    • Regulon
    • Phrases
    • Sigmulon
    • SRNA
    • Gensor Unit
    • List Object (New)
  • Tools
    • Coexpression
    • DrawingTracesTool (dnaFeatures)
    • RegulatoryNetwork

Motivation

With the reengineering of RegulonDB passing from relational model to an documental model, was needed a new web service to connect to the new documental database using GraphQL technology, with this web service API can be possible to get data from RegulonDB with an application layer using the technology previously mentioned with Javascript.

System requirements

Required software

  • Node JS ^16.13.0
  • NPM ^8.1.4

Install

Once the repo is cloned, use this command to install all libraries dependencies of the API

$ npm install

After that, use the following command and edit the ".env-sample" file to add credentials to access the MongoDB collections (keeping the variable name) and the ports for GraphQL servers (by default is used port 4001 for the gateway, 4002 for private services, and 4003 for public services).

# On Unix
nano .env-sample

# On Windows
notepad .\.env-sample

Then use the next command for rename the file to ".env"

# On Unix
mv .env-sample .env

# On Windows
REN .env-sample .env

Quick start

Just use this command to start RegulonDB GraphQL Closed, Open and Gateway Services:

$ npm start

Now if the GraphQL Closed or Open ports in .env was not defined, it will take port 4001, 4002 and 4003 (by default) and GraphQL Playgroud for closedServices will run at http://localhost:4002/graphql, for OpenServices will run at http://localhost:4003/graphql and for Gateway will run at http://localhost:4001/graphql

Project website

[NOT DEFINED]

License

Copyright 2023 RegulonDB

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Support contact information

[It should be clear where to go for support, for example a contact e-mail address]

Software quality checklist

Accessibility

  • Unique DOI identifier (Please update identifier and link)
  • Version control system

Documentation

  • README file

Learnability

  • Quick start

Buildability

  • INSTALL file

Identity

  • Website

Copyright & Licensing

  • LICENSE file

Portability

  • Multiple platforms
  • Browsers

Supportability

  • E-mail address
  • Issue tracker
  • Slack
  • Gitter

Analysability

  • Source code structured
  • Sensible names
  • Coding standards - style guides

Changeability

  • CONTRIBUTING file
  • Code of Conduct file
  • Code changes, and their authorship, publicly visible

Reusability

  • Source code set up in a modular fashion

Security & Privacy

  • Passwords must never be stored in unhashed form

graphql-api's People

Contributors

andresloal avatar dependabot[bot] avatar pablo-epl avatar regulondb avatar

Watchers

James Cloos avatar HeladiaSalgado avatar

Forkers

shirleyah

graphql-api's Issues

Description of Gene properties web service

Web Service Name

GeneService

Introduction

The services have the option to include the description of the properties using """ triple quotes. This information is used by introspection queries. In the case of RegulonDB, the description will be used as label help in the web interface.

Request

Complete the description of gene service

Related links

Asana task

Error al consultar todos los Genes de getAllGenes() Bug Report 🐞

Error al consultar todos los Genes de getAllGenes()

Describe the bug

devuelve error hacer una consulta en el datamart getAllGenes al pedir todos los genes o la ultima pagina

To reproduce the bug

Error al realizar una consulta con el siguiente query:

{
  getAllGenes(limit: 10, page: 470) {
    data {
      id
      gene {
        name
        synonyms
        note
      }
      products {
        name
        id
      }
    }
    pagination {
      limit
      currentPage
      firstPage
      lastPage
      totalResults
      hasNextPage
    }
  }
}

Expected behavior

Se espera que se devuelva una lista de genes pero devuelve el siguiente error

"errors": [
    {
      "message": "Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.",
      "extensions": {
        "code": "DOWNSTREAM_SERVICE_ERROR",
        "serviceName": "openTools",
        "query": "{getAllGenes(limit:10 page:400){data{id gene{name synonyms note}products{name id}}pagination{limit currentPage firstPage lastPage totalResults hasNextPage}}}",
        "variables": {},
        "exception": {
          "stacktrace": [
            "GraphQLError: Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.",
            "    at downstreamServiceError (/app/node_modules/@apollo/gateway/dist/executeQueryPlan.js:267:12)",
            "    at /app/node_modules/@apollo/gateway/dist/executeQueryPlan.js:168:57",
            "    at Array.map (<anonymous>)",
            "    at sendOperation (/app/node_modules/@apollo/gateway/dist/executeQueryPlan.js:168:44)",
            "    at processTicksAndRejections (node:internal/process/task_queues:94:5)",
            "    at async executeFetch (/app/node_modules/@apollo/gateway/dist/executeQueryPlan.js:111:41)",
            "    at async executeNode (/app/node_modules/@apollo/gateway/dist/executeQueryPlan.js:82:17)",
            "    at async Object.executeQueryPlan (/app/node_modules/@apollo/gateway/dist/executeQueryPlan.js:22:27)",
            "    at async Object.ApolloGateway.executor (/app/node_modules/@apollo/gateway/dist/index.js:109:30)"
          ]
        }
      }
    }
  ]

Web Services to solve bug

  • getAllGenes


Additional context

Consulta realizada en el playground en la version 0.5.1

Add sigmaFactor in getAllGenes.data.regulation.operon.arrangement.promoters

TITLE

Add sigmaFactor in getAllGenes.data.regulation.operon.arrangement.promoters

Description

El proyecto "Análisis exploratorio y visualización de datos de genes de RegulonDB." necesitamos contar el numero de factores sigmas que regulan al gene. Ya existe el subdocumento de promotores pero no tiene la propiedad del factor sigma que nos ayudaría a realizar el conteo. Por eso solicitimos agregar esta propiedad al subdocumento.

{
getAllGenes(limit:1000){
    data{
      gene{
        _id
        name
      }
    	regulation{
        operon{
          arrangement{
            promoters{
              _id
              name
              sigmaFactor # Aqui hay que agregar el nuevo campo
            }
          }
        }
      }
    }
}
}

Expected behavior

Espero obtener el nombre del factor sigma para poder hacer el conteo.

Adicionalmente si es posible agregar numero de sigmas que regulan al genes en la sección de estadísticas.

Response Example

Additional Info

Additional context

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.