예제 #1
0
pdb_file = open(sys.argv[2], 'r')  #input file
out_file_protein = open(sys.argv[4], 'w')  #output file
out_file_ligand = open(sys.argv[6], 'w')
pdb_code = str(sys.argv[2])[:-4]  #changed to -4 by RB 13/07/10
out_file_cofactor = open(pdb_code + '_hetero.pdb', 'w')
out_file_protein_cofactor = open(
    pdb_code + '_volume.pdb', 'w')  # for contact area calculation with sybyl
db = str(sys.argv[8])
tb = str(sys.argv[10])
us = str(sys.argv[12])
pw = str(sys.argv[14])
wantedpacode = str(sys.argv[15])  # Added 02/07/2012 - Aurijit Sarkar
wantedpdb = str(sys.argv[16])
wantedlig = str(sys.argv[17])
conn = mysql.connect2server(pw, us, db)
cursor = conn.cursor()
#db = 'dataset_0709'
command = "select lig, cof, metal from " + tb + " where id = '" + wantedpdb + "' and pacode = '" + wantedpacode + "' and lig = '" + wantedlig + "' limit 1"
print command
cursor.execute(command)
rows = cursor.fetchall()

ligand = rows[0][0]
print ligand
cofactor = str(rows[0][1])
print cofactor
metal = str(rows[0][2])
print metal

#HETATM 4666 ZN    ZN A 701      43.821  38.240  46.712  1.00 25.11          ZN
예제 #2
0
os.chdir(curr_dir)

files = os.listdir('./')
files.sort()
path = os.path.abspath(os.path.curdir)
for file_ in files:
    if file_[-4:] == '.pdb':
        os.chdir(path)
        pdb_code = file_[:-4]
        os.chdir(pdb_code)  # cd in new directory and do docking stuff
        newpath = os.path.abspath(os.path.curdir)

        # Connect to the MySQL database

        conn = mysql.connect2server(pword, uname, db)
        cursor = conn.cursor()

        # Get the name of the cofactor

        command = "select lig, cof, metal from " + tb + " where id = '" + wantedpdb + "' and pacode = '" + pacode + "' and lig = '" + wantedlig + "' limit 1"
        cursor.execute(command)
        rows = cursor.fetchall()

        conn.close()
        cursor.close()

        ligand = rows[0][0]
        cofactor = str(rows[0][1])
        metal = str(rows[0][2])
	prediction = 'less_druggable'
elif score > 0.59:
	prediction = 'druggable'

# Upload descriptors into new format table

db = str(sys.argv[4]) # Database
tb = str(sys.argv[5]) # Table
dt = str(sys.argv[6]) # Descriptor Table
us = str(sys.argv[7]) # Username
pw = str(sys.argv[8]) # Password
wantedpacode = str(sys.argv[10]) # PA code for Pseudomonas protein
wantedpdb = str(sys.argv[11]) # 4 letter code for PDB
wantedlig = str(sys.argv[12]) # 3 letter code for ligand bound to protein

conn=mysql.connect2server(pw, us, db)
cursor = conn.cursor ()

command = "Select * from "+ dt +" where id = '" + wantedpdb +"' and pacode = '" + wantedpacode + "' and lig = '" + wantedlig + "'"
cursor.execute(command)

label_exists = cursor.fetchall()

if len(label_exists) > 0:
	command = "UPDATE " + dt + " SET csa = " + str(csa) + " WHERE id = '" + wantedpdb +"' and pacode = '" + wantedpacode + "' and lig = '" + wantedlig + "'"
	cursor.execute(command)
	
	command = "UPDATE " + dt + " SET hsa_t = " + str(hsa_t) + " WHERE id = '" + wantedpdb +"' and pacode = '" + wantedpacode + "' and lig = '" + wantedlig + "'"
	cursor.execute(command)
	
	command = "UPDATE " + dt + " SET psa_r = " + str(psa_r) + " WHERE id = '" + wantedpdb +"' and pacode = '" + wantedpacode + "' and lig = '" + wantedlig + "'"
예제 #4
0
os.chdir(curr_dir)

files = os.listdir('./')
files.sort()
path = os.path.abspath(os.path.curdir)
for file_ in files:
        if file_[-4:] == '.pdb':
		os.chdir(path)
		pdb_code = file_[:-4]
		os.chdir(pdb_code)	# cd in new directory and do docking stuff
		newpath = os.path.abspath(os.path.curdir)
		
		# Connect to the MySQL database
		
		conn=mysql.connect2server(pword, uname, db)
		cursor = conn.cursor ()
		
		# Get the name of the cofactor
		
		command = "select lig, cof, metal from "+tb+" where id = '" + wantedpdb +"' and pacode = '" + pacode + "' and lig = '" + wantedlig + "' limit 1"
		cursor.execute(command)
		rows = cursor.fetchall ()
		
		conn.close()
		cursor.close()
		
		ligand = rows[0][0]
		cofactor = str(rows[0][1])
		metal = str(rows[0][2])