I am trying to find a way to download PDB files of proteins using BindingDB. I have a file with different BindingDB IDs, and I want to download PDB files for every ligand that binds to the protein for each ID.
I was using a script to download specific PDB files from RSCB: PDB. Now I have to do the same, but I have BindingDB IDs.
The previous script that I used looks like this:
#! usr/bin/perl -w
open (NDX, 'file.txt');
@ndx_ar = <NDX>;
close NDX;
$ndx_sz = scalar @ndx_ar;
for ( $c = 0; $c < $ndx_sz; ++$c ) {
chomp $ndx_ar[$c];
if ( $ndx_ar[$c] =~ /pdb/ ) {
$ndx_ar[$c] =~ s/.pdb//;
`wget 'http://www.pdb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId=$ndx_ar[$c]' -O $ndx_ar[$c].pdb`;
}
else {
`wget 'http://www.pdb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId=$ndx_ar[$c]' -O $ndx_ar[$c].pdb`;
}
}
exit;