dna 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/dna.rb +2 -2
  2. data/spec/dna_spec.rb +9 -6
  3. metadata +1 -1
data/lib/dna.rb CHANGED
@@ -57,7 +57,7 @@ class Dna # iterator
57
57
  n = c.next
58
58
  case n
59
59
  when 0
60
- params[:name] = line.strip
60
+ params[:name] = line.strip[1..-1]
61
61
  when 1
62
62
  params[:sequence] = line.strip
63
63
  when 2
@@ -143,7 +143,7 @@ class QSEQ < Record
143
143
  def initialize(args={})
144
144
  # These are the properties defined by the qseq spec
145
145
  # they must be in the same order that they appear in the tab-separated qseq file
146
-
146
+ @properties = :machine, :run, :lane, :tile, :x, :y, :index, :read_no, :sequence, :quality, :filtered
147
147
  @machine = args[:machine]
148
148
  @run = args[:run]
149
149
  @lane = args[:lane]
data/spec/dna_spec.rb CHANGED
@@ -7,16 +7,18 @@ describe Dna do
7
7
  let (:fastq) { Dna.new @fastq_file, format: 'fastq' }
8
8
  let (:qseq) { Dna.new @qseq_file, format: 'qseq' }
9
9
 
10
- it 'can parse a crappily formatted fasta file' do
11
- fasta.to_a.length.should == 2
10
+ it 'can properly parse a crappily formatted fasta file' do
11
+ records = fasta.to_a
12
+ records[1].name.should == '2'
12
13
  end
13
14
 
14
15
  it 'generates fasta objects from a fasta file' do
15
16
  fasta.first.class.should == Fasta
16
17
  end
17
18
 
18
- it 'can parse fastq format' do
19
- fastq.to_a.length.should == 2
19
+ it 'can properly parse fastq format' do
20
+ records = fastq.to_a
21
+ records[1].name.should == '2'
20
22
  end
21
23
 
22
24
  it 'generates fastq objects from a fasta file' do
@@ -27,8 +29,9 @@ describe Dna do
27
29
  fastq.first.sequence.should_not be_nil
28
30
  end
29
31
 
30
- it 'can parse qseq' do
31
- qseq.to_a.length.should == 2
32
+ it 'can properly parse qseq format' do
33
+ records = qseq.to_a
34
+ records[1].sequence.should == 'GTGTGCCAGCAGCCGCGGTAATACAGAGGGGGCAAGCGTTGTTCGGAATTACTGGGCGTAAAGGGCGCGTAGGCGGCCCGCTAAGCCGAACGTGAAATCCC'
32
35
  end
33
36
 
34
37
  it 'generates qseq objects from a qseq file' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: