bio-bigwig 0.1.0 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 972d5cd642441b8881267966c288fec25708aba244c7aa8ca2618d0888ca769e
4
- data.tar.gz: 328fd1c1d6f0705a8eef2144c1f4894b9f27bc58d35c5e3e20ea15fd58e4e776
3
+ metadata.gz: b9937e02151804bc5a6440481d7e6ec99ff411e474f04c6889b86d6a396287f5
4
+ data.tar.gz: ec2cef28451cb57e4cfd3e49436f86e64e248a804032b40e8cff3f4817f9bc98
5
5
  SHA512:
6
- metadata.gz: 40ede32f219724178e4076ede669ab89f2d68065ff5becf16f84b7e8d6c2b0636d3a3c51bf1d0d3f3a29b37dbacf232a167bccf838882e6d946c35779fa8c075
7
- data.tar.gz: 608f3bf25e5b549ad6c31d7bf41f6a8d7b55f735721ccf19a33843390e6038bd1b0fbdc28693c9321101de9aa54495952e2565700fe38bc30097e8e7d979f6e3
6
+ metadata.gz: c3110386fbb9c9c9b892a934abc6ac5f66b10049e4c6a69cd23727a2e7a83ac111a6801122e1c49619e5b905ef06a87c27a5c1696111a6c7121e5c5afd0b4013
7
+ data.tar.gz: c77e2b59ab87c285b111f46d466f8e71272355666ac3940253675536e58f1c0a4cbc3d2ed6a971558c53b4e1201c2a0340ff75b842335f176722ff6dfe023402
@@ -2,6 +2,7 @@ require "mkmf"
2
2
 
3
3
  # check curl
4
4
  have_library("curl", "curl_easy_init")
5
+ have_library("z", "uncompress", "zlib.h")
5
6
  have_header("libbigwig/bigWig.h")
6
7
 
7
8
  $srcs = Dir.glob("libBigWig/*.c", base: __dir__)
@@ -56,7 +56,7 @@ extern "C" {
56
56
  /*!
57
57
  * The library version number
58
58
  */
59
- #define LIBBIGWIG_VERSION 0.4.8
59
+ #define LIBBIGWIG_VERSION 0.4.10
60
60
 
61
61
  /*!
62
62
  * If 1, then this library was compiled with remote file support.
@@ -487,7 +487,7 @@ bbOverlappingEntries_t *bbGetOverlappingEntriesCore(bigWigFile_t *fp, bwOverlapB
487
487
  uint64_t i;
488
488
  int compressed = 0, rv, slen;
489
489
  uLongf sz = fp->hdr->bufSize, tmp = 0;
490
- void *buf = NULL, *bufEnd = NULL, *compBuf = NULL;
490
+ void *buf = NULL, *bufBase = NULL, *bufEnd = NULL, *compBuf = NULL;
491
491
  uint32_t entryTid = 0, start = 0, end;
492
492
  char *str;
493
493
  bbOverlappingEntries_t *output = calloc(1, sizeof(bbOverlappingEntries_t));
@@ -499,7 +499,7 @@ bbOverlappingEntries_t *bbGetOverlappingEntriesCore(bigWigFile_t *fp, bwOverlapB
499
499
 
500
500
  if(sz) {
501
501
  compressed = 1;
502
- buf = malloc(sz);
502
+ bufBase = buf = malloc(sz);
503
503
  }
504
504
  sz = 0; //This is now the size of the compressed buffer
505
505
 
@@ -544,15 +544,14 @@ bbOverlappingEntries_t *bbGetOverlappingEntriesCore(bigWigFile_t *fp, bwOverlapB
544
544
  buf = (char*)bufEnd - tmp; //reset the buffer pointer
545
545
  }
546
546
 
547
- if(compressed && buf) free(buf);
547
+ if(compressed && bufBase) free(bufBase);
548
548
  if(compBuf) free(compBuf);
549
549
  return output;
550
550
 
551
551
  error:
552
552
  fprintf(stderr, "[bbGetOverlappingEntriesCore] Got an error\n");
553
- buf = (char*)bufEnd - tmp;
554
553
  if(output) bbDestroyOverlappingEntries(output);
555
- if(compressed && buf) free(buf);
554
+ if(compressed && bufBase) free(bufBase);
556
555
  if(compBuf) free(compBuf);
557
556
  return NULL;
558
557
  }
@@ -544,7 +544,7 @@ int bwAddIntervalSpanSteps(bigWigFile_t *fp, const char *chrom, uint32_t start,
544
544
  updateStats(fp, wb->span, values[i]);
545
545
  wb->l += 4;
546
546
  }
547
- wb->end = wb->start + (wb->l>>2) * step;
547
+ wb->end = wb->start + ((wb->l-24)>>2) * step;
548
548
 
549
549
  return 0;
550
550
  }
@@ -567,7 +567,7 @@ int bwAppendIntervalSpanSteps(bigWigFile_t *fp, const float *values, uint32_t n)
567
567
  updateStats(fp, wb->span, values[i]);
568
568
  wb->l += 4;
569
569
  }
570
- wb->end = wb->start + (wb->l>>2) * wb->step;
570
+ wb->end = wb->start + ((wb->l-24)>>2) * wb->step;
571
571
 
572
572
  return 0;
573
573
  }
@@ -209,6 +209,11 @@ URL_t *urlOpen(const char *fname, CURLcode (*callBack)(CURL*), const char *mode)
209
209
  fprintf(stderr, "[urlOpen] Failed instructing curl to use any HTTP authentication it finds to be suitable!\n");
210
210
  goto error;
211
211
  }
212
+ // set user-agent
213
+ if(curl_easy_setopt(URL->x.curl, CURLOPT_USERAGENT, "libBigWig") != CURLE_OK) {
214
+ fprintf(stderr, "[urlOpen] Failed instructing curl to use libBigWig as a user-agent!\n");
215
+ goto error;
216
+ }
212
217
  //Follow redirects
213
218
  if(curl_easy_setopt(URL->x.curl, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK) {
214
219
  fprintf(stderr, "[urlOpen] Failed instructing curl to follow redirects!\n");
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bio
4
4
  class BigWig
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-bigwig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 3.6.9
56
+ rubygems_version: 4.0.20
57
57
  specification_version: 4
58
58
  summary: A ruby library for accessing bigWig / bigBed files
59
59
  test_files: []