ngs_server 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  optparse = OptionParser.new do |opts|
23
- opts.banner = "Usage: ngs_server start|stop|add [options]"
23
+ opts.banner = "Usage: ngs_server start|stop|add|find [options]"
24
24
 
25
25
  opts.on( '-h', '--help', 'display this screen' ) do
26
26
  # puts "ngs_server command options"
@@ -32,6 +32,7 @@
32
32
  puts "\tngs_server start -p 4567 -d"
33
33
  puts "\tngs_server add path_to_data_directory"
34
34
  puts "\tngs_server stop"
35
+ puts "\tngs_server find dir \"*bam\""
35
36
  exit
36
37
  end
37
38
 
@@ -22,9 +22,10 @@ class MyNgsServer < Sinatra::Base
22
22
  response['Access-Control-Allow-Origin'] = '*';
23
23
 
24
24
 
25
- # invoke with eg: base_url/json/bam/subset22-sorted.bam?min=30000000&max=30010000&segment=22
26
- json = `#{bamtools_path} convert -in #{datapath}/#{path} -format json -region #{params["segment"]}:#{params["min"]}..#{params["max"]}`
27
- json
25
+ # invoke with eg: base_url/json/bam/subset22-sorted.bam?min=30000000&max=30010000&segment=22
26
+ json = '['
27
+ json += `#{bamtools_path} convert -in #{datapath}/#{path} -format json -region #{params["segment"]}:#{params["min"].to_i}..#{params["max"].to_i}`
28
+ json.strip().chomp(',') + ']'
28
29
 
29
30
  end
30
31
 
@@ -35,8 +36,9 @@ class MyNgsServer < Sinatra::Base
35
36
  response['Access-Control-Allow-Origin'] = '*';
36
37
 
37
38
  # invoke with eg: base_url/json/vcf/ALL.2of4intersection.20100804.sites.vcf.gz?min=6992179&max=6992190&segment=1
38
- json = `#{vcftools_path} #{datapath}/#{path} #{params["segment"]}:#{params["min"]}-#{params["max"]} -f '{"reference":"%CHROM","position":%POS,"ref":"%REF","alt":"%ALT","info":%INFO},'`
39
- json
39
+ json = '['
40
+ json += `#{vcftools_path} #{datapath}/#{path} #{params["segment"]}:#{params["min"].to_i}-#{params["max"].to_i} -f '{"reference":"%CHROM","position":%POS,"ref":"%REF","alt":"%ALT","info":%INFO},'`
41
+ json.strip().chomp(',') + ']'
40
42
 
41
43
  end
42
44
 
@@ -1,3 +1,3 @@
1
1
  module NgsServer
2
- VERSION = "0.7"
2
+ VERSION = "0.8"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ngs_server
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: "0.7"
5
+ version: "0.8"
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chase Miller
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-31 00:00:00 -05:00
13
+ date: 2012-06-04 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency