vcf 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/vcf.rb +5 -1
  2. metadata +3 -3
data/lib/vcf.rb CHANGED
@@ -8,6 +8,10 @@ public
8
8
  parse_line(line, sample_names) if line != nil
9
9
  end
10
10
 
11
+ def int_or_raw(x)
12
+ Integer.new(x) rescue x
13
+ end
14
+
11
15
  def parse_line(line, sample_names=nil)
12
16
  f = line.chomp.split("\t", -1)
13
17
  raise "VCF lines must have at least 8 fields" if f.size < 8
@@ -16,7 +20,7 @@ public
16
20
  @id = f[2]
17
21
  @ref = f[3]
18
22
  @alt = f[4]
19
- @qual = f[5].to_i
23
+ @qual = int_or_raw(f[5])
20
24
  @filter = f[6]
21
25
 
22
26
  @info = {}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vcf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jesse Rodriguez
@@ -10,10 +10,10 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-01 00:00:00 Z
13
+ date: 2011-08-31 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
- description: Lightweight VCF interface for ruby
16
+ description: Lightweight VCF (Variant Call Format) interface for ruby
17
17
  email: jesserod@cs.stanford.edu
18
18
  executables: []
19
19