Skip to content

Commit

Permalink
Merge pull request #1296 from jamesmkrieger/pfam_fixes
Browse files Browse the repository at this point in the history
pfam fixes for 4nq8
  • Loading branch information
jamesmkrieger authored Feb 5, 2021
2 parents 2be68c2 + 3c4b11c commit 639c965
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions prody/database/pfam.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

__author__ = 'Anindita Dutta, Ahmet Bakan, Cihan Kaya'

from prody.dynamics.analysis import calcFracDimension
import re
from numbers import Integral

Expand Down Expand Up @@ -222,6 +223,7 @@ def searchPfam(query, **kwargs):
elif xml.find(b'No valid UniProt accession or ID') > 0:
try:
url = prefix + 'protein/' + accession + '?output=xml'
LOGGER.debug('Retrieving Pfam search results: ' + url)
xml = openURL(url, timeout=timeout).read()
except:
try:
Expand All @@ -230,6 +232,19 @@ def searchPfam(query, **kwargs):
return searchPfam(ag_seq)
except:
raise ValueError('No valid UniProt accession or ID for: ' + seq)

if xml.find(b'No valid UniProt accession or ID') > 0:
try:
url = 'https://uniprot.org/uniprot/' + accession + '.xml'
xml = openURL(url, timeout=timeout).read()
root = ET.XML(xml)
accession = root[0][0].text

url = prefix + 'protein/' + accession + '?output=xml'
LOGGER.debug('Retrieving Pfam search results: ' + url)
xml = openURL(url, timeout=timeout).read()
except:
raise ValueError('No valid UniProt accession or ID for: ' + seq)

try:
root = ET.XML(xml)
Expand Down

0 comments on commit 639c965

Please sign in to comment.