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