From fc7bd8c5845ca569c97c58a32466b3f2e2fd29b7 Mon Sep 17 00:00:00 2001
From: Martijn Vermaat <martijn@vermaat.name>
Date: Tue, 8 Mar 2016 16:12:43 +0100
Subject: [PATCH] Update description-extractor to 2.3.2

Mutalyzer used the `reverse_complement` function from the description
extractor, which was a unicode string-only implementation.

With this update, that implementation was removed and the BioPython
reverse complement function used instead in the description
extractor. Unfortunately this cannot work with unicode strings, so we
now use our own `reverse_complement` which works on unicode strings.
---
 mutalyzer/util.py | 14 +++++++++++++-
 requirements.txt  |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/mutalyzer/util.py b/mutalyzer/util.py
index c5810a9f..f69f966c 100644
--- a/mutalyzer/util.py
+++ b/mutalyzer/util.py
@@ -29,11 +29,23 @@ import operator
 import sys
 import time
 
+from Bio import Seq
 from Bio import SeqIO
 from Bio.SeqUtils import seq3
 
 # NOTE: This is a temporary fix.
-from extractor.describe import reverse_complement, palinsnoop, roll
+from extractor.describe import palinsnoop, roll
+
+
+def reverse_complement(sequence):
+    """
+    Reverse complement of a sequence represented as unicode string.
+
+    Unfortunately, BioPython's reverse_complement doesn't work on unicode
+    strings. We work almost exclusively with unicode strings, so this is a
+    convenience wrapper.
+    """
+    return unicode(Seq.reverse_complement(str(sequence)))
 
 
 def is_utf8_alias(encoding):
diff --git a/requirements.txt b/requirements.txt
index 250f4ff1..51398dc6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,7 +11,7 @@ backtranslate==0.0.5
 biopython==1.66
 chardet==2.3.0
 cssselect==0.9.1
-description-extractor==2.2.1
+description-extractor==2.3.2
 interval-binning==1.0.0
 lxml==3.4.4
 mock==1.3.0
-- 
GitLab