This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Downloading SDF files using PDB id - PDB/SDF pair dataset

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

0 answers

No answers yet.

Log in to answer this question.