[Chimera-users] Python Script to Find Contact Area Between 2 Proteins

Kevin Wang kevinkw.wang at mail.utoronto.ca
Tue Aug 27 13:03:14 PDT 2019


I am writing a python script to find the area between 2 proteins using the contact_area python command below.

def contact_area(p1, p2, d, color = None, offset = None, slab = None,

                 smooth = False, optimize = True):

Is there a specific object for p1 and p2 and if so how do I get it?

My current code is as follows:

import os

import chimera

from Measure import contactarea

from chimera import *

Path = "/Users/kevinwang/desktop/VEGFR_NO_LIGAND/results/clustering/pdbfit/split"

filelist = os.listdir(Path)

for x in filelist:

    #if x.startswith("trp.pdb."):

    if (x == "trp.pdb.00001"):

        print x

        opened = chimera.openModels.open(x, type ="PDB")


        y = contactarea.contact_area('0.1', '0.2', 2.5)

        text_file = open("buriedArea.txt", "w")



The error message I am getting is as follows:

AttributeError: 'str' object has no attribute 'geometry'

  File "/Applications/Chimera.app/Contents/Resources/share/Measure/contactarea.py", line 8, in contact_area
    v1, t1 = p1.geometry

How should I be passing in my arguments?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190827/033c9457/attachment.html>

More information about the Chimera-users mailing list