Sha256: bd3340b343773950647f370a4184972661e4a5e2358794d97d030e033e5cad6f

Contents?: true

Size: 409 Bytes

Versions: 10

Compression:

Stored size: 409 Bytes

Contents

module BioVcf
  module VcfLine

    # Split a line into fields and check size
    def VcfLine.parse line,expected_size=nil
      fields = line.strip.split(/\t/)
      raise "Unexpected line #{line}" if line.strip.size == 0 or fields.size < 6
      raise "Expected #{expected_size} fields but got #{fields.size} in "+fields.to_s if expected_size and fields.size != expected_size
      fields
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bio-vcf-0.9.5 lib/bio-vcf/vcfline.rb
bio-vcf-0.9.4 lib/bio-vcf/vcfline.rb
bio-vcf-0.9.2 lib/bio-vcf/vcfline.rb
bio-vcf-0.9.0 lib/bio-vcf/vcfline.rb
bio-vcf-0.8.2 lib/bio-vcf/vcfline.rb
bio-vcf-0.8.1 lib/bio-vcf/vcfline.rb
bio-vcf-0.8.0 lib/bio-vcf/vcfline.rb
bio-vcf-0.7.3 lib/bio-vcf/vcfline.rb
bio-vcf-0.7.0 lib/bio-vcf/vcfline.rb
bio-vcf-0.0.3 lib/bio-vcf/vcfline.rb