Re: [PyMOL] surface properties
Hi Mark, I remember that Kristian Rother's rTools could do hydrophobicity coloring: http://www.rubor.de/pymol_extensions.html it is some years ago, so maybe it needs some updateing.. Best, Andreas DeLano Scientific wrote: Mark, PyMOL does not have such abilities at present. Can such concepts even be defined in a precise, objective, and unambiguous fashion? Cheers, Warren -- DeLano Scientific LLC Subscriber Support Services mailto:supp...@delsci.com -Original Message- From: Mark Collins [mailto:mnc2...@columbia.edu] Sent: Thursday, December 18, 2008 7:38 AM To: pymol-users@lists.sourceforge.net Subject: [PyMOL] surface properties Hi All I have searched thru the archive and couldn't find an answer, to this. I would like to make pymol surface(s) colored by (1) hydrophobicity and (2) concavity/convexity. These are easily produced in grasp, so one possibility maybe to import some type of grasp file. Thanks in advance for suggestions, websites, or tutorials, etc. Mark -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009 .visitmix.com/ ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] Get coordinates of the mesh
Hi Horacio, you can save as wrl (VRML) or povray (as posted earlier). The former can be read by vtk (vtkVRMLImporter or so), from here you have a rich set of sophisticated algorithms such as decimate. google for vtkDecimate, vtkDecimatePro There are bindings for a couple of languages, also Python. Moreover, TVTK provides convenient python bindings to vtk Let me know, if you are going that way because I had a similar project in mind, maybe we can combine efforts. Best, Andreas Horacio Sánchez schrieb: Hi, looking to the mesh representation of a protein in pymol, I wonder what could be the best/easiest method to get the cartesian coordinates of some arbitrary number of the points of the mesh at more or less regular (or arbitrary) intervals. The only thing that I can think now of is to debug pymol in some way so I can dump the information used to generate the mesh. Thanks in advance Horacio - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users
Re: [PyMOL] rotate about an abitrary axis
Hi Minh, you define a rotation axis by the rotation axis x, y or z (first argument in cmd.rotate) and a point in 3d (origin argument in cmd.rotate). Instead of rotations around axes that are not parallel to the x, y or z axis you can do composite rotations. Btw, for the case of GroEL (PDB 2c7e), the structure is oriented along the Z axis, so you can flap the flexible regions with a single rotation around the axis that goes through the regions center of mass and is parallel to the z-axis. See the attached file. repeat the last rotate command from the gray window cmd.rotate(z, 30, flexregion, camera=0, origin=rotationCenter) hope that makes sense. Minh Nhat wrote: Hi everyone, Is it possible to make a selection rotate about an arbitrary axis (which we can actively define ourself (not x,y, z) ?) Thanks, Send instant messages to your online friends http://uk.messenger.yahoo.com - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de from pymol import cmd from pymol.cgo import * def centerOfMass(selection, createSphere=True): ## assumes equal weights (best called with and name ca suffix) model = cmd.get_model(selection) x,y,z=0,0,0 for a in model.atom: x+= a.coord[0] y+= a.coord[1] z+= a.coord[2] com = (x/len(model.atom), y/len(model.atom), z/len(model.atom)) if createSphere: print Center of mass: (%.1f,%.1f,%.1f)% com ## Creating a sphere CGO comS = [COLOR, 1.0, 0.5, 0.5, SPHERE]+list(com) + [1.0] cmd.load_cgo(comS, CoM) return com cmd.fetch(2c7e) ## requires a newer pymol cmd.as(cartoon, all) ## requires a newer pymol cmd.create(flexregion, chain A and resi 229-270) cmd.color(red, flexregion) rotationCenter = list(centerOfMass(flexregion)) cmd.rotate(z, 30, flexregion, camera=0, origin=rotationCenter) ## repeat this! cmd.zoom(flexregion)
Re: [PyMOL] Distances and Python scripts
Hi Xavier, here is a naive approach to solve problem 2), which should include your first problem. # from pymol import cmd, stored ## setup myProt = 2gsm mySegm = myChain = B cmd.fetch(myProt) outfile = open(/tmp/n_n_distances.txt, w) selection = /%s/%s/%s/*/N % (myProt, mySegm, myChain) ## getting the atoms of a selection stored.list = [] cmd.iterate(selection, stored.list.append((resi, name))) print len(stored.list) for atom1 in stored.list: for atom2 in stored.list: selection1 = /%s/%s/%s/%s/%s % (myProt, mySegm, myChain, atom1[0], atom1[1]) selection2 = /%s/%s/%s/%s/%s % (myProt, mySegm, myChain, atom2[0], atom2[1]) distance = cmd.distance(d, selection1, selection2, cutoff = 6.0) if distance 0.0: ## distance can be 0, if atom1==atom2 or if atom1 and atom2 are more than 6A apart print outfile, selection1, selection2, distance outfile.close() produces a file like this: ## /2gsm//B/31/N /2gsm//B/30/N 3.59292006493 ## /2gsm//B/31/N /2gsm//B/32/N 3.55046916008 ## /2gsm//B/31/N /2gsm//B/246/N 5.16704130173 I hope perfomance doesnt matter, since this is quite slow. Otherwise I suggest to use get_model to get a list of coordinates and put them into a distance matrix, eg. using scipy: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498246 let me know if this is what you want. I hope that helps! Best regards, Andreas Xavier HANOULLE wrote: Hi all, I have 2 problems regarding the distance command and python scripting: *1/* I would like to use a script in order to print in a file the results of this following command: distance dist6, (/MyProt/MyProt/A/181/N), (/MyProt/MyProt/A/*/N), 6.0 This command displays distances and dash lines between the N atom of residue 181 and all the N atoms of MyProt which are at 6Ang. How do I have to write a Python script to get the results in a text file that will look like: /MyProt/MyProt/A/181/N /MyProt/MyProt/A/180/ 4.856 /MyProt/MyProt/A/181/N /MyProt/MyProt/A/182/ 3.956 /MyProt/MyProt/A/181/N /MyProt/MyProt/A/78/ 5.562 /MyProt/MyProt/A/181/N /MyProt/MyProt/A/105/ 2.863 ... ? *2/ *How do I have to write a python script to measure all the N-N distances in my protein and to print the results in a text file that will look like: /MyProt/MyProt/A/1/N /MyProt/MyProt/A/2/ 4.856 /MyProt/MyProt/A/1/N /MyProt/MyProt/A/3/ 3.956 /MyProt/MyProt/A/1/N /MyProt/MyProt/A/4/ 5.562 ... /MyProt/MyProt/A/2/N /MyProt/MyProt/A/1/ 3.857 /MyProt/MyProt/A/2/N /MyProt/MyProt/A/3/ 7.249 /MyProt/MyProt/A/2/N /MyProt/MyProt/A/4/ 8.762 ... ? Furthermore, would it be possible to add a limit for these distances ? For exemple, only get the N-N distances in MyProt which are 7Ang. ? Thanks for your help. Sincerely, Xavier. * * *Xavier HANOULLE, Ph.D.* UMR 8576 CNRS–USTL Structural and Functional Glycobiology Unit NMR Laboratory 59655 Villeneuve d’Ascq Cedex - France Phone: +33 (0)3.20.33.72.41 E-mail : xavier.hanou...@univ-lille1.fr mailto:xavier.hanou...@univ-lille1.fr www: http://groupe-rmn-modelisation.univ-lille1.fr http://groupe-rmn-modelisation.univ-lille1.fr/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] mutagenesis script
Hi Martin, you can get hints about how to script wizard functions if you log your activities while running the wizard. A python script (mutate.py) that makes use of the mutagenesis wizard could look like this: ## run through pymol, eg.: ## pymol -qc mutate.py 1god A/94/ ASN from pymol import cmd import sys pdb, selection, mutant = sys.argv[-3:] cmd.wizard(mutagenesis) cmd.fetch(pdb) cmd.refresh_wizard() cmd.get_wizard().do_select(selection) cmd.get_wizard().set_mode(mutant) cmd.get_wizard().apply() cmd.set_wizard() cmd.save(%s_m.pdb % pdb, pdb) This is pretty no-frills, as no rotamer stuff is taken into account. I wrote it in Python, because it allows to parameterize from command line, you can add loops easily etc. Beware, the error message you get is because pymol unsuccessfully tries to open the command line arguments as files. Hope that helps. Best regards, Andreas Martin Höfling wrote: Hi there, does anybody of you has an idea, if the mutagenesis stuff is available for use inside scripts too? I wanna load a pdb, mutate a resid and save the resulting pdb via commandline. The only thing I found was modifying atoms, when I searched via help and also checked the wiki, i hope that I didn't miss sth. Cheers Martin - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] PyMOL compilation from source
Hi, Michael Kluge wrote: Hi Andreas, gcc is not the best compiler on an IA64 machine. We always recommend using the Intel compilers. Would it be possible to try those? I have to figure out, where to modify in the setup script/distutils. Thanks. Andreas PS. @Michael From Martin Hoefling: i have no idea about your error but i can provide you RPMs for Opensuse 10.2 i586 and x86_64, if you need them for other SuSE distributions, I can try to add them to my repository. Would that be feasable? Regards, Michael Andreas Henschel wrote: Hi all, did anyone of you come across the mysterious internal compiler error: Segmentation fault while compiling pymol from source? The offending lines are in contrib/champ/champ.c:2787 PRINTFD(FB_smiles_parsing) ChampParseBlockAtom: called.\n ENDFD; Can I get around it somehow? Is it a 64-bit/gcc issue? Any help would be greatly appreciated. Some more error/system details: python setup.py install ... building 'chempy.champ._champ' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -fPIC -Icontrib/champ -I/usr/include/python2.4 -c contrib/champ/champ.c -o build/temp.linux-ia64-2.4/contrib/champ/champ.o contrib/champ/champ.c: In function 'ChampParseBlockAtom': contrib/champ/champ.c:2787: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.suse.de/feedback for instructions. error: command 'gcc' failed with exit status 1 uname -a Linux mars 2.6.16.27-0.6-default #1 SMP Wed Dec 13 09:34:50 UTC 2006 ia64 ia64 ia64 GNU/Linux gcc -v Using built-in specs. Target: ia64-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --with-system-libunwind --host=ia64-suse-linux Thread model: posix gcc version 4.1.0 (SUSE Linux) ia64 GNU/Linux Cheers, Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] PyMOL compilation from source
Hi all, did anyone of you come across the mysterious internal compiler error: Segmentation fault while compiling pymol from source? The offending lines are in contrib/champ/champ.c:2787 PRINTFD(FB_smiles_parsing) ChampParseBlockAtom: called.\n ENDFD; Can I get around it somehow? Is it a 64-bit/gcc issue? Any help would be greatly appreciated. Some more error/system details: python setup.py install ... building 'chempy.champ._champ' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -fPIC -Icontrib/champ -I/usr/include/python2.4 -c contrib/champ/champ.c -o build/temp.linux-ia64-2.4/contrib/champ/champ.o contrib/champ/champ.c: In function 'ChampParseBlockAtom': contrib/champ/champ.c:2787: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.suse.de/feedback for instructions. error: command 'gcc' failed with exit status 1 uname -a Linux mars 2.6.16.27-0.6-default #1 SMP Wed Dec 13 09:34:50 UTC 2006 ia64 ia64 ia64 GNU/Linux gcc -v Using built-in specs. Target: ia64-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --with-system-libunwind --host=ia64-suse-linux Thread model: posix gcc version 4.1.0 (SUSE Linux) ia64 GNU/Linux Cheers, Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] building centroids for residues
Hi Siv, below is a python script (I sent earlier to the mailing list) that calculates the Center of mass for a given selection and creates a CGO sphere there. It is is not 100% exact as it only weighs C-Alpha atoms. This is exactly how pymol centers selections: when you run the script, the domain is centered and if you rotate the structure with the mouse, the CGO will remain centered. For side chains you could make a selection of the sidechain carbon atoms of that residue, or all of the side chain atoms: centerOfmass(/1n8o//E/41 and not (name c+n+o)). Also see the ellipsoid script in the wiki. CGOs and self defined atoms perfectly rotate along (infact you are changing the camera view, the coordinates remain - unless you explictely use cmd.rotate or cmd.translate). See e.g. http://yggdrasil.biotec.tu-dresden.de/abac/b.47.1.2___b.16.1.1___g.4.1.1.html I hope that helps. ha det bra, Andreas from pymol import cmd from pymol.cgo import * def centerOfMass(selection): ## assumes equal weights (best called with and name ca suffix) model = cmd.get_model(selection) x,y,z=0,0,0 for a in model.atom: x+= a.coord[0] y+= a.coord[1] z+= a.coord[2] return (x/len(model.atom), y/len(model.atom), z/len(model.atom)) cmd.load(/group/bioinf/Data/PDBLinks/1c7c.pdb) cmd.select(domain, /1c7c//A/143-283/ and name ca) ## selecting a domain domainCenter=centerOfMass(domain) print Center of mass: (%.1f,%.1f,%.1f)% domainCenter cmd.as(cartoon, all) cmd.show(spheres, domain) ## Creating a sphere CGO com = [COLOR, 1.0, 1.0, 1.0, SPHERE]+list(domainCenter) + [3.0] ## white sphere with 3A radius cmd.load_cgo(com, CoM) cmd.zoom(1c7c, 1.0) cmd.center(domain) #...@bioinfws19:~/Projects/PyMOL$ pymol -qc centerOfMass4.py #Center of mass: (-1.0,24.5,48.2) #...@bioinfws19:~/Projects/PyMOL$ Siv Midtun Hollup wrote: Hi, I would like to examine the approximate volume of different residues in a protein. To do this, I would like to add a centroid for each residue, and visualise the volume by using different sphere-sizes. Is there a built-in function to find center of mass for a selection of atoms? The center command looks promising, can I get the coordinates of the center of mass using that? (feks using get_view() or similar?) Can I add a centroid atom to a residue in PYMOL? Would it be translated and rotated along with the residue if I move the structure around afterwards? Any pointers much appriciated :) Cheers, Siv -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] center of mass and distances
Hi Filippo, Here is a python script that calculates the Center of mass for a given selection and creates a CGO sphere there. It is is not 100% exact as it only weighs C-Alpha atoms. This is exactly how pymol centers selections: when you run the script, the domain is centered and if you rotate the structure with the mouse, the CGO will remain centered. I hope that helps. Best, Andreas from pymol import cmd from pymol.cgo import * def centerOfMass(selection): ## assumes equal weights (best called with and name ca suffix) model = cmd.get_model(selection) x,y,z=0,0,0 for a in model.atom: x+= a.coord[0] y+= a.coord[1] z+= a.coord[2] return (x/len(model.atom), y/len(model.atom), z/len(model.atom)) cmd.load(/group/bioinf/Data/PDBLinks/1c7c.pdb) cmd.select(domain, /1c7c//A/143-283/ and name ca) ## selecting a domain domainCenter=centerOfMass(domain) print Center of mass: (%.1f,%.1f,%.1f)% domainCenter cmd.as(cartoon, all) cmd.show(spheres, domain) ## Creating a sphere CGO com = [COLOR, 1.0, 1.0, 1.0, SPHERE]+list(domainCenter) + [3.0] ## white sphere with 3A radius cmd.load_cgo(com, CoM) cmd.zoom(1c7c, 1.0) cmd.center(domain) #...@bioinfws19:~/Projects/PyMOL$ pymol -qc centerOfMass4.py #Center of mass: (-1.0,24.5,48.2) #...@bioinfws19:~/Projects/PyMOL$ Filippo Marchioni wrote: Hi all! Two questions: Does anyone know how to read the coordinates (x,y,z) of a selected atom in a protein? Or even better Does anyone know how to visualize the center of mass of the protein, reset the axis (x,y,z) using the centroid as origin and then calculate the distance of a resi or an atom from the new origin? Thanks! best Filo - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] error on debian w/ pymol -c foo.pml
Hi Xavier, we also stumbled over this error and resolved it in a similar fasion. Also we have sent a bug report to debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=409188 The problem is that $* sends all command line arguments as a single combined string to pymol's __init__.py. The bug was introduced in the new debian package, before there were no quotes. Best. Christof Andreas xavier siebert wrote: Hi, I am using the pymol package provided with Debian testing (0.98+0.99r). When I am trying to run a script without the gui, i.e. pymol -c foo.pml, I get the following error : Traceback (most recent call last): File /var/lib/python-support/python2.4/pymol//__init__.py, line 364, in ? invocation.parse_args(pymol_argv) File /var/lib/python-support/python2.4/pymol/invocation.py, line 270, in parse_args options.deferred.append(_do_spawn %s%av.pop()) IndexError: pop from empty list I think I solved it by changing the last line of /usr/bin/pymol from python2.4 ${PYMOL_PATH}/__init__.py $* to python2.4 ${PYMOL_PATH}/__init__.py $@ --X. -- Xavier Siebert, Ph.D. Laboratoire de Microscopie Électronique Structurale (room 6234) Institut de Biologie Structurale (IBS) J.P. Ebel UMR 5075, CNRS 41, rue Jules Horowitz F-38027 Grenoble - Cedex 1 France Tel : ++334.38.78.96.12 Fax : ++334.38.78.54.94 - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] 1letter code by default
Hi Andrea, I am not sure if I got you right. you can activate the sequence view, when you start pymol by putting cmd.set('seq_view',1) in your .pymolrc.py (pymol's config file). (or set seq_view, 1 in .pymolrc, as you like) If you however mean a function that takes a selection and returns a one letter code I can send you some stuff we use. Best, Andreas andrea carotti wrote: Hi all, a very basic question: is possible to set the 1letter code by default in pymol? Thanks in advance Andrea -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] distance atom-protein surface
Hi Giacomo, you can either create an atom at that position (see eg. http://www.rubor.de/bioinf/tips_python.html#chempy) and than use the distance command (or wizard). Or you can get the position of your first atom and simply calculate the distance of the two positions, sth. like: class MyAtom: def __init__(self, selection = /1lov//A/1/CA): model = cmd.get_model(selection) self.coordinates = self.model.atom[0].coord ## requires at least one atom in the model def distance(self, coords): ## given some coordinates (list of three), from numarray import * distanceVector=array(self.coordinates)-array(coords) return sqrt(dot(distanceVector, distanceVector)) Hope, that's what you wanted! Cheers, Andreas Giacomo Bastianelli wrote: Dear Pymol users, I would like to measure the distance between an atom and a specific point (not another atom) in the surface of the protein. Is it possible with pymol? do I need additional scripts? Thanks in advance, Giacomo Bastianelli - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
Re: [PyMOL] Coloring structure by hydrophobicity
Hi Andrew, regarding hydrophobicity coloring, we use the rTools from Kristian Rother. http://www.rubor.de/bioinf/pymol_extensions.html The coloring schemes are according to http://www.expasy.org/cgi-bin/protscale.pl It comes with a nice user interface, or on command prompt you would simply do something like color_protscale 10, selection where 10 is the coloring scheme (might differ in your installation): Normalized consensus hydrophobicity scale. Eisenberg D., Schwarz E., Komarony M., Wall R. J. Mol. Biol. 179:125-142(1984). (See also attached image) Cheers, Andreas Andrew D. Fant wrote: Afternoon all, I apologize if this has been hashed over on the list in the past. I haven't been keeping up like I used to. Is there a good way to calculate and color residues by hydrophobicity in pymol? A google search showed only a very simple script that was based entirely on a single-residue lookup table. I'm looking at a set of structure predictions, and it would be nice to easily see that a fold exposes a large patch of hydrophobic surface to solvent. Thanks, Andy -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de inline: hydrophobicity.jpg
Re: [PyMOL] APBS and Pymol
Hi Anastassis, I got the same error with a few pdb files. The problem is the following. The B-factor in the pymol-generated pdb file is somtimes set to values larger than 100 (119.63 in your case) thus occupying all its columns of the lovely PDB-format and not leaving any space to the preceding occupancy column (1.00 in your case). The script psize.py however parses these lines by splitting on white-spaces and crashes when converting the merged field ... The remedy is to modify psize.py like this: around line 108, replace words = string.split(subline) with words = line[30:38], line[38:46], line[46:54], line[54:60], line[60:66], line[72:76], line[76:78] ## PDB-format is fixed-space! Hope that works for you, in any case attached is my debugged psize.py file. Another error occurs when calculating the electrostatics of pdb 1F88, a transmembrane protein. The same thing happens on the pdb2pqr Server (http://nbcr.net/pdb2pqr): 'NoneType' object has no attribute 'getCoords' looks a bit like strange atom name problem, I get the script working by inserting: if not nextatom: return 0 in line 608, however I am not 100% sure whether its still sound... Cheers, Andreas Peter Adrian Meyer wrote: Hi, parseInput self.parseLines(file.readlines()) File /usr/local/apbs-0.4.0/tools/manip/psize.py, line 116, in parseLines self.q = self.q + float(words[3]) ValueError: invalid literal for float(): 1.00119.63 Any clues ? It looks like it's reading from a pdb file when it's expecting a pqr file, and that the split statement didn't produce the expected input due to the B factor in the pdb file being too large. Possibly you have to generate a pqr file before setting the grid (I'm not farmilar enough with the apbs-pymol plugin to remember offhand). Good luck, Pete Pete Meyer Fu Lab BMCB grad student Cornell University - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de psize.py Description: application/python
[PyMOL] Colors, their code and their rgb
Hi all; I am currently writing a little script that takes a selection and creates a hydrophobicity plot (using matplotlib). For the plot it would be nice to have the color of the used residues and I partially succeed with the iterate-color construct: cmd.iterate(sele-str, stored.list.append(color)) Instead of the color code I need the RGB value, ideally also of those that were just defined in that session. I figured out some, but the list is far from exhaustive. Any idea? would be most appreciated. Cheers, Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] Global vars in Plugin name space?
Hi all, I wrote some functions (usually loaded via .pymolrc.py) that establish some information which I would like to use from Plugins, too. In particular, everytime a PQS/PDB protein complex is loaded, I retrieve SCOP data and color domains accordingly. I would like to maintain a dictionary that keeps track with loaded SCOP domains. In pymolrc I declare it global, but a plugin that is supposed to read out that dictionary, cannot access PyMOL's global name space: The plugin function call contains: global colorDict print colorDict and causes NameError: global name 'colorDict' is not defined though the direct call from the Prompt works: PyMOLprint colorDict ## This still works! {'blue': '/1ewf//A/1-217 and not hetatm', 'yellow': '/1ewf//A/218-456 and not hetatm'} Is it the only possibility to put all functions that share memory in the same plugin? At the moment I simply do it with scripts (which can access global vars), not plugins. But in general, is there some info on plugin name spacing (and should it be put to the Wiki Plugin tutorial)? Cheers, Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] pngs and structures simultaneously?
Hi there, Is it possible to display both a png file (using load_png) AND some molecule at the same time? It sure sounds geeky, but the rationale is that I would like to do a short presentation completely in pymol. I want to load some powerpoint slides (converted to png) in the background and have the full power of pymol scripting and molecule viewing. At least I can do it seperately... Just a thought. Also, any idea, how I can call a function with just pressing a single key? Cheers, Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] Surface/mesh coordinates
Dear all, is there an obvious way to get hold of surface/mesh coordinates in a python object? Thanks, Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] PyMOL in CAVE
Hi PyMolers, in our lab the obsession of running PyMOL 3D is contageously spreading ;-) Not enough we ran it on a huge power wall, using quad-buffered stereo/polarization, now people are keen on running it in our CAVE (to be built). Does anyone have experience with that? Also, maybe is there a straightforward way of producing 5 simultaneous views and exporting them to different output devices? Thanks for any help! Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] SQL in function with cmd.extend
Hi all, I want to color code scop domains in PDB entries by querrying a database server. It works fine if I just call the function from the python script, however if I define the function to be a Pymol fct, the call from pymol causes an undefined MySQL Error in subchainString: Traceback (most recent call last): File /usr/lib/python2.3/site-packages/pymol/parser.py, line 255, in parse exec(com2[nest]+\n,pymol_names,pymol_names) File string, line 1, in ? File scop1.py, line 19, in domainDef cmd.select(domain, /%s//%s/%(pdb, subchainString(px))) File scop1.py, line 11, in subchainString cursor.execute(SELECT chain_id, begin, end FROM subchain WHERE subchain.px='%s' LIMIT 1% px ) File /usr/lib/python2.3/site-packages/MySQLdb/cursors.py, line 95, in execute return self._execute(query, args) File /usr/lib/python2.3/site-packages/MySQLdb/cursors.py, line 114, in _execute self.errorhandler(self, exc, value) File /usr/lib/python2.3/site-packages/MySQLdb/connections.py, line 33, in defaulterrorhandler raise errorclass, errorvalue InterfaceError: (0, '') I have a suspecion it's to do with the quoting? Also, is there a command similar to Rasmol's pause? Or do I have to use raw_input in the terminal I called pymol from? Here is the simplified code: ## pdbLinkDir=/group/bioinf/Data/PDBLinks/ from pymol import cmd from pymol.cgo import * import MySQLdb from MySQLdb.cursors import DictCursor def subchainString(px): cursor.execute(SELECT chain_id, begin, end FROM subchain WHERE subchain.px='%s' LIMIT 1% px ) data=cursor.fetchone() if data[begin]: return %s/%s-%s%(data[chain_id], data[begin], data[end]) else: return %s%(data[chain_id]) def domainDef(px, pdb): cmd.load(pdbLinkDir+%s.pdb%pdb) cmd.hide(everything,all) cmd.select(domain, /%s//%s/%(pdb, subchainString(px))) cmd.color(blue,domain) cmd.show(cartoon, all) conn = MySQLdb.connect(db=pqs_psimap, host=dbserver, user=..., passwd=...) cursor = conn.cursor(DictCursor) #domainDef(25880E, 1tab) ## This works fine!!! cmd.extend(domainDef, domainDef) ## breaks when called from pymol with ## domainDef(25880E, 1tab) conn.close() ## Many thanks -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063 EMail: a...@biotec.tu-dresden.de
[PyMOL] Alignment objects
Dear PyMOL community, I am trying to use the align command (from within python) and want to evaluate the pairwise matches. the command cmd.align(sel1, sel2, object=alignment) should do. Sorry for this stupid question, but how do I get hold of the alignment object, and what is its functionality? Ie which methods/values does it provide? Many thanks. Andreas -- Andreas Henschel Bioinformatics Group TU Dresden Tatzberg 47-51 01307 Dresden, Germany Phone: +49 351 463 40063