scbi_fastq 0.0.19 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c72341f5b45161a2bb31b82e772624c38ff9cfcd
4
- data.tar.gz: 2ae8b1289a1b80610dac9e517dbcb98403f542a5
3
+ metadata.gz: f7c70741d511792ef974608199e0a4ec299957a2
4
+ data.tar.gz: 5890ced565c6a6d459e9e8ff7efe8ca644117085
5
5
  SHA512:
6
- metadata.gz: e9c7bb8330578cfc1fce1f3369a14e388d7ad17f6edeefd34e21a0d352b1e049f6fc4b9cabb52d56fdc1f29468bfe0a13eb6315c9451b85e123a1ec719f90584
7
- data.tar.gz: 05db1afc8fa7963329e44fb03d6b33a4ccb89684b078adb3487a0e9d18a0101f4e5eae688f0914a6d7a49be22de08824ba1ad72837c973f78eeb23128353ad4f
6
+ metadata.gz: 4b06320c47f291320c78ea1c5ddce2553e2a6e860549bb47b1dbf456119015d871eed993b281dcc2cecd5def97ca32773c6b3c06ae887c6ae2ce91c61161c07d
7
+ data.tar.gz: b0a2bb95fe5a37e07f3febfcc4b95034f9d83bce5d78d62c08e6fd5b44076bb5401507a5aa38cc34c3eeef3a2e1e87e1d5e60fa19a58a5786bd6b296ed5e64b9
@@ -1,5 +1,5 @@
1
1
  require 'zlib'
2
- require 'scbi_multi_gz_reader'
2
+ require 'scbi_zcat'
3
3
 
4
4
  # add ord method to ruby 1.8
5
5
  if !String.instance_methods.include?(:ord)
@@ -42,11 +42,12 @@ class FastqFile
42
42
  if fasta_file_name.is_a?(IO)
43
43
  @fastq_file = fasta_file_name
44
44
  else
45
- begin
45
+ if ScbiZcatFile.gz_file?(fasta_file_name)
46
46
  #@fastq_file = Zlib::GzipReader.open(fasta_file_name)
47
- @fastq_file = MultiGzReader.new(fasta_file_name)
47
+ #@fastq_file = MultiGzReader.new(fasta_file_name)
48
+ @fastq_file = ScbiZcatFile.new(fasta_file_name)
48
49
  # puts "GZIP file detected"
49
- rescue => e
50
+ else
50
51
  @fastq_file = File.open(fasta_file_name,'r')
51
52
  # puts "NORMAL file detected"
52
53
  end
@@ -1,3 +1,3 @@
1
1
  module ScbiFastq
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.21"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency "scbi_multi_gz_reader"
21
+ spec.add_runtime_dependency "scbi_zcat", ">= 0.0.1"
22
22
  spec.add_development_dependency "bundler", "~> 1.7"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  end
@@ -30,48 +30,8 @@ class TestScbiFastq < Test::Unit::TestCase
30
30
 
31
31
  fqr.close
32
32
 
33
-
34
33
  end
35
34
 
36
-
37
- def test_mini_multi_gz_reader
38
-
39
- file=MultiGzReader.new(File.join(File.dirname(__FILE__),'minitest.fastq.gz'))
40
-
41
- i=0
42
-
43
- loop do
44
- res=file.readline
45
- #puts "LINE: #{res}"
46
- break if res.nil?
47
- i=i+1
48
- end
49
-
50
- file.close
51
-
52
- assert_equal(i,28)
53
-
54
- end
55
-
56
- def test_mini_multi_gz_reader_EOF_while
57
-
58
- # test a file with multiple gz streams
59
-
60
- fqr=FastqFile.new(File.join(File.dirname(__FILE__),'minitest.fastq.gz'))
61
-
62
- i=0
63
-
64
- fqr.each do |n,s,q|
65
- if !n.nil?
66
- i+=1
67
- end
68
- end
69
-
70
- fqr.close
71
-
72
- assert_equal(7,i)
73
-
74
- end
75
35
 
76
36
  def fill_file(n,offset=33)
77
37
  f=FastqFile.new(@test_file,'w')
@@ -207,6 +167,8 @@ class TestScbiFastq < Test::Unit::TestCase
207
167
  end
208
168
 
209
169
 
170
+
171
+
210
172
  def fill_file_gz(n,offset=33)
211
173
  f=FastqFile.new(@test_file_gz,'w.gz')
212
174
  puts "FILE GZ"
@@ -259,4 +221,30 @@ class TestScbiFastq < Test::Unit::TestCase
259
221
  # fq.close
260
222
  #
261
223
  # end
224
+
225
+ def test_each_large
226
+
227
+ # make new file and fill with data
228
+ #fill_file(100)
229
+
230
+
231
+ fqr=FastqFile.new('/tmp/pair2.fastq.gz')
232
+
233
+ i=1
234
+
235
+ fqr.each do |n,s,q|
236
+ puts n
237
+ #assert_equal(@seq_name+i.to_s,n)
238
+ #assert_equal(@seq_fasta*i,s)
239
+ #assert_equal((@seq_qual*i*@seq_fasta.length),q)
240
+
241
+ i+=1
242
+ end
243
+
244
+ assert_equal(40,i)
245
+
246
+
247
+ fqr.close
248
+ end
249
+
262
250
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scbi_fastq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - dariogf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: scbi_multi_gz_reader
14
+ name: scbi_zcat
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement