This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Get PDB files from UniProt IDs

Hi!

I have more than 1000 UniProt IDs that look like these:

O75771
Q8N183

And I was wondering is there is a way to download the PDB files from this list of UniProt IDs?

So far, and from the ID Mapping service of UniProt https://www.uniprot.org/id-mapping, as I understand is only possible to map from UniProt to PDB IDs, but not to get the .pdb files directly.

protein-structure uniprot pdb proteins

1 answer

Assuming you have a list of PDB IDs in a file pdb_ids, this should do the trick:

cat pdb_ids | xargs -i wget -q -o /dev/null ftp://ftp.ebi.ac.uk/pub/databases/msd/pdb_uncompressed/pdb"{}".ent

This may take a while if you are getting 1000 files, so you may want to add & at the end and run the command in the background.

Working through combining this approach with Unipressed use to query UniProt, prompted me to finally start a Jupyter Notebook where you can run all this without touching your own machine in a temporary session back by the MyBinder service. Currently, the only fully annotated example there is this.
To try it out, go here and click any 'launch binder' badge to get started. Alternatively, just click here to launch a session directly from here.
Then step through running the notebook cells in the first example section.

The dull, static form of the notebook can be viewed here, but please use the active one above for maximum enjoyment.

Log in to answer this question.