bio-cgranges 0.0.3 → 0.0.4

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: d8994f59d1b67dd6aedd82baea6a0f844788e37d05cb3d461a838eb225f74d04
4
- data.tar.gz: 764537c8f8227f05fbe4e7641da56aa539759f39937db6c8a28aac0caaf69ff9
3
+ metadata.gz: b7e9a833b30ffb5a3e58c530b672f4a5d6ddc7c0e7abdbb56d134b7c943e9e40
4
+ data.tar.gz: 32358b854ec91fb5b6b0ebf6e9e1e42b0686f7550a670a2a428add7911a6cb69
5
5
  SHA512:
6
- metadata.gz: bab3e61e0f9d7da8a59e5d521db8638db8d47270d3ced8b7b3a39171c4179e16ca1cf9154cd975d8625a7e41a3bcefe6d71cbe06bcad7ff5670c75c5d044ac42
7
- data.tar.gz: b641fa455ac81b6bcbf8962ff0cf56af57a211bbfeeedcd41c8283917cf3ad123d176584b98e50a36cbd1d930a36377a202ad6e2a0416d2a019f0a298b15ebef
6
+ metadata.gz: 344ccb1436fbb035cae97e8f92b42ff556e62d12e88c2d0603377605a07f2db293bbdf05d67b845a38125fe0ffa0662b87a5d59919ac4f70fb45532c1e4e859e
7
+ data.tar.gz: 77444c30f87bfe01b679aff403154b3821b72777854f4d9e75aa4e25202050718bc63022899cbf9e98f7844806f4d2c906156d8076f2abd588d60a4f4143a6a1
data/README.md CHANGED
@@ -72,7 +72,7 @@ bundle exec rake compile
72
72
  bundle exec rake test
73
73
  ```
74
74
 
75
- Bug reports and pull requests are welcome on GitHub at https://github.com/kojix2/bio-cgranges.
75
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/kojix2/bio-cgranges>.
76
76
 
77
77
  Do you need commit rights to this repository?
78
78
  Do you want to get admin rights and take over the project?
@@ -122,6 +122,12 @@ for (size_t i = 0; i < a.size(); ++i)
122
122
  printf("%d\t%d\t%d\n", tree.start(a[i]), tree.end(a[i]), tree.data(a[i]));
123
123
  ```
124
124
 
125
+ ## Cite cgranges
126
+
127
+ This library is integrated into [bedtk][bedtk], which is published in:
128
+ > Li H and Rong J (2021) Bedtk: finding interval overlap with implicit interval tree.
129
+ > *Bioinformatics*, **37**:1315-1316
130
+
125
131
  [bedcov]: https://bedtools.readthedocs.io/en/latest/content/tools/coverage.html
126
132
  [ekg-itree]: https://github.com/ekg/intervaltree
127
133
  [quicksect]: https://github.com/brentp/quicksect
@@ -131,3 +137,4 @@ for (size_t i = 0; i < a.size(); ++i)
131
137
  [bheap]: https://en.wikipedia.org/wiki/Binary_heap
132
138
  [ailist]: https://www.biorxiv.org/content/10.1101/593657v1
133
139
  [kerneltree]: https://github.com/biocore-ntnu/kerneltree
140
+ [bedtk]: https://github.com/lh3/bedtk
@@ -75,7 +75,7 @@ cgranges_memsize(const void *ptr)
75
75
  return data ? sizeof(*data) : 0;
76
76
  }
77
77
 
78
- static cgranges_t *get_cganges(VALUE self)
78
+ static cgranges_t *get_cgranges(VALUE self)
79
79
  {
80
80
  cgranges_t *ptr = NULL;
81
81
  TypedData_Get_Struct(self, cgranges_t, &cgranges_type, ptr);
@@ -120,7 +120,7 @@ cgranges_init(VALUE self)
120
120
  static VALUE
121
121
  cgranges_add(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en, VALUE rb_label)
122
122
  {
123
- cgranges_t *cr = get_cganges(self);
123
+ cgranges_t *cr = get_cgranges(self);
124
124
  cr_intv_t *intv = NULL;
125
125
  char *ctg = NULL;
126
126
  int32_t st = 0;
@@ -162,7 +162,7 @@ cgranges_index(VALUE self)
162
162
  return Qnil;
163
163
  }
164
164
 
165
- cgranges_t *cr = get_cganges(self);
165
+ cgranges_t *cr = get_cgranges(self);
166
166
  cr_index(cr);
167
167
 
168
168
  rb_ivar_set(self, rb_intern("@indexed"), Qtrue);
@@ -180,7 +180,7 @@ cgranges_index(VALUE self)
180
180
  static VALUE
181
181
  cgranges_overlap(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
182
182
  {
183
- cgranges_t *cr = get_cganges(self);
183
+ cgranges_t *cr = get_cgranges(self);
184
184
  char *ctg = NULL;
185
185
  int32_t st = 0;
186
186
  int32_t en = 0;
@@ -203,6 +203,7 @@ cgranges_overlap(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
203
203
 
204
204
  if (n < 0)
205
205
  {
206
+ free(b);
206
207
  rb_raise(rb_eRuntimeError, "Error finding overlaps");
207
208
  return Qnil;
208
209
  }
@@ -230,7 +231,7 @@ cgranges_overlap(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
230
231
  static VALUE
231
232
  cgranges_count_overlap(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
232
233
  {
233
- cgranges_t *cr = get_cganges(self);
234
+ cgranges_t *cr = get_cgranges(self);
234
235
  char *ctg = NULL;
235
236
  int32_t st = 0;
236
237
  int32_t en = 0;
@@ -253,6 +254,7 @@ cgranges_count_overlap(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
253
254
 
254
255
  if (n < 0)
255
256
  {
257
+ free(b);
256
258
  rb_raise(rb_eRuntimeError, "Error finding overlaps");
257
259
  return Qnil;
258
260
  }
@@ -271,7 +273,7 @@ cgranges_count_overlap(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
271
273
  static VALUE
272
274
  cgranges_contain(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
273
275
  {
274
- cgranges_t *cr = get_cganges(self);
276
+ cgranges_t *cr = get_cgranges(self);
275
277
  char *ctg = NULL;
276
278
  int32_t st = 0;
277
279
  int32_t en = 0;
@@ -294,6 +296,7 @@ cgranges_contain(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
294
296
 
295
297
  if (n < 0)
296
298
  {
299
+ free(b);
297
300
  rb_raise(rb_eRuntimeError, "Error finding contained");
298
301
  return Qnil;
299
302
  }
@@ -321,7 +324,7 @@ cgranges_contain(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
321
324
  static VALUE
322
325
  cgranges_count_contain(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
323
326
  {
324
- cgranges_t *cr = get_cganges(self);
327
+ cgranges_t *cr = get_cgranges(self);
325
328
  char *ctg = NULL;
326
329
  int32_t st = 0;
327
330
  int32_t en = 0;
@@ -344,6 +347,7 @@ cgranges_count_contain(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
344
347
 
345
348
  if (n < 0)
346
349
  {
350
+ free(b);
347
351
  rb_raise(rb_eRuntimeError, "Error finding contained");
348
352
  return Qnil;
349
353
  }
@@ -355,7 +359,7 @@ cgranges_count_contain(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en)
355
359
  static VALUE
356
360
  cgranges_coverage(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en, int contain)
357
361
  {
358
- cgranges_t *cr = get_cganges(self);
362
+ cgranges_t *cr = get_cgranges(self);
359
363
  char *ctg = NULL;
360
364
  int32_t st1 = 0;
361
365
  int32_t en1 = 0;
@@ -386,6 +390,7 @@ cgranges_coverage(VALUE self, VALUE rb_ctg, VALUE rb_st, VALUE rb_en, int contai
386
390
 
387
391
  if (n < 0)
388
392
  {
393
+ free(b);
389
394
  rb_raise(rb_eRuntimeError, "Error finding overlaps");
390
395
  return Qnil;
391
396
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bio
4
4
  class CGRanges
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-cgranges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Genomic interval overlap queries
14
14
  email:
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubygems_version: 3.4.10
53
+ rubygems_version: 3.5.16
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: Ruby bindings for lh3/cgranges