Skip to content

Commit

Permalink
fix UniProtKB DbXrefs #69
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwengers committed Aug 13, 2021
1 parent 245558e commit fc4c74c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 0 additions & 4 deletions bakta/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
############################################################################
# DB identifiers
############################################################################
DB_XREF_UNIREF_100 = 'UniRef100'
DB_XREF_UNIREF_90 = 'UniRef90'
DB_XREF_UNIREF_50 = 'UniRef50'
DB_XREF_UNIPARC = 'UniParc'
DB_XREF_UNIPROTKB = 'UniProtKB'
DB_XREF_REFSEQ_NRP = 'RefSeq'
DB_XREF_EC = 'EC'
Expand Down
4 changes: 2 additions & 2 deletions bakta/ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def parse_annotation(rec):
}
db_xrefs = [
'SO:0001217',
f'{bc.DB_XREF_UNIREF_100}:{ips[DB_IPS_COL_UNIREF100]}'
f'{bc.DB_XREF_UNIPROTKB}:{ips[DB_IPS_COL_UNIREF100]}'
]

# add non-empty PSC annotations and attach database prefixes to identifiers
Expand All @@ -84,7 +84,7 @@ def parse_annotation(rec):
ips[DB_IPS_COL_PRODUCT] = rec[DB_IPS_COL_PRODUCT]
if(rec[DB_IPS_COL_UNIREF90]):
ips[DB_IPS_COL_UNIREF90] = bc.DB_PREFIX_UNIREF_90 + rec[DB_IPS_COL_UNIREF90]
db_xrefs.append(f'{bc.DB_XREF_UNIREF_90}:{ips[DB_IPS_COL_UNIREF90]}')
db_xrefs.append(f'{bc.DB_XREF_UNIPROTKB}:{ips[DB_IPS_COL_UNIREF90]}')
if(rec[DB_IPS_COL_EC]):
ips[DB_IPS_COL_EC] = rec[DB_IPS_COL_EC]
ecs = []
Expand Down
4 changes: 2 additions & 2 deletions bakta/psc.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def parse_annotation(rec):
}
db_xrefs = [
'SO:0001217',
f'{bc.DB_XREF_UNIREF_90}:{psc[DB_PSC_COL_UNIREF90]}'
f'{bc.DB_XREF_UNIPROTKB}:{psc[DB_PSC_COL_UNIREF90]}'
]

# add non-empty PSC annotations and attach database prefixes to identifiers
Expand All @@ -162,7 +162,7 @@ def parse_annotation(rec):
psc[DB_PSC_COL_EC] = ecs
if(rec[DB_PSC_COL_UNIREF50]):
psc[DB_PSC_COL_UNIREF50] = bc.DB_PREFIX_UNIREF_50 + rec[DB_PSC_COL_UNIREF50]
db_xrefs.append(f'{bc.DB_XREF_UNIREF_50}:{psc[DB_PSC_COL_UNIREF50]}')
db_xrefs.append(f'{bc.DB_XREF_UNIPROTKB}:{psc[DB_PSC_COL_UNIREF50]}')
if(rec[DB_PSC_COL_COG_ID]):
psc[DB_PSC_COL_COG_ID] = bc.DB_PREFIX_COG + rec[DB_PSC_COL_COG_ID]
db_xrefs.append(f'{bc.DB_XREF_COG}:{psc[DB_PSC_COL_COG_ID]}')
Expand Down
4 changes: 2 additions & 2 deletions bakta/ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def parse_annotation(rec):
# add non-empty PSC annotations and attach database prefixes to identifiers
if(rec[DB_UPS_COL_UNIPARC]):
ups[DB_UPS_COL_UNIPARC] = bc.DB_PREFIX_UNIPARC + rec[DB_UPS_COL_UNIPARC]
db_xrefs.append(f'{bc.DB_XREF_UNIPARC}:{ups[DB_UPS_COL_UNIPARC]}')
db_xrefs.append(f'{bc.DB_XREF_UNIPROTKB}:{ups[DB_UPS_COL_UNIPARC]}')
if(rec[DB_UPS_COL_REFSEQ_NRP]):
ups[DB_UPS_COL_REFSEQ_NRP] = bc.DB_PREFIX_REFSEQ_NRP + rec[DB_UPS_COL_REFSEQ_NRP]
db_xrefs.append(f'{bc.DB_XREF_REFSEQ_NRP}:{ups[DB_UPS_COL_REFSEQ_NRP]}')
if(rec[DB_UPS_COL_UNIREF100]):
ups[DB_UPS_COL_UNIREF100] = bc.DB_PREFIX_UNIREF_100 + rec[DB_UPS_COL_UNIREF100]
db_xrefs.append(f'{bc.DB_XREF_UNIREF_100}:{ups[DB_UPS_COL_UNIREF100]}')
db_xrefs.append(f'{bc.DB_XREF_UNIPROTKB}:{ups[DB_UPS_COL_UNIREF100]}')

ups['db_xrefs'] = db_xrefs
return ups

0 comments on commit fc4c74c

Please sign in to comment.