scbi_fastq 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZGZmZTIzNjczMTQ4OWIzM2Q2Njc0NTliYTRlYzkxMTg0MGFhYjE3Mg==
5
+ data.tar.gz: !binary |-
6
+ ODEzZTE0MzgzNzIyMWEyYWY4NzU5ZjlmYmVjMTQ1ZmUzYjJkYmZmNQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NWExOGZhYTNmMzFlMmEyOTdlZDA3YTkxMmQ3YTJkZGMwZWNmMzg4NGIwMWY5
10
+ YjRkOTI4ZmIyYWQxOWQyOWI2ZjVlM2VmZDg1YjJkMzVlMDQ5OTQ2ZWI0MTFk
11
+ MmMxNzZkOTI4ZGQyOWE1Yjg0ODI0ZGM1YTg3MTEzZTliOWQ3N2I=
12
+ data.tar.gz: !binary |-
13
+ MzFmNzRhOTlmOWZkYmQyNmRmZGVkZmRjMWZjZTA0YWJlNGU2MWIzYTQ0YjQ0
14
+ YmQ4ZjFmZWI1NmQxNWNhZmJkNmVkNDI3ZTMxOWE0YWNmNzdmNGY5YWUzYTE1
15
+ NGNlMTg0YWExOWU0Y2ZjZWVhMDdhZTczZDkzZTEwYWMwOTg1YjU=
data/.gemtest ADDED
File without changes
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.0.18 2013-12-16
2
+
3
+ Write GZ
4
+
1
5
  === 0.0.17 2012-07-13
2
6
 
3
7
  Read gzip files
data/lib/scbi_fastq.rb CHANGED
@@ -3,5 +3,5 @@ $:.unshift(File.dirname(__FILE__)) unless
3
3
 
4
4
  require 'scbi_fastq/fastq_file'
5
5
  module ScbiFastq
6
- VERSION = '0.0.17'
6
+ VERSION = '0.0.18'
7
7
  end
@@ -23,7 +23,10 @@ class FastqFile
23
23
  def initialize(fasta_file_name, mode='r', fastq_type = :sanger, qual_to_array=true, qual_to_phred=true)
24
24
 
25
25
 
26
- if mode.upcase.index('W')
26
+
27
+ if mode.upcase.index('W.GZ')
28
+ @fastq_file = Zlib::GzipWriter.open(fasta_file_name)
29
+ elsif mode.upcase.index('W')
27
30
  @fastq_file = File.open(fasta_file_name,'w')
28
31
  elsif mode.upcase.index('A')
29
32
  if !File.exist?(fasta_file_name)
@@ -4,6 +4,7 @@ class TestScbiFastq < Test::Unit::TestCase
4
4
 
5
5
  def setup
6
6
  @test_file='/tmp/sanger.fastq';
7
+ @test_file_gz='/tmp/sanger.fastq.gz';
7
8
 
8
9
 
9
10
  @seq_fasta='ACTG'
@@ -167,6 +168,44 @@ class TestScbiFastq < Test::Unit::TestCase
167
168
  end
168
169
 
169
170
 
171
+ def fill_file_gz(n,offset=33)
172
+ f=FastqFile.new(@test_file_gz,'w.gz')
173
+ puts "FILE GZ"
174
+ n.times do |c|
175
+ i = c+1
176
+
177
+ name = "#{@seq_name+i.to_s}"
178
+ f.write_seq(name,@seq_fasta*i,(@seq_qual*i*@seq_fasta.length),'comments')
179
+ # f.puts('@'+name)
180
+ # f.puts(@seq_fasta*i)
181
+ # f.puts('+'+name)
182
+ # f.puts((@seq_qual*i*@seq_fasta.length).map{|e| (e+offset).chr}.join)
183
+ end
184
+
185
+ f.close
186
+ end
187
+
188
+ def test_each_gz
189
+ # make new file and fill with data
190
+ fill_file_gz(100)
191
+
192
+
193
+ fqr=FastqFile.new(@test_file_gz)
194
+
195
+ i=1
196
+
197
+ fqr.each do |n,s,q|
198
+
199
+ assert_equal(@seq_name+i.to_s,n)
200
+ assert_equal(@seq_fasta*i,s)
201
+ assert_equal((@seq_qual*i*@seq_fasta.length),q)
202
+
203
+ i+=1
204
+ end
205
+ assert_equal(i,101)
206
+
207
+ fqr.close
208
+ end
170
209
 
171
210
 
172
211
  # def test_open_file
metadata CHANGED
@@ -1,40 +1,69 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: scbi_fastq
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.17
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.18
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - Dario Guerrero
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
-
13
- date: 2012-07-13 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: hoe
11
+ date: 2013-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rdoc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :development
17
21
  prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 2.8.0
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: newgem
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.5.3
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 1.5.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: hoe
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '3.7'
24
48
  type: :development
25
- version_requirements: *id001
26
- description: scbi_fastq is a ruby gem to read/write FASTQ files (DNA/RNA sequences) with qualities in a variety of formats (Sanger, Solexa, Ilumina).
27
- email:
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '3.7'
55
+ description: scbi_fastq is a ruby gem to read/write FASTQ files (DNA/RNA sequences)
56
+ with qualities in a variety of formats (Sanger, Solexa, Ilumina).
57
+ email:
28
58
  - dariogf@scbi.uma.es
29
59
  executables: []
30
-
31
60
  extensions: []
32
-
33
- extra_rdoc_files:
61
+ extra_rdoc_files:
34
62
  - History.txt
35
63
  - Manifest.txt
36
64
  - PostInstall.txt
37
- files:
65
+ - README.rdoc
66
+ files:
38
67
  - History.txt
39
68
  - Manifest.txt
40
69
  - PostInstall.txt
@@ -47,34 +76,34 @@ files:
47
76
  - script/generate
48
77
  - test/test_helper.rb
49
78
  - test/test_scbi_fastq.rb
79
+ - .gemtest
50
80
  homepage: http://www.scbi.uma.es/downloads
51
- licenses: []
52
-
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
53
84
  post_install_message: PostInstall.txt
54
- rdoc_options:
85
+ rdoc_options:
55
86
  - --main
56
87
  - README.rdoc
57
- require_paths:
88
+ require_paths:
58
89
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: "0"
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: "0"
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
71
100
  requirements: []
72
-
73
101
  rubyforge_project: scbi_fastq
74
- rubygems_version: 1.8.24
102
+ rubygems_version: 2.1.11
75
103
  signing_key:
76
- specification_version: 3
77
- summary: scbi_fastq is a ruby gem to read/write FASTQ files (DNA/RNA sequences) with qualities in a variety of formats (Sanger, Solexa, Ilumina).
78
- test_files:
79
- - test/test_helper.rb
104
+ specification_version: 4
105
+ summary: scbi_fastq is a ruby gem to read/write FASTQ files (DNA/RNA sequences) with
106
+ qualities in a variety of formats (Sanger, Solexa, Ilumina).
107
+ test_files:
80
108
  - test/test_scbi_fastq.rb
109
+ - test/test_helper.rb