diff --git a/README.md b/README.md index 300755d..a9a5bbd 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,9 @@ $ chakin feature load_fasta \ ## History +- 2.3.9 + - URL decode GFF ids when loading blast/interpro/others + - 2.3.8 - Fix connection closed error when loading big interproscan files diff --git a/chado/client.py b/chado/client.py index 51ea42c..a32ddbf 100644 --- a/chado/client.py +++ b/chado/client.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import re +from urllib.parse import unquote from chado.exceptions import RecordNotFoundError @@ -116,15 +117,22 @@ def _match_feature(self, feature_id, re_name, query_type, organism_id, skip_miss re_res = re.search(re_name, feature_id) if re_res: feature_id = re_res.group(1) + else: + re_res = re.search(re_name, unquote(feature_id)) + if re_res: + feature_id = re_res.group(1) cache_id = (feature_id, organism_id, seqterm) if cache_id not in self._feature_cache: - if skip_missing: - warn('Could not find feature with name "%s", skipping it', feature_id) - return None - else: - raise RecordNotFoundError('Could not find feature with name "%s"' % feature_id) + # Check after decoding + cache_id = (unquote(feature_id), organism_id, seqterm) + if cache_id not in self._feature_cache: + if skip_missing: + warn('Could not find feature with name "%s", skipping it', feature_id) + return None + else: + raise RecordNotFoundError('Could not find feature with name "%s"' % feature_id) return self._feature_cache[cache_id]['feature_id'] diff --git a/setup.py b/setup.py index 9aad9f2..bc2c4ed 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="chado", - version='2.3.8', + version='2.3.9', description="Chado library", author="Anthony Bretaudeau", author_email="anthony.bretaudeau@inrae.fr",