GithubHelp home page GithubHelp logo

ruit / ngs_server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chmille4/ngs_server

0.0 2.0 0.0 1.55 MB

Ultra Lightweight NGS (BAM/VCF) Server

Ruby 0.23% Makefile 5.54% C++ 64.80% C 9.57% Java 0.71% Perl 17.98% Python 0.49% TeX 0.29% CSS 0.26% PHP 0.14%

ngs_server's Introduction

#Ultralightweight NGS Server

Converts BAM and VCF files to json for consumption by a web application

install for mac and linux (no windows)

  1. download and install cmake

  2. run "gem install ngs_server" in the terminal

usage

  # in terminal
  ngs_server --help
  
  # add data directories to be served
  ngs_server add path-to-dir
  
  # start server
  ngs_server start
  ngs_server start --port 3000
  # daemonize
  ngs_server start -d
  
  # stop server if daemonized
  ngs_server stop

access data

see available data sources


invoke file: hg18.bam with coordinates 1 to 100000 on chromosome 22


vcf files must be compressed with index (see tabix)
invoke file: genotypes.vcf.gz with coordinates 1073361 to 1238825 on chromosome 1

find data

find data sources that have been added

# ngs_server find <dir> <regex>
ngs_server find . *  # return everything

# return found data as link to view in Rover
ngs_server find . "*bam" -r 1:1:100000

# specify server url that ngs_server is running on
# so the correct links to sources will be generated
ngs_server find . "*bam" -r 1:1:100000 -s http://mydataserver.com

Example

# create data directory
mkdir example-data && cd example-data

# download bam file and index
wget http://bioinformatics.bc.edu/marthlab/download/small.bam
wget http://bioinformatics.bc.edu/marthlab/download/small.bam.bai

# add data directory to ngs_server to be served
cd ../
ngs_server add example-data/

# start server
ngs_server start -d

# find data
ngs_server find . "*bam"

# generate Rover url to view data
# -r chr:min:max
ngs_server find . "*bam" -r 22:14596532:14699000
# and then just paste the generate url into a browser

# to make things quicker you can open the link from
# the command line in Google Chrome (Mac only, but linux is similar)
open -a "Google Chrome" $(ngs_server find . "*bam" -r 22:14596532:14699000)

# to see the pure json that ngs_server sends
# paste following url in browser
# http://0.0.0.0:4569/json/bam/example-data/small.bam?min=14596532&max=14699000&segment=22

# stop server
ngs_server stop

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.