[med-svn] [Git][med-team/freebayes][master] 2 commits: match bedreader interface to new intervaltree

Andreas Tille gitlab at salsa.debian.org
Thu Dec 19 13:14:00 GMT 2019



Andreas Tille pushed to branch master at Debian Med / freebayes


Commits:
36e0b3c7 by Andreas Tille at 2019-12-19T11:51:10Z
match bedreader interface to new intervaltree

- - - - -
fc417bc9 by Andreas Tille at 2019-12-19T12:43:55Z
Another Python3 fix

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/1ad5cd64ac7270aac03d58d2dba0861ecc85b6b6.patch
- debian/patches/series
- debian/patches/vcffirstheader.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -9,10 +9,17 @@ freebayes (1.3.2-1) UNRELEASED; urgency=medium
   * Remove trailing whitespace in debian/copyright
   * Set upstream metadata fields: Repository, Repository-Browse.
   * Versioned Build-Depends: libseqlib-dev (>= 1.1.2+dfsg-5)
-  TODO: Does not build with Debian packaged libs.  Opened upstream issue
-       https://github.com/ekg/freebayes/issues/579
-
- -- Andreas Tille <tille at debian.org>  Tue, 17 Dec 2019 10:46:24 +0100
+  TODO:
+    t/01_call_variants.t ............... 
+    1..23
+    ...
+    not ok 16 - running in parallel makes no difference
+    #          got: '154'
+    #     expected: '0'
+    ...
+    Failed 1/23 subtests 
+
+ -- Andreas Tille <tille at debian.org>  Thu, 19 Dec 2019 12:51:28 +0100
 
 freebayes (1.3.1-1) unstable; urgency=medium
 


=====================================
debian/patches/1ad5cd64ac7270aac03d58d2dba0861ecc85b6b6.patch
=====================================
@@ -0,0 +1,101 @@
+From 1ad5cd64ac7270aac03d58d2dba0861ecc85b6b6 Mon Sep 17 00:00:00 2001
+From: Erik Garrison <erik.garrison at gmail.com>
+Date: Thu, 19 Dec 2019 11:03:01 +0100
+Subject: [PATCH] match bedreader interface to new intervaltree
+Origin: https://github.com/ekg/freebayes/pull/581/commits/1ad5cd64ac7270aac03d58d2dba0861ecc85b6b6
+
+---
+ src/BedReader.cpp | 16 ++++++----------
+ src/BedReader.h   | 10 +++++-----
+ src/Fasta.cpp     |  4 ++--
+ 3 files changed, 14 insertions(+), 18 deletions(-)
+
+--- a/src/BedReader.cpp
++++ b/src/BedReader.cpp
+@@ -46,32 +46,28 @@ vector<BedTarget> BedReader::entries(voi
+ }
+ 
+ bool BedReader::targetsContained(string& seq, long left, long right) {
+-    vector<Interval<BedTarget*> > results;
+-    intervals[seq].findContained(left, right, results);
++    vector<Interval<int, BedTarget*> > results = intervals[seq].findContained(left, right);
+     return !results.empty();
+ }
+ 
+ bool BedReader::targetsOverlap(string& seq, long left, long right) {
+-    vector<Interval<BedTarget*> > results;
+-    intervals[seq].findOverlapping(left, right, results);
++    vector<Interval<int, BedTarget*> > results = intervals[seq].findOverlapping(left, right);
+     return !results.empty();
+ }
+ 
+ vector<BedTarget*> BedReader::targetsContaining(BedTarget& target) {
+-    vector<Interval<BedTarget*> > results;
+-    intervals[target.seq].findContained(target.left, target.right, results);
++    vector<Interval<int, BedTarget*> > results = intervals[target.seq].findContained(target.left, target.right);
+     vector<BedTarget*> contained;
+-    for (vector<Interval<BedTarget*> >::iterator r = results.begin(); r != results.end(); ++r) {
++    for (vector<Interval<int, BedTarget*> >::iterator r = results.begin(); r != results.end(); ++r) {
+         contained.push_back(r->value);
+     }
+     return contained;
+ }
+ 
+ vector<BedTarget*> BedReader::targetsOverlapping(BedTarget& target) {
+-    vector<Interval<BedTarget*> > results;
+-    intervals[target.seq].findOverlapping(target.left, target.right, results);
++    vector<Interval<int, BedTarget*> > results = intervals[target.seq].findOverlapping(target.left, target.right);
+     vector<BedTarget*> overlapping;
+-    for (vector<Interval<BedTarget*> >::iterator r = results.begin(); r != results.end(); ++r) {
++    for (vector<Interval<int, BedTarget*> >::iterator r = results.begin(); r != results.end(); ++r) {
+         overlapping.push_back(r->value);
+     }
+     return overlapping;
+--- a/src/BedReader.h
++++ b/src/BedReader.h
+@@ -38,7 +38,7 @@ class BedReader : public ifstream {
+ 
+ public:
+     vector<BedTarget> targets;
+-    map<string, IntervalTree<BedTarget*> > intervals; // intervals by reference sequence
++    map<string, IntervalTree<int, BedTarget*> > intervals; // intervals by reference sequence
+ 
+     vector<BedTarget> entries(void);
+ 
+@@ -60,12 +60,12 @@ public:
+     }
+ 
+     void buildIntervals(void) {
+-        map<string, vector<Interval<BedTarget*> > > intervalsBySeq;
++        map<string, IntervalTree<int, BedTarget*>::interval_vector> intervalsBySeq;
+         for (vector<BedTarget>::iterator t = targets.begin(); t != targets.end(); ++t) {
+-            intervalsBySeq[t->seq].push_back(Interval<BedTarget*>(t->left, t->right, &*t));
++            intervalsBySeq[t->seq].push_back(Interval<int, BedTarget*>(t->left, t->right, &*t));
+         }
+-        for (map<string, vector<Interval<BedTarget*> > >::iterator s = intervalsBySeq.begin(); s != intervalsBySeq.end(); ++s) {
+-            intervals[s->first] = IntervalTree<BedTarget*>(s->second);
++        for (map<string, IntervalTree<int, BedTarget*>::interval_vector>::const_iterator s = intervalsBySeq.begin(); s != intervalsBySeq.end(); ++s) {
++            intervals[s->first] = IntervalTree<int, BedTarget*>((IntervalTree<int, BedTarget*>::interval_vector&&)s->second);
+         }
+     }
+ 
+--- a/src/Fasta.cpp
++++ b/src/Fasta.cpp
+@@ -262,7 +262,7 @@ string FastaReference::getRawSequence(st
+     int seqlen = newlines_in_sequence  + entry.length;
+     char* seq = (char*) calloc (seqlen + 1, sizeof(char));
+     fseek64(file, entry.offset, SEEK_SET);
+-    fread(seq, sizeof(char), seqlen, file);
++    size_t x = fread(seq, sizeof(char), seqlen, file);
+     seq[seqlen] = '\0';
+     char* pbegin = seq;
+     char* pend = seq + (seqlen/sizeof(char));
+@@ -305,7 +305,7 @@ string FastaReference::getRawSubSequence
+     int seqlen = length + newlines_inside;
+     char* seq = (char*) calloc (seqlen + 1, sizeof(char));
+     fseek64(file, (off_t) (entry.offset + newlines_before + start), SEEK_SET);
+-    fread(seq, sizeof(char), (off_t) seqlen, file);
++    size_t x = fread(seq, sizeof(char), (off_t) seqlen, file);
+     seq[seqlen] = '\0';
+     char* pbegin = seq;
+     char* pend = seq + (seqlen/sizeof(char));


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@ fix_test.patch
 vcffirstheader.patch
 skip_failing_test.patch
 2to3.patch
+1ad5cd64ac7270aac03d58d2dba0861ecc85b6b6.patch


=====================================
debian/patches/vcffirstheader.patch
=====================================
@@ -11,7 +11,7 @@ Description: This script was not part of the vcflib release
 --- /dev/null
 +++ b/vcflib/scripts/vcffirstheader
 @@ -0,0 +1,16 @@
-+#!/usr/bin/env python
++#!/usr/bin/python3
 +
 +import sys
 +
@@ -19,11 +19,11 @@ Description: This script was not part of the vcflib release
 +for line in sys.stdin:
 +    if line.startswith('##'):
 +        if header:
-+            print line.strip()
++            print(line.strip())
 +        continue
 +    elif line.startswith('#'):
 +        if header:
-+           print line.strip()
++           print(line.strip())
 +           header=False
 +        continue
-+    print line.strip()
++    print(line.strip())



View it on GitLab: https://salsa.debian.org/med-team/freebayes/compare/6a92209981ebf43bad7a0a18dada4c83bf5a1a45...fc417bc9b1270fb0c6887fcc883d3b34b163e91a

-- 
View it on GitLab: https://salsa.debian.org/med-team/freebayes/compare/6a92209981ebf43bad7a0a18dada4c83bf5a1a45...fc417bc9b1270fb0c6887fcc883d3b34b163e91a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191219/886efde7/attachment-0001.html>


More information about the debian-med-commit mailing list