diff --git a/mutalyzer/util.py b/mutalyzer/util.py index c5810a9fe128c16ef52554435e02fa8fffc0a319..f69f966c77872a945216c31e92c276f36a4df587 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 250f4ff139bdd182f2e46a2688709b7c91db59c7..51398dc6f79cc9b1ffdc8567d1fd538e63c4e368 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