Latest version
This commit is contained in:
parent
7a60569631
commit
410ba6c4af
4 changed files with 15 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,3 +2,6 @@
|
||||||
.cache*
|
.cache*
|
||||||
*vcs.xml
|
*vcs.xml
|
||||||
sample_data/*
|
sample_data/*
|
||||||
|
local-test.py
|
||||||
|
.DS_Store
|
||||||
|
*.pyc
|
||||||
|
|
0
__init__.py
Normal file
0
__init__.py
Normal file
|
@ -69,8 +69,15 @@ class ResidueIndexes(object):
|
||||||
"""
|
"""
|
||||||
chain_id = chain_data["chain_label"]
|
chain_id = chain_data["chain_label"]
|
||||||
url = "%s%s/chain/%s" % (self.api_url, self.pdb_id, chain_id)
|
url = "%s%s/chain/%s" % (self.api_url, self.pdb_id, chain_id)
|
||||||
|
try:
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
try:
|
||||||
residue_numbering = json.loads(response.text)
|
residue_numbering = json.loads(response.text)
|
||||||
|
except:
|
||||||
|
print("Failed to load residues from PDBe API")
|
||||||
|
return False
|
||||||
if not residue_numbering.keys():
|
if not residue_numbering.keys():
|
||||||
self.mismatches.append("No residues in PDB for this entry - probably obsoleted entry")
|
self.mismatches.append("No residues in PDB for this entry - probably obsoleted entry")
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -87,8 +87,8 @@ class Validator(object):
|
||||||
with open(path, "r") as json_file:
|
with open(path, "r") as json_file:
|
||||||
try:
|
try:
|
||||||
return json.load(json_file)
|
return json.load(json_file)
|
||||||
except json.decoder.JSONDecodeError as err:
|
except:
|
||||||
self.error_log = "JSON error: %s" % err
|
self.error_log = "JSON error: %s" % path
|
||||||
return None
|
return None
|
||||||
except IOError as ioerr:
|
except IOError as ioerr:
|
||||||
self.error_log = "File error: %s" % ioerr
|
self.error_log = "File error: %s" % ioerr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue