ngs_server 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ #Ultralightweight NGS Server
2
+
3
+ Converts BAM and VCF files to json for consumption by a web application
4
+
5
+
6
+ ## install for mac and linux (no windows)
7
+ 1. download and install cmake
8
+
9
+ 2. run "gem install ngs_server" in the terminal
10
+
11
+ ## usage
12
+ // in terminal
13
+ ngs_server --help
14
+
15
+ // add data directories to be served
16
+ ngs_server add path-to-dir
17
+
18
+ // start server
19
+ ngs_server start
20
+ ngs_server start --port 3000
21
+ // daemonize
22
+ ngs_server start -d
23
+
24
+ // stop server if daemonized
25
+ ngs_server stop
26
+
27
+
28
+ ## access data
29
+
30
+ see available data sources
31
+
32
+ * http://0.0.0.0:4569/sources/bam
33
+ * http://0.0.0.0:4569/sources/vcf
34
+
35
+ <br/>invoke file: hg18.bam with coordinates 1 to 100000 on chromosome 22
36
+
37
+ * http://0.0.0.0:4569/json/bam/hg.18?min=1&max=10000&segment=22
38
+
39
+ <br/>vcf files must be compressed with index (see tabix)<br/>
40
+ invoke file: genotypes.vcf.gz with coordinates 1073361 to 1238825 on chromosome 1
41
+
42
+ * http://0.0.0.0:4569/json/vcf/genotypes.vcf.gz?segment=1&min=1073361&max=1238825
data/bin/ngs_server CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  $:.unshift File.join(path, "../lib")
7
7
 
8
- require 'Ngs_server'
8
+ require 'ngs_server'
9
9
 
10
10
 
11
11
  require 'ngs_server/version'
@@ -1,3 +1,3 @@
1
1
  module NgsServer
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/ngs_server.rb CHANGED
@@ -5,19 +5,17 @@ require 'sinatra/base'
5
5
 
6
6
  class MyNgsServer < Sinatra::Base
7
7
  set :server, 'thin'
8
- #set :run, true
9
- #set :public, '.'
10
- # set :port, opts[:port]
11
- #set :port, 4569
12
- # set :daemonize, opts[:daemonize]
13
- # set :daemonize, true
14
8
 
15
9
  gempath = File.join(File.dirname(__FILE__), "../")
16
10
  datapath = File.join(gempath, 'data')
17
11
  bamtools_path = "#{gempath}/ext/bamtools/bin/bamtools"
18
12
  vcftools_path = "#{gempath}/ext/vcftools/bin/vcf-query"
13
+ get '/test' do
19
14
 
15
+ 'hi'
16
+ end
20
17
 
18
+
21
19
  get '/json/bam/*' do |path|
22
20
 
23
21
  content_type :json
@@ -46,7 +44,7 @@ class MyNgsServer < Sinatra::Base
46
44
  response['Access-Control-Allow-Origin'] = '*';
47
45
 
48
46
  # invoke with eg: base_url/json/vcf/file=ALL.2of4intersection.20100804.sites.vcf.gz?min=6992179&max=6992190&segment=1
49
- list = `find -L #{datapath} -name *#{params['extension']} | awk -F/ '{ for(i=2; i<NF; i++) {printf("%s/", $i)} print $NF }'`
47
+ list = `find -L #{datapath} -name '*#{params['extension']}' | awk -F#{datapath}/ '{print $2}'`
50
48
  list
51
49
 
52
50
  end
data/ngs_server.gemspec CHANGED
@@ -4,11 +4,11 @@ require "ngs_server/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "ngs_server"
7
- s.version = "0.2.1"
7
+ s.version = "0.2.2"
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Chase Miller"]
10
10
  s.email = ["chmille4@gmail.com"]
11
- s.homepage = ""
11
+ s.homepage = "https://github.com/chmille4/ngs_server"
12
12
  s.summary = %q{"Ultra Lightweight NGS Data Server"}
13
13
  s.description = %q{"Converts BAM/VCF files into JSON for consumption by web apps"}
14
14
  s.add_dependency('sinatra', '>= 1.2')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Chase Miller
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-12-13 00:00:00 -05:00
17
+ date: 2011-12-16 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -71,6 +71,7 @@ extra_rdoc_files: []
71
71
  files:
72
72
  - .gitignore
73
73
  - Gemfile
74
+ - README.md
74
75
  - Rakefile
75
76
  - bin/ngs_server
76
77
  - data/holder.txt
@@ -595,7 +596,7 @@ files:
595
596
  - lib/ngs_server/version.rb
596
597
  - ngs_server.gemspec
597
598
  has_rdoc: true
598
- homepage: ""
599
+ homepage: https://github.com/chmille4/ngs_server
599
600
  licenses: []
600
601
 
601
602
  post_install_message: