Giter VIP home page Giter VIP logo

gogoapi's Introduction

GOGOApi

DOI

Express RESTFul interface for providing information about GO and Taxonomy for supporting functional annotation efforts.

Installation and usage

In a local computer install node.js (you can use Node Version Manager).

Adapt config.json to suit your needs and point to suitable database locations. Data can be provided from generated or existing datasets, as explained in Datasets section below.

Install dependendencies with: npm install and start the application with node index.js /path/to/config.json

This will start a service under 0.0.0.0:4242/api (if defined as such in basepath and port configuration parameters).

NOTE: Neo4j options can be ignored for now and will be removed in upcoming releases.

Docker

A Dockerfile and an already generated Docker image are available as well. Care must be taken to adapt Docker networks so it can find pointed databases in config.json file.

Adapt your config.json file and execute as follows:

docker run --name mygogoapi -v /path/to/your/config.json:/data/config/config.json toniher/gogoapi

Datasets

Import MySQL dump into an existing database (e.g., biosql):

# First uncompress the file
gunzip biosql-202010.sql.gz
# Import dump into a database
mysql -umyuser -pmypasswd biosql < biosql-202010.sql
  • byosql: Name of the database, which it must be created in advance (e.g., with CREATE DATABASE `biosql` ;)
  • myuser and mypasswd are a MySQL user and password, which must have read-write permissions to the database above

More information: How To Import and Export Databases in MySQL or MariaDB

Options

  • Once the webservice is set up, check 0.0.0.0:4242/api for different REST examples.

gogoapi's People

Contributors

toniher avatar

Watchers

 avatar  avatar

gogoapi's Issues

An error with gogoapi

Hi, Toni
Thank you again for your help in installing the correct version of targetP. Here, I met an error with gogoapi.

I'm new to NodeJS and don't know how to fix gagapi with the following command. Could you kindly help me solve my problem?

install gogoapi

git clone https://github.com/toniher/gogoapi.git
docker build -t mygogoapi:20211205 -f Dockerfile .

Download (Database dumps for convenience) from https://biocore.crg.eu/gogoapi/biosql-202010.sql.gz

gunzip biosql-202010.sql.gz
mv biosql-202010.sql biosql.sql
sed -i 's//biodb/biosql.sql/g'

Then run

docker run --name mygogoapi -v config.json:/data/config/config.json mygogoapi:20211205
:(, I get the the fellowed errors

warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
(node:8) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:8) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
/data/soft/gogoapi/node_modules/nconf/lib/nconf/stores/file.js:170
throw new Error("Error parsing your configuration file: [" + this.file + ']: ' + ex.message);
^

Error: Error parsing your configuration file: [/data/config/config.json]: EISDIR: illegal operation on a directory, read
at exports.File.File.loadSync (/data/soft/gogoapi/node_modules/nconf/lib/nconf/stores/file.js:170:11)
at exports.Provider.Provider.add (/data/soft/gogoapi/node_modules/nconf/lib/nconf/provider.js:136:23)
at exports.Provider.Provider.file (/data/soft/gogoapi/node_modules/nconf/lib/nconf/provider.js:63:15)
at new config (/data/soft/gogoapi/config.js:9:8)
at module.exports (/data/soft/gogoapi/config.js:18:9)
at Object. (/data/soft/gogoapi/index.js:6:37)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
error: Forever detected script exited with code: 1

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.