Skip to content

Commit

Permalink
Fixed REST API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
gbayarri committed May 7, 2024
1 parent 726fb7a commit 1be1704
Show file tree
Hide file tree
Showing 6 changed files with 43,674 additions and 32,051 deletions.
6 changes: 3 additions & 3 deletions biobb_io/api/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def download_ligand(ligand_code, api_id, out_log=None, global_log=None):
url = "http://mmb.irbbarcelona.org/api/pdbMonomer/" + ligand_code.lower()
text = requests.get(url, verify=False).content.decode('utf-8')
elif api_id == 'pdbe':
url = "ftp://ftp.ebi.ac.uk/pub/databases/msd/pdbechem_v2/{0}/{1}/{1}_ideal.pdb".format(ligand_code.upper()[0], ligand_code.upper())
url = "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/" + ligand_code.upper() + "_ideal.pdb"
text = urllib.request.urlopen(url).read().decode('utf-8')

fu.log("Downloading %s from: %s" % (ligand_code, url), out_log, global_log)
Expand Down Expand Up @@ -166,10 +166,10 @@ def download_ideal_sdf(ligand_code, api_id, out_log=None, global_log=None):
"""

if api_id == 'pdb':
url = "https://files.rcsb.org/ligands/view/" + ligand_code.upper() + "_ideal.sdf"
url = "https://files.rcsb.org/ligands/download/" + ligand_code.upper() + "_ideal.sdf"
text = requests.get(url, verify=False).content.decode('utf-8')
elif api_id == 'pdbe':
url = "ftp://ftp.ebi.ac.uk/pub/databases/msd/pdbechem_v2/{0}/{1}/{1}_ideal.sdf".format(ligand_code.upper()[0], ligand_code.upper())
url = "https://www.ebi.ac.uk/pdbe/static/files/pdbechem_v2/" + ligand_code.upper() + "_ideal.sdf"
text = urllib.request.urlopen(url).read().decode('utf-8')

fu.log("Downloading %s from: %s" % (ligand_code, url), out_log, global_log)
Expand Down
12 changes: 6 additions & 6 deletions biobb_io/test/reference/api/output_binding_site.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"ligand_residues": [
{
"author_insertion_code": null,
"author_residue_number": null,
"chain_id": null,
"chem_comp_id": null,
"entity_id": null,
"residue_number": null,
"struct_asym_id": null
"author_residue_number": 9001,
"chain_id": "A",
"chem_comp_id": "1C9",
"entity_id": 2,
"residue_number": 1,
"struct_asym_id": "B"
}
],
"site_id": "AC1",
Expand Down
2 changes: 1 addition & 1 deletion biobb_io/test/reference/api/output_ligand.pdb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HEADER Ideal coordinates
for PDB-CCD IBP
COMPND IBP
AUTHOR pdbccdutils 0.8.0
AUTHOR pdbccdutils 0.8.4
AUTHOR RDKit 2023.03.3
HETATM 1 C1 IBP A 1 -0.364 -0.176 -3.442 1.00 20.00 C
HETATM 2 C2 IBP A 1 -0.931 -0.349 2.970 1.00 20.00 C
Expand Down

0 comments on commit 1be1704

Please sign in to comment.