Downloading SDF files using PDB id - PDB/SDF pair dataset
0
0
Entering edit mode
23 months ago

There are some ways to download SDF files using PDB id for example I will share one of them below

1-

import requests

def download_sdf(pdb_id):
    # Set the URL for the RCSB API
    url = f'https://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=sdf&compression=NO&structureId={pdb_id}'


# Make a GET request to the API
response = requests.get(url)

# Check the status code of the response
if response.status_code == 200:
    # Save the SDF file to the current directory
    with open(f'{pdb_id}.sdf', 'wb') as f:
        f.write(response.content)
    print(f'SDF file for {pdb_id} saved successfully.')
else:
    print(f'Error downloading SDF file for {pdb_id}.')
download_sdf('1c5n')

My question

I can't find almost all of the sdfs related to the pdb ids I gave. Is there a place where I can download both the pdb file and the sdf file, which is its pair, in Python or directly as a zip file or any code suggestion is also suitable for me.

NOTE: SDF should have the binding coordinates of the relevant protein in the X, Y, Z plane.

protein python sdf • 799 views
ADD COMMENT

Login before adding your answer.

Traffic: 2253 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6