Skip to content

Commit

Permalink
Fix pfam description annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
prihoda committed Oct 1, 2019
1 parent 8a64366 commit 4a6d6de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deepbgc/pipeline/pfam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/pipeline/test_integration_pfam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 4a6d6de

Please sign in to comment.