def buried_area(operation, atoms1, atoms2,
probeRadius = 1.4, vertexDensity = 2.0):
#calculate buried area
import os
import chimera
import xlsxwriter
from Measure import measure
from chimera import *
workbook = xlsxwriter.Workbook('contactArea.xlsx')
worksheet = workbook.add_worksheet()
Path = "/Users/kevinwang/desktop/VEGFR_NO_LIGAND/results/clustering/pdbfit/split"
i = 0
filelist = os.listdir(Path)
for x in filelist:
if x.startswith("trp.pdb."):
#if (x == "trp.pdb.00001"):
opened = chimera.openModels.open(x, type ="PDB")
chimera.update.checkForChanges()
try:
runCommand('surface :286-596')
runCommand('surface :899-1230')
y = measure.buried_area()
worksheet.write(i,0,x)
worksheet.write(i,1,y)
except:
worksheet.write(i,0,x)
worksheet.write(i,1,"ERROR")
i = i + 1
print("Processed: " + x)
print("Total #: " + str(i))
runCommand('close all')
chimera.update.checkForChanges()
workbook.close()