bio-bigwig 0.0.4 → 0.0.6

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
  SHA256:
3
- metadata.gz: 9fc197bd8ffd3edcbecd7c74e632b9b44d180b30540194e083aa23245822322d
4
- data.tar.gz: 52075f2eccf948d9017e4b94ba5b4380cd66729610f8fbabe1a16732649ec5f6
3
+ metadata.gz: 87a8791f8697b0b4cff130d28f370e67770688d6da475f7caf956556c8431332
4
+ data.tar.gz: 8faebc66db077059394015892d69c3dde78e4eee4eb614f36b2b3377bd88450f
5
5
  SHA512:
6
- metadata.gz: 27b8667fabdc77ef6e66544af79ccf9c2ea67c7a661649f7add0590f739ed82b0cc57026a6ffd23c7923faa1d9154146213d51fd6f2b56d6f43681b7f6fb00fb
7
- data.tar.gz: 7a580a0ef61afdbcdb6eb56507de67c6a91bc610558e36892fae6ebca7b049aaec749012488613e40890a88d25d3c7370e467cbf691b47dca389caf278a69294
6
+ metadata.gz: 017d2fa8b7b03646961344fad93a97d71e9a3d3620e0ced75002d64fa44f5175a8434249ed668924b67b72df2d43a05986dca836018c8e5c144a03ee4a5fa29a
7
+ data.tar.gz: 9ca76c76d3803689d7e94cd5d9acbd5bd5e939d94bab7a8a2d3c1f0a13ebd5bd3ee97ea617a16877f8a4673ac2fc3291c9b01d56acfa15e70dd05204ec50f398
@@ -162,6 +162,21 @@ bigwig_close(VALUE self)
162
162
  return Qnil;
163
163
  }
164
164
 
165
+ static VALUE
166
+ bigwig_is_closed(VALUE self)
167
+ {
168
+ bigWigFile_t *bw = get_bigWigFile(self);
169
+
170
+ if (bw)
171
+ {
172
+ return Qfalse;
173
+ }
174
+ else
175
+ {
176
+ return Qtrue;
177
+ }
178
+ }
179
+
165
180
  static VALUE
166
181
  bw_get_header(VALUE self)
167
182
  {
@@ -170,7 +185,7 @@ bw_get_header(VALUE self)
170
185
 
171
186
  if (!bw)
172
187
  {
173
- rb_raise(rb_eRuntimeError, "The bigWig file handle is not opened!");
188
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
174
189
  return Qnil;
175
190
  }
176
191
 
@@ -210,7 +225,7 @@ bw_get_chroms(int argc, VALUE *argv, VALUE self)
210
225
 
211
226
  if (!bw)
212
227
  {
213
- rb_raise(rb_eRuntimeError, "The bigWig file handle is not opened!");
228
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
214
229
  return Qnil;
215
230
  }
216
231
 
@@ -284,7 +299,7 @@ bw_get_stats(VALUE self, VALUE rb_chrom, VALUE rb_start, VALUE rb_end, VALUE rb_
284
299
 
285
300
  if (!bw)
286
301
  {
287
- rb_raise(rb_eRuntimeError, "The bigWig file handle is not opened!");
302
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
288
303
  return Qnil;
289
304
  }
290
305
 
@@ -317,12 +332,6 @@ bw_get_stats(VALUE self, VALUE rb_chrom, VALUE rb_start, VALUE rb_end, VALUE rb_
317
332
  if (rb_type != Qnil)
318
333
  type = StringValueCStr(rb_type);
319
334
 
320
- if (rb_exact != Qnil)
321
- {
322
- if (RTEST(rb_exact) == 1)
323
- endl = startl + nBins - 1;
324
- }
325
-
326
335
  tid = bwGetTid(bw, chrom);
327
336
 
328
337
  if (endl == (unsigned long)-1 && tid != (uint32_t)-1)
@@ -397,7 +406,7 @@ bw_get_values(VALUE self, VALUE rb_chrom, VALUE rb_start, VALUE rb_end)
397
406
 
398
407
  if (!bw)
399
408
  {
400
- rb_raise(rb_eRuntimeError, "The bigWig file handle is not opened!");
409
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
401
410
  return Qnil;
402
411
  }
403
412
 
@@ -469,7 +478,7 @@ bw_get_intervals(VALUE self, VALUE rb_chrom, VALUE rb_start, VALUE rb_end)
469
478
 
470
479
  if (!bw)
471
480
  {
472
- rb_raise(rb_eRuntimeError, "The bigWig file handle is not opened!");
481
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
473
482
  return Qnil;
474
483
  }
475
484
 
@@ -558,7 +567,7 @@ bb_get_entries(VALUE self, VALUE rb_chrom, VALUE rb_start, VALUE rb_end, VALUE r
558
567
 
559
568
  if (!bw)
560
569
  {
561
- rb_raise(rb_eRuntimeError, "The bigBed file handle is not opened!");
570
+ rb_raise(rb_eIOError, "The bigBed file handle is not opened!");
562
571
  return Qnil;
563
572
  }
564
573
 
@@ -656,7 +665,7 @@ bb_get_sql(VALUE self)
656
665
 
657
666
  if (!bw)
658
667
  {
659
- rb_raise(rb_eRuntimeError, "The bigBed file handle is not opened!");
668
+ rb_raise(rb_eIOError, "The bigBed file handle is not opened!");
660
669
  return Qnil;
661
670
  }
662
671
 
@@ -684,6 +693,12 @@ bw_get_file_type(VALUE self)
684
693
  {
685
694
  bigWigFile_t *bw = get_bigWigFile(self);
686
695
 
696
+ if (!bw)
697
+ {
698
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
699
+ return Qnil;
700
+ }
701
+
687
702
  if (bw->type == 0)
688
703
  {
689
704
  return rb_str_new2("BigWig");
@@ -703,7 +718,7 @@ bw_is_file_type(VALUE self, int type_check)
703
718
 
704
719
  if (!bw)
705
720
  {
706
- rb_raise(rb_eRuntimeError, "The bigWig file handle is not opened!");
721
+ rb_raise(rb_eIOError, "The bigWig file handle is not opened!");
707
722
  return Qnil;
708
723
  }
709
724
 
@@ -738,6 +753,7 @@ void Init_bigwigext()
738
753
 
739
754
  rb_define_private_method(rb_BigWig, "initialize_raw", bigwig_init, 2);
740
755
  rb_define_method(rb_BigWig, "close", bigwig_close, 0);
756
+ rb_define_method(rb_BigWig, "closed?", bigwig_is_closed, 0);
741
757
  rb_define_method(rb_BigWig, "header", bw_get_header, 0);
742
758
  rb_define_method(rb_BigWig, "chroms", bw_get_chroms, -1);
743
759
  rb_define_private_method(rb_BigWig, "stats_raw", bw_get_stats, 6);
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bio
4
4
  class BigWig
5
- VERSION = "0.0.4"
5
+ VERSION = "0.0.6"
6
6
  end
7
7
  end
data/lib/bio/bigwig.rb CHANGED
@@ -40,8 +40,8 @@ module Bio
40
40
  intervals_raw(chrom, start, stop)
41
41
  end
42
42
 
43
- def entries(chrom, start = 0, stop = -1, text: true)
44
- entries_raw(chrom, start, stop, text)
43
+ def entries(chrom, start = 0, stop = -1, with_string: true)
44
+ entries_raw(chrom, start, stop, with_string)
45
45
  end
46
46
  end
47
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-bigwig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-20 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a Ruby binding for libBigWig (https://github.com/dpryan79/libBigWig),
14
14
  which provides high-speed access to bigWig or bigBed files.