Codes

1. Python script to download RSCC (Real Space Correlation Coefficient) value from PDB ID

# Download all the dependencies 
 
import urllib
import urllib.request
from bs4 import BeautifulSoup
import xlwt

wd = xlwt.Workbook()
wd = xlwt.Workbook ()
sh = wd.add_sheet ("Sheet_2")
file = open ("myfile.txt", "w")

def dwnld(url):
    thepage = urllib.request.urlopen(url)
    soupdata = BeautifulSoup(thepage, "html.parser")
    return soupdata

sh.write(0,0, "PDB Codes")
sh.write(0,1, "Ligands")
sh.write(0,2, "Chain ID")
sh.write(0,3, "Residue")
sh.write(0,4, "RSCC")

s_list = [
'5t29',
'5t3s',
'5t5b',
'5t6l',
'5t6n',
'5t6s',
'6aov'] # replace these ID's with yours row = 0
for s in s_list:
   
    sh.write(row+2, 0, s)

    datasaved = ""
    soup = dwnld("http://eds.bmc.uu.se/cgi-bin/eds/realr?pdbCode=" + s + "&type=1&NBINS=50&SPACE=2&plot=C")
    if soup.findAll('tr'):
        for record in soup.findAll('tr'):
            dwnlddata = ""
            col = 0
            row += 1
            for data in record.findAll('td')[0:4]:
                col += 1
                sh.write(row, col, data.text)

                dwnlddata = dwnlddata + "," + data.text
            datasaved = datasaved + "\n" + dwnlddata[1:]
        #print(datasaved)
     
    else:
        x="EDS was not executed"
        print (x)
        sh.write(row+2,col,x)
    row += 1
print ("done")
wd.save("wdfile1.xls")
file.close()

# finally you'll get an output file "wdfile.xls" having PDB IDs, Ligands and RSCC value respectively.