From 4a6d6def5edf927fc49ff00087afbd9a26f7e65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20P=C5=99=C3=ADhoda?= Date: Tue, 1 Oct 2019 08:46:10 +0200 Subject: [PATCH] Fix pfam description annotation --- deepbgc/pipeline/pfam.py | 4 +++- test/integration/pipeline/test_integration_pfam.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deepbgc/pipeline/pfam.py b/deepbgc/pipeline/pfam.py index 5424bc9..4a07765 100644 --- a/deepbgc/pipeline/pfam.py +++ b/deepbgc/pipeline/pfam.py @@ -94,6 +94,7 @@ def annotate(self): # Read descriptions from Pfam clan TSV pfam_descriptions = self._get_pfam_descriptions() + print('DESCRIPTIONS: {}'.format(pfam_descriptions)) # Extract all matched domain hits num = 0 @@ -117,7 +118,8 @@ def annotate(self): 'locus_tag': [query.id], 'database': [PFAM_DB_VERSION], } - description = pfam_descriptions.get(pfam_id) + short_pfam_id = pfam_id.rsplit('.', maxsplit=1)[0] + description = pfam_descriptions.get(short_pfam_id) if description: qualifiers['description'] = [description] pfam = SeqFeature( diff --git a/test/integration/pipeline/test_integration_pfam.py b/test/integration/pipeline/test_integration_pfam.py index 54c5b01..389628e 100644 --- a/test/integration/pipeline/test_integration_pfam.py +++ b/test/integration/pipeline/test_integration_pfam.py @@ -29,6 +29,6 @@ def test_integration_pfam_annotator(tmpdir): assert pfam.qualifiers.get('db_xref') == ['PF00005.26'] assert pfam.qualifiers.get('locus_tag') == ['AAK73498.1'] assert pfam.qualifiers.get('description') == ['ABC transporter'] - assert pfam.qualifiers.get('database') == ['Pfam-A.31.0.hmm'] + assert pfam.qualifiers.get('database') == ['31.0'] assert_sorted_features(record) \ No newline at end of file