From: Wei S. <wei...@gm...> - 2011-11-21 22:08:01
|
Hi all, I want to manually dock a protein with a piece of DNA. I found in a previous post that it could be done by opening two PDB and shift-middle click-and-drag on the molecule to translate and shift-left-click-and-drag to rotate. I opened both PDBs, and when I pressed shift, and click on the molecule I want to move, and middle click and drag, it didn't translate the molecule, but only draws a box.... I didn't know what I did wrong. Any idea? Thank you so much! Best, Wei |
From: Wei S. <wei...@gm...> - 2011-11-21 22:15:37
|
By the way, I am using mac pymol... On Mon, Nov 21, 2011 at 5:07 PM, Wei Shi <wei...@gm...> wrote: > Hi all, > I want to manually dock a protein with a piece of DNA. I found in a > previous post that it could be done by opening two PDB and shift-middle > click-and-drag on the molecule to translate and shift-left-click-and-drag > to rotate. I opened both PDBs, and when I pressed shift, and click on the > molecule I want to move, and middle click and drag, it didn't translate the > molecule, but only draws a box.... I didn't know what I did wrong. Any > idea? Thank you so much! > > Best, > Wei > > > |
From: Martin H. <ma...@bl...> - 2011-11-22 08:26:33
|
Dear PyMOL List It comes up once in a while, is it possible to use PyMOL features from outside of PyMOL? An example, the below is a script (inspired by Thomas Holder) which saves down to disk all amino acids of a protein structure into separate PDB files. # ***************************************************************** from pymol import cmd from pymol import stored from pymol.exporting import _resn_to_aa as one_letter # ***************************************************************** def seq(state, selection="name ca or resn hoh or resn lig"): print "Generating seqs." cmd.select("prot", selection) while cmd.pop("_tmp", "prot"): cmd.iterate("_tmp", "stored.x=(resn,resv)") #print stored.x[0], stored.x[1] # Special case 1: Waters. if stored.x[0] == 'HOH': filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) # Special case 2: Substrate. elif stored.x[0] == 'LIG': filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) # Other: protein back-bone. else: filename = 'seq-%s%d-%s.pdb' % (one_letter[stored.x[0]].lower(), stored.x[1], state) cmd.save(filename, "byres _tmp") cmd.delete('_tmp prot') cmd.extend('seq', seq) # ----------------------------------------------------------------- Is it possible to somehow include this in a Python script, and running it from the command line? If not, why? Thanks for any feedback. |
From: Thomas H. <sp...@us...> - 2011-11-22 08:47:44
|
Hi Martin, the recommended way is to use PyMOL as your python interpreter, so instead of: python file.py do this: pymol -cqr file.py However, launching a PyMOL process from a python terminal as you suggested is also possible. Have a look at Example 2 of http://pymolwiki.org/index.php/Launching_From_a_Script , the important lines are those: import pymol pymol.pymol_argv = ['pymol','-qc'] pymol.finish_launching() Cheers, Thomas Martin Hediger wrote, On 11/22/11 09:26: > Dear PyMOL List > It comes up once in a while, is it possible to use PyMOL features from > outside of PyMOL? An example, the below is a script (inspired by Thomas > Holder) which saves down to disk all amino acids of a protein structure > into separate PDB files. > > # ***************************************************************** > from pymol import cmd > from pymol import stored > from pymol.exporting import _resn_to_aa as one_letter > # ***************************************************************** > def seq(state, selection="name ca or resn hoh or resn lig"): > print "Generating seqs." > cmd.select("prot", selection) > while cmd.pop("_tmp", "prot"): > cmd.iterate("_tmp", "stored.x=(resn,resv)") > #print stored.x[0], stored.x[1] > > # Special case 1: Waters. > if stored.x[0] == 'HOH': > filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) > # Special case 2: Substrate. > elif stored.x[0] == 'LIG': > filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) > # Other: protein back-bone. > else: > filename = 'seq-%s%d-%s.pdb' % (one_letter[stored.x[0]].lower(), stored.x[1], state) > cmd.save(filename, "byres _tmp") > cmd.delete('_tmp prot') > > cmd.extend('seq', seq) > # ----------------------------------------------------------------- > > Is it possible to somehow include this in a Python script, and running > it from the command line? If not, why? > > > Thanks for any feedback. -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen |
From: Abdullah K. <abd...@im...> - 2011-11-21 22:40:59
|
Hey Wei, have you set your mouse to "Editing" mode? Do this first via the application menu Mouse->"3 Button Editing" and then repeat the steps you described. Cheers, Abdullah On 21 Nov 2011, at 23:07, Wei Shi wrote: > Hi all, > I want to manually dock a protein with a piece of DNA. I found in a previous post that it could be done by opening two PDB and shift-middle click-and-drag on the molecule to translate and shift-left-click-and-drag to rotate. I opened both PDBs, and when I pressed shift, and click on the molecule I want to move, and middle click and drag, it didn't translate the molecule, but only draws a box.... I didn't know what I did wrong. Any idea? Thank you so much! > > Best, > Wei > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d_______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... --<------<---@ Dr. Abdullah Kahraman PostDoc Aebersold - Malmstroem Group Institute of Molecular Systems Biology ETH Zurich HPT C75 Wolfgang-Pauli-Str. 16 8093 Zurich Switzerland http://www.imsb.ethz.ch/researchgroup/malars/people/abdullah_kahraman abd...@im... work: +41-(0)44-633 39 45 mobile: +41-(0)76-317 0305 |
From: Thomas H. <sp...@us...> - 2011-11-22 13:19:37
|
Hi Martin, I don't have a Mac so I can't test this, sorry. I suspect that the _cmd module is built into the MacPyMOL executable. This would imply that you cannot use MacPyMOL like in the "Launching_From_a_Script" examples. Maybe someone of the MacPyMOL users knows more? Cheers, Thomas Martin Hediger wrote, On 11/22/11 13:14: > Thanks Thomas for the reply. I tried it under Mac OS X 10.5.8. > > me @ ~/PROG_TEST $ python > Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) > [GCC 4.0.1 (Apple Inc. build 5493)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > imported numpy > from PyQt4.QtGui imported * > from PyQt4.QtCore imported * >>>> import os, sys >>>> import readline >>>> import rlcompleter >>>> readline.parse_and_bind('tab: complete') >>>> moddir='/Applications/PyMOLX11Hybrid.app/pymol/modules' >>>> sys.path.insert(0, moddir) >>>> os.environ['PYMOL_PATH'] = os.path.join(moddir, 'pymol/pymol_path') >>>> import pymol > Traceback (most recent call last): > File "<stdin>", line 1, in<module> > File > "/Applications/PyMOLX11Hybrid.app/pymol/modules/pymol/__init__.py", line > 472, in<module> > import _cmd > ImportError: No module named _cmd >>>> import pymol > > > What could be the problem? Could it be that the 'pymol/pymol_path' call > is not exactly right? In the modules/pymol directory, there is a module > 'pymol/launch_pymol', but I have a similar error ("No module named > _cmd") when I try to import it. > Martin > > > > > > > Am 22.11.11 09:47, schrieb Thomas Holder: >> Hi Martin, >> >> the recommended way is to use PyMOL as your python interpreter, so >> instead of: >> >> python file.py >> >> do this: >> >> pymol -cqr file.py >> >> >> However, launching a PyMOL process from a python terminal as you >> suggested is also possible. Have a look at Example 2 of >> http://pymolwiki.org/index.php/Launching_From_a_Script , the important >> lines are those: >> >> import pymol >> pymol.pymol_argv = ['pymol','-qc'] >> pymol.finish_launching() >> >> Cheers, >> Thomas >> >> >> Martin Hediger wrote, On 11/22/11 09:26: >>> Dear PyMOL List >>> It comes up once in a while, is it possible to use PyMOL features >>> from outside of PyMOL? An example, the below is a script (inspired by >>> Thomas Holder) which saves down to disk all amino acids of a protein >>> structure into separate PDB files. >>> >>> # ***************************************************************** >>> from pymol import cmd >>> from pymol import stored >>> from pymol.exporting import _resn_to_aa as one_letter >>> # ***************************************************************** >>> def seq(state, selection="name ca or resn hoh or resn lig"): >>> print "Generating seqs." >>> cmd.select("prot", selection) >>> while cmd.pop("_tmp", "prot"): >>> cmd.iterate("_tmp", "stored.x=(resn,resv)") >>> #print stored.x[0], stored.x[1] >>> >>> # Special case 1: Waters. >>> if stored.x[0] == 'HOH': >>> filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) >>> # Special case 2: Substrate. >>> elif stored.x[0] == 'LIG': >>> filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) >>> # Other: protein back-bone. >>> else: >>> filename = 'seq-%s%d-%s.pdb' % >>> (one_letter[stored.x[0]].lower(), stored.x[1], state) >>> cmd.save(filename, "byres _tmp") >>> cmd.delete('_tmp prot') >>> >>> cmd.extend('seq', seq) >>> # ----------------------------------------------------------------- >>> >>> Is it possible to somehow include this in a Python script, and >>> running it from the command line? If not, why? >>> >>> >>> Thanks for any feedback. -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen |
From: Jason V. <jas...@sc...> - 2011-11-22 14:57:09
|
Martin, The _cmd module is indeed statically linked into MacPyMOL. But, if you built from open-source it's dumped into site-packages/pymol. Also, view the files inside pymol/examples/launching. There are plenty of examples. If you're using a pre-built package from elsewhere, then please contact the package maintainer to see how it's built. Last, I prefer the newer "pymol2" strategy where you get a handle to a PyMOL cmd instance: from pymol2 import PyMOL cmd=PyMOL().cmd Cheers, -- Jason On Tue, Nov 22, 2011 at 8:19 AM, Thomas Holder <sp...@us...> wrote: > Hi Martin, > > I don't have a Mac so I can't test this, sorry. > > I suspect that the _cmd module is built into the MacPyMOL executable. > This would imply that you cannot use MacPyMOL like in the > "Launching_From_a_Script" examples. Maybe someone of the MacPyMOL users > knows more? > > Cheers, > Thomas > > Martin Hediger wrote, On 11/22/11 13:14: >> Thanks Thomas for the reply. I tried it under Mac OS X 10.5.8. >> >> me @ ~/PROG_TEST $ python >> Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) >> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> imported numpy >> from PyQt4.QtGui imported * >> from PyQt4.QtCore imported * >>>>> import os, sys >>>>> import readline >>>>> import rlcompleter >>>>> readline.parse_and_bind('tab: complete') >>>>> moddir='/Applications/PyMOLX11Hybrid.app/pymol/modules' >>>>> sys.path.insert(0, moddir) >>>>> os.environ['PYMOL_PATH'] = os.path.join(moddir, 'pymol/pymol_path') >>>>> import pymol >> Traceback (most recent call last): >> File "<stdin>", line 1, in<module> >> File >> "/Applications/PyMOLX11Hybrid.app/pymol/modules/pymol/__init__.py", line >> 472, in<module> >> import _cmd >> ImportError: No module named _cmd >>>>> import pymol >> >> >> What could be the problem? Could it be that the 'pymol/pymol_path' call >> is not exactly right? In the modules/pymol directory, there is a module >> 'pymol/launch_pymol', but I have a similar error ("No module named >> _cmd") when I try to import it. >> Martin >> >> >> >> >> >> >> Am 22.11.11 09:47, schrieb Thomas Holder: >>> Hi Martin, >>> >>> the recommended way is to use PyMOL as your python interpreter, so >>> instead of: >>> >>> python file.py >>> >>> do this: >>> >>> pymol -cqr file.py >>> >>> >>> However, launching a PyMOL process from a python terminal as you >>> suggested is also possible. Have a look at Example 2 of >>> http://pymolwiki.org/index.php/Launching_From_a_Script , the important >>> lines are those: >>> >>> import pymol >>> pymol.pymol_argv = ['pymol','-qc'] >>> pymol.finish_launching() >>> >>> Cheers, >>> Thomas >>> >>> >>> Martin Hediger wrote, On 11/22/11 09:26: >>>> Dear PyMOL List >>>> It comes up once in a while, is it possible to use PyMOL features >>>> from outside of PyMOL? An example, the below is a script (inspired by >>>> Thomas Holder) which saves down to disk all amino acids of a protein >>>> structure into separate PDB files. >>>> >>>> # ***************************************************************** >>>> from pymol import cmd >>>> from pymol import stored >>>> from pymol.exporting import _resn_to_aa as one_letter >>>> # ***************************************************************** >>>> def seq(state, selection="name ca or resn hoh or resn lig"): >>>> print "Generating seqs." >>>> cmd.select("prot", selection) >>>> while cmd.pop("_tmp", "prot"): >>>> cmd.iterate("_tmp", "stored.x=(resn,resv)") >>>> #print stored.x[0], stored.x[1] >>>> >>>> # Special case 1: Waters. >>>> if stored.x[0] == 'HOH': >>>> filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) >>>> # Special case 2: Substrate. >>>> elif stored.x[0] == 'LIG': >>>> filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) >>>> # Other: protein back-bone. >>>> else: >>>> filename = 'seq-%s%d-%s.pdb' % >>>> (one_letter[stored.x[0]].lower(), stored.x[1], state) >>>> cmd.save(filename, "byres _tmp") >>>> cmd.delete('_tmp prot') >>>> >>>> cmd.extend('seq', seq) >>>> # ----------------------------------------------------------------- >>>> >>>> Is it possible to somehow include this in a Python script, and >>>> running it from the command line? If not, why? >>>> >>>> >>>> Thanks for any feedback. > > -- > Thomas Holder > MPI for Developmental Biology > Spemannstr. 35 > D-72076 Tübingen > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Jason Vertrees, PhD PyMOL Product Manager Schrodinger, LLC (e) Jas...@sc... (o) +1 (603) 374-7120 |
From: Martin H. <ma...@bl...> - 2011-11-22 15:46:37
|
Thanks for the answers. I'll be trying to get it compile on a linux box, if I could access some of the PyMOL features there, that's fine as well. A friend tried to compile PyMOL on Mac and had quite some trouble, so I'll be first trying the Linux option. Martin Am 22.11.11 15:56, schrieb Jason Vertrees: > Martin, > > The _cmd module is indeed statically linked into MacPyMOL. But, if you > built from open-source it's dumped into site-packages/pymol. Also, > view the files inside pymol/examples/launching. There are plenty of > examples. If you're using a pre-built package from elsewhere, then > please contact the package maintainer to see how it's built. > > Last, I prefer the newer "pymol2" strategy where you get a handle to a > PyMOL cmd instance: > > from pymol2 import PyMOL > cmd=PyMOL().cmd > > Cheers, > > -- Jason > > On Tue, Nov 22, 2011 at 8:19 AM, Thomas Holder > <sp...@us...> wrote: >> Hi Martin, >> >> I don't have a Mac so I can't test this, sorry. >> >> I suspect that the _cmd module is built into the MacPyMOL executable. >> This would imply that you cannot use MacPyMOL like in the >> "Launching_From_a_Script" examples. Maybe someone of the MacPyMOL users >> knows more? >> >> Cheers, >> Thomas >> >> Martin Hediger wrote, On 11/22/11 13:14: >>> Thanks Thomas for the reply. I tried it under Mac OS X 10.5.8. >>> >>> me @ ~/PROG_TEST $ python >>> Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) >>> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin >>> Type "help", "copyright", "credits" or "license" for more information. >>> imported numpy >>> from PyQt4.QtGui imported * >>> from PyQt4.QtCore imported * >>>>>> import os, sys >>>>>> import readline >>>>>> import rlcompleter >>>>>> readline.parse_and_bind('tab: complete') >>>>>> moddir='/Applications/PyMOLX11Hybrid.app/pymol/modules' >>>>>> sys.path.insert(0, moddir) >>>>>> os.environ['PYMOL_PATH'] = os.path.join(moddir, 'pymol/pymol_path') >>>>>> import pymol >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in<module> >>> File >>> "/Applications/PyMOLX11Hybrid.app/pymol/modules/pymol/__init__.py", line >>> 472, in<module> >>> import _cmd >>> ImportError: No module named _cmd >>>>>> import pymol >>> >>> What could be the problem? Could it be that the 'pymol/pymol_path' call >>> is not exactly right? In the modules/pymol directory, there is a module >>> 'pymol/launch_pymol', but I have a similar error ("No module named >>> _cmd") when I try to import it. >>> Martin >>> >>> >>> >>> >>> >>> >>> Am 22.11.11 09:47, schrieb Thomas Holder: >>>> Hi Martin, >>>> >>>> the recommended way is to use PyMOL as your python interpreter, so >>>> instead of: >>>> >>>> python file.py >>>> >>>> do this: >>>> >>>> pymol -cqr file.py >>>> >>>> >>>> However, launching a PyMOL process from a python terminal as you >>>> suggested is also possible. Have a look at Example 2 of >>>> http://pymolwiki.org/index.php/Launching_From_a_Script , the important >>>> lines are those: >>>> >>>> import pymol >>>> pymol.pymol_argv = ['pymol','-qc'] >>>> pymol.finish_launching() >>>> >>>> Cheers, >>>> Thomas >>>> >>>> >>>> Martin Hediger wrote, On 11/22/11 09:26: >>>>> Dear PyMOL List >>>>> It comes up once in a while, is it possible to use PyMOL features >>>>> from outside of PyMOL? An example, the below is a script (inspired by >>>>> Thomas Holder) which saves down to disk all amino acids of a protein >>>>> structure into separate PDB files. >>>>> >>>>> # ***************************************************************** >>>>> from pymol import cmd >>>>> from pymol import stored >>>>> from pymol.exporting import _resn_to_aa as one_letter >>>>> # ***************************************************************** >>>>> def seq(state, selection="name ca or resn hoh or resn lig"): >>>>> print "Generating seqs." >>>>> cmd.select("prot", selection) >>>>> while cmd.pop("_tmp", "prot"): >>>>> cmd.iterate("_tmp", "stored.x=(resn,resv)") >>>>> #print stored.x[0], stored.x[1] >>>>> >>>>> # Special case 1: Waters. >>>>> if stored.x[0] == 'HOH': >>>>> filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) >>>>> # Special case 2: Substrate. >>>>> elif stored.x[0] == 'LIG': >>>>> filename = 'seq-x%s-%s.pdb' % (stored.x[1], state) >>>>> # Other: protein back-bone. >>>>> else: >>>>> filename = 'seq-%s%d-%s.pdb' % >>>>> (one_letter[stored.x[0]].lower(), stored.x[1], state) >>>>> cmd.save(filename, "byres _tmp") >>>>> cmd.delete('_tmp prot') >>>>> >>>>> cmd.extend('seq', seq) >>>>> # ----------------------------------------------------------------- >>>>> >>>>> Is it possible to somehow include this in a Python script, and >>>>> running it from the command line? If not, why? >>>>> >>>>> >>>>> Thanks for any feedback. >> -- >> Thomas Holder >> MPI for Developmental Biology >> Spemannstr. 35 >> D-72076 Tübingen >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure >> contains a definitive record of customers, application performance, >> security threats, fraudulent activity, and more. Splunk takes this >> data and makes sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-novd2d >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> > > |