Dear Group,

I am a complete novice, thus hoped you would provide guidance on using Pymol Scripts.

When trying to run the above script, from Pymol's Script Library, on my macpymol, i get the following error message - attached below is the findSurfaceResidues.txt script.

PyMOL>run findSurfaceResidues3
Traceback (most recent call last):
  File "/Volumes/Data/scm/vikki/bld/MacPyMOL.app/pymol/modules/pymol/parser.py", line 338, in parse
  File "/Volumes/Data/scm/vikki/bld/MacPyMOL.app/pymol/modules/pymol/parsing.py", line 455, in run_file
IOError: [Errno 2] No such file or directory: 'findSurfaceResidues3'
PyMOL>run findSurfaceResidues3.txt
Traceback (most recent call last):
  File "/Volumes/Data/scm/vikki/bld/MacPyMOL.app/pymol/modules/pymol/parser.py", line 338, in parse
  File "/Volumes/Data/scm/vikki/bld/MacPyMOL.app/pymol/modules/pymol/parsing.py", line 455, in run_file
  File "findSurfaceResidues3.txt", line 5
     
     ^
 SyntaxError: invalid syntax

# -*- coding: utf-8 -*-
import pymol
from pymol import cmd
import random
 
def findSurfaceResidues(objSel="(all)", cutoff=2.5, doShow=False, 
verbose=False):
        """
        findSurfaceResidues
                finds those residues on the surface of a protein
                that have at least 'cutoff' exposed A**2 surface area.
 
        PARAMS
                objSel (string)
                        the object or selection in which to find
                        exposed residues
                        DEFAULT: (all)
 
                cutoff (float)
                        your cutoff of what is exposed or not. 
                        DEFAULT: 2.5 Ang**2
 
                asSel (boolean)
                        make a selection out of the residues found
 
        RETURNS
                (list: (chain, resv ) )
                        A Python list of residue numbers corresponding
                        to those residues w/more exposure than the cutoff.
 
        """
        tmpObj="__tmp"
        cmd.create( tmpObj, objSel + " and polymer");
        if verbose!=False:
                print "WARNING: I'm setting dot_solvent.  You may not care for 
this."
        cmd.set("dot_solvent");
        cmd.get_area(selection=tmpObj, load_b=1)
 
        # threshold on what one considers an "exposed" atom (in A**2):
        cmd.remove( tmpObj + " and b < " + str(cutoff) )
 
        stored.tmp_dict = {}
        cmd.iterate(tmpObj, "stored.tmp_dict[(chain,resv)]=1")
        exposed = stored.tmp_dict.keys()
        exposed.sort()
 
        randstr = str(random.randint(0,10000))
        selName = "exposed_atm_" + randstr
        if verbose!=False:
                print "Exposed residues are selected in: " + selName
        cmd.select(selName, objSel + " in " + tmpObj ) 
        selNameRes = "exposed_res_" + randstr
        cmd.select(selNameRes, "byres " + selName )
 
 
        if doShow!=False:
                cmd.show_as("spheres", objSel + " and poly")
                cmd.color("white", objSel)
                cmd.color("red", selName)
 
        cmd.delete(tmpObj)
 
        return exposed
 
 
cmd.extend("findSurfaceResidues", findSurfaceResidues)

Where am I, going astray?

M.A. 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to