GithubHelp home page GithubHelp logo

snp-viewer-demo's Introduction

snp-viewer-demo API:

path verb returns
/api/experiment GET JSON representation of all expriments in assetconfig.yaml
/api/experiment/{experiment} GET JSON representation of all PIs in VCF header
/api/generateGFF POST returns gff. Expected parameters of Ref={experiment:PI}&Variant={sameexperiment:PI}, with any number of variants
/ GET tool UI

To get started with go: You need to go get the following packages:

github.com/awilkey/bio-format-tools-go/gff 
github.com/awilkey/bio-format-tools-go/vcf
github.com/go-ozzo/ozzo-routing
github.com/spf13/viper
github.com/golang/gddo/httputil/header

It is reccommended to use dep to manage dependendencies, as running dep ensure will make sure the project has all the right requirements on hand.

Running through go as a test server:

go run server.go

By default this will listen on port 8080, but you can change this in the configuration file.

Building through Go:

go build -o server .

This builds a binary that has statically linked libraries, making it portable.

If running on a server without Go support the language has support built-in for cross compiling built in. See HERE for details.

Running through docker:

docker build -t gcvit:0.1 . -f Dockerfile

docker run -d \
--name gcvit \ 
--mount type=bind,source="$(pwd)"/config,target=/app/config \
--mount type=bind,source="$(pwd)"/assets,target=/app/assets \ 
-p 8080:8080 \
gcvit:0.1

The docker build has one build-arg:

--build-arg apionly=false

If you intend to use this container to only ever serve the API and not the UX component, setting this to true will skip the build steps for cvitjs and the ux. This doesn't save much space in the final container, as the built components combined are < 500k, but it does save quite a bit of time making the image.

Directory used as source to the /app/assets mount point is the default location for data, and /app/config for the configuration files. Once the app has been build, updating data should be as easy as stopping and starting the container after updating the data on disk.

Configuration

The assetsconfig.yaml file has the following format:

server:
  port: 8080
  apiOnly: False

snptestLegacy:
  location: assets/Soysnp-test-AW.vcf.gz
  name: 50k subset old
  format: vcf

The server section's options are:

Option Default Use
port 8080 Changes the port gcvit listens on.
apiOnly False If True, only serves the api routes.

Otherwise, a data track has the following format:

key:
  location: relative to root of server directory
  name: display name for dropdowns
  format: vcf (only option for now, automatically checks if gzipped)

snp-viewer-demo's People

Contributors

awilkey avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

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.