Re: [PyMOL] Pseudoatom for a cavity

2017-01-26 Thread Sampson, Jared M.
Hi Kanika -

You can get more information on the wiki: 
https://pymolwiki.org/index.php/Pseudoatom.

To answer your specific questions, to make a pseudoatom between the two 
terminal Ns of Arg 100 on chain A of myobj:

```
pseudoatom my_ps1, myobj and chain A and resi 100 and name NH1+NH2
```

and to place a pseudoatom at a specific XYZ coordinate, pass the `pos` 
parameter with a 3-tuple of floats:

```
pseudoatom my_ps2, pos=[1.0, 2.0, 3.0]
```

Hope that helps.

Cheers,
Jared


On Jan 26, 2017, at 8:58 AM, kanika sharma 
> wrote:



Dear PyMol Users,

​I asked this question but no body replied so I am trying again. ​

I am struggling here two things.
1). I want to place a pseudo
​ ​
atom in the charge centre of a non aromatic residue, like arginine.
2). Is it possible to place
​a
 pseudo
​ ​
atom in the centre of a cavity in the protein? I am thinking how can I define 
the co ordinates of the position where I wan t to place the pseudo
​ ​
atom?

​Thanks ​

--
Best,

Kanika
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! 
http://sdm.link/slashdot___
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

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
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

[PyMOL] New plugin: PyMOLProbity

2017-01-16 Thread Sampson, Jared M.
Dear PyMOL Users,

I am pleased to introduce a new plugin called 
PyMOLProbity which allows a PyMOL 
user to visualize MolProbity-style structural validation data directly in a 
PyMOL session. The programs Reduce, Flipkin, and Probe from the well-known 
MolProbity software package allow 
generation of data in "kinemage" (kinetic image) format to illustrate atom-atom 
contacts (dots) and clashes (spikes), and the new plugin now makes it possible 
to utilize the same programs to produce similar results in PyMOL scenes.

I have put together a page on the PyMOL 
Wiki with a brief summary of its 
features and basic how-to information.  (Please note that the MolProbity 
executables are only available for Linux/MacOS, so PyMOLProbity isn't yet 
useful on Windows.)

My work on this plugin was supported by the Warren L. DeLano Memorial PyMOL 
Open-Source Fellowship.  I would like once again to thank Schrödinger for the 
opportunity to work on this project, and in particular would like to thank the 
PyMOL developers for their support and feedback along the way.

I hope many of you will find it useful.  If you come across any bugs or have 
any feature requests or other suggestions, please feel free to email me 
directly or create a new 
issue on Github.

Happy PyMOLing!

Cheers,
Jared
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
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

Re: [PyMOL] pymol in pthyon get_wizard() problems

2016-10-11 Thread Sampson, Jared M.
Hi Tim - It seems to me that cmd.get_wizard() needs some argument to be passed 
to it, because right now that function is returning `None`.  This explains the 
error, which states you're trying to call .set_dep() of a `None` object.

Hope that helps.

Cheers,
Jared

On Oct 11, 2016, at 2:48 PM, Timothy Craig 
> wrote:

Hello,
  I'm trying to adapt this script in python to do a variety of different 
mutations from a csv file using this previous message as a template.

https://sourceforge.net/p/pymol/mailman/message/11671708/

I'm a python novice so please excuse me if this is something simple. Here is a 
line that I have in my script that is giving me an error, which is now quite 
long so I don't want to post it all here now:
---

pymol.cmd.get_wizard().set_dep("dep")

error:

Error: unable to get setting type.

Traceback (most recent call last):

  File "pngCSVmutate.py", line 141, in 

pymol.cmd.get_wizard().set_dep("dep")

AttributeError: 'NoneType' object has no attribute 'set_dep'



It seems like something needs to go in the parentheses for get_wizard() since 
that's where the NoneType is coming from.  Sadly there is no pymol wiki page on 
get_wizard
 so I'm not sure where to look for the answer.  Does anyone have an idea or an 
example of the proper use of get_wizard() in python?
Thanks in advance for your help,
-Tim

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! 
http://sdm.link/slashdot___
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

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
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

Re: [PyMOL] 3D printing

2016-10-03 Thread Sampson, Jared M.
Hi Bob - 

I also haven't done much of anything with 3D printing myself, but having worked 
on the COLLADA exporter as one of my POSF fellowship projects, I can share some 
info about the formats themselves and what data is being included in the output 
files.

> Q: What output file types are supported? (WRL, X3D, STL[ASCII/binary], other)

The list on the Save wiki page is fairly complete.  It reads: 

"The file format is autodetected if the extension is .pdb, .pqr, .mol, .sdf, 
.pkl, .pkla, .mmd, .out, .dat, .mmod, .pmo, .pov, .png, .pse, .psw, .aln, 
.fasta, .obj, .mtl, .wrl, .idtf, .dae, or .mol2."

The 3D formats among these (that I recognize, anyway) are .obj (Wavefront 
Object), .mtl (Wavefront Material), .wrl (VRML2), .idtf (Intermediate Data Text 
Format), and .dae (COLLADA).


> Q: Does the generation of these include algorithms for ensuring closure or 
> for stitching together objects in order to not have ragged overlap?

I'm not sure what you mean by "stitching together objects," but in general, as 
long as you have fully closed surfaces, it shouldn't be an issue.  The only 
situation I can think of that would be problematic is if you had clipping panes 
that cut through the object's representation and end up with a hollow, 
infinitesimally thin shell.  That would be pretty difficult to print.  :)

> Q: What is needed to add support struts so that the model is connected and 
> strong enough?

No, this is related to what Paul was asking about recently.  My guess is some 
3D printing software or sites might have more appropriate tools to put these 
in, although you could do it manually (and probably quite tediously) with CGO 
cylinders or distance dashes with dash_gap = 0 if you know the orientation you 
want to use.

> Q: If features are not amenable to printing (labels,  perhaps?), are they 
> automatically ignored? Need to be manually removed?

As far as I know, none of the supported 3D formats include labels in their 
exported data.  Each one has its own implementation, but in general, 
representations stored within PyMOL as triangle meshes (surfaces and cartoons, 
primarily, although you can get everything as triangles with `set use_shaders, 
0`) are supported by all of them.  The COLLADA exporter also handles spheres, 
cylinders, sausages (i.e. rounded cylinders, such as ) and cones.  VRML2 
includes spheres, cylinders and sausages.  The .obj exporter has a bug in 
sphere export that I looked at about a year ago but got busy and didn't 
actually follow through on.  The others I don't know enough about to comment, 
but hopefully this gets you on the right track.

If you want to look further into it, check out the 
RayRender{VRML2,IDTF,ObjMtl,COLLADA} functions in layer1/Ray.cpp or 
layer1/COLLADA.cpp and look for cPrimTriangle, cPrimSphere, etc. for the 
various primitive types.

Hope that helps!

Cheers,
Jared



> 
> Thanks,
> 
> Bob Hanson
> --
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! 
> http://sdm.link/slashdot___
> 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


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
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


Re: [PyMOL] VRML export

2016-09-27 Thread Sampson, Jared M.
Hi Paul - I'm not too familiar with 3D printing, so not sure if this will help 
you or not.  But if all you need is to have extra cylinders in your output wrl 
file, you could add them using either CGO or distance objects directly within 
PyMOL.

https://pymolwiki.org/index.php/Distance
https://pymolwiki.org/index.php/CGOCylinder

Cheers,
Jared



On Sep 23, 2016, at 4:18 PM, Paul Paukstelis 
<shocksofmig...@gmail.com<mailto:shocksofmig...@gmail.com>> wrote:

Thanks, Jared.

I did ultimately find it there. Looks like what I was shooting for isn't likely 
to be very straightforward. From what I can tell, it doesn't seem that any of 
the atom information gets passed into RayRender.

--p

On 09/23/2016 12:34 PM, Sampson, Jared M. wrote:
Hi Paul -

The relevant function used for VRML export is RayRenderVRML2() in 
layer1/Ray.cpp.

Cheers,

Jared

On Sep 22, 2016, at 11:43 AM, Paul Paukstelis 
<shocksofmig...@gmail.com<mailto:shocksofmig...@gmail.com>> wrote:

Greetings,

I've started playing with 3D printing some ball-and-stick models
(primarily nucleic acids). I've worked up some Blender scripts to enable
automatic pinning (e.g. add a small pin to cylinder of the O3'-P bond
and a correspond hole in the phosphate sphere), however, I'm trying to
further decrease the amount of user input needed in Blender to
ultimately export the model parts for printing. One thing that would be
really useful would be to define some custom child nodes in the VRML
output (atom names for example) and subsequently input that into Blender
as custom properties. Could someone point me to the most relevant pymol
files responsible for VRML output? I did some quick fgrep'ing and didn't
find too much that was of use. Blender side was pretty easy to
accomplish so far.

Thanks,

--paul

--
___
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.net<mailto: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


--
___
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

Re: [PyMOL] VRML export

2016-09-23 Thread Sampson, Jared M.
Hi Paul - 

The relevant function used for VRML export is RayRenderVRML2() in 
layer1/Ray.cpp.

Cheers,

Jared

> On Sep 22, 2016, at 11:43 AM, Paul Paukstelis  
> wrote:
> 
> Greetings,
> 
> I've started playing with 3D printing some ball-and-stick models 
> (primarily nucleic acids). I've worked up some Blender scripts to enable 
> automatic pinning (e.g. add a small pin to cylinder of the O3'-P bond 
> and a correspond hole in the phosphate sphere), however, I'm trying to 
> further decrease the amount of user input needed in Blender to 
> ultimately export the model parts for printing. One thing that would be 
> really useful would be to define some custom child nodes in the VRML 
> output (atom names for example) and subsequently input that into Blender 
> as custom properties. Could someone point me to the most relevant pymol 
> files responsible for VRML output? I did some quick fgrep'ing and didn't 
> find too much that was of use. Blender side was pretty easy to 
> accomplish so far.
> 
> Thanks,
> 
> --paul
> 
> --
> ___
> 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


--
___
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


Re: [PyMOL] Session scene compatibility with MacPymol?

2016-09-08 Thread Sampson, Jared M.
Hi Paul -

I'm a little late on this thread, but thought I'd add my 2¢.  Probably the 
easiest way get around this issue (as you realize) is probably to save a 
1.7.4.5-compatible PSE file.  But, for the adventurous, there is another way:

With a small effort (and the willingness to use the command line), your 
students with Macs can replace the older Educational build of MacPyMOL with a 
current version of Open Source PyMOL for free using the command line package 
manager, Homebrew.  They just need to open up Terminal.app and 
type the following 3 commands:


# Install Homebrew (run the command below, which downloads the installer, and 
follow the prompts)
/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install XQuartz
brew install Caskroom/cask/xquartz

# Install PyMOL
brew install pymol


Pretty much everything homebrew installs goes into `/usr/local/Cellar` and gets 
symlinked to `/usr/local/bin`, and shouldn't interfere with any other standard 
software.  One notable exception is that Homebrew 
Cask items like Xquartz.app typically go into 
/Applications, because Cask handles the downloading of apps and installers and 
runs installers automatically.  Of course, you can just as easily download 
XQuartz from the project website and install it 
manually if you prefer.

It may take a few minutes to build PyMOL and its few dependencies. But that's 
it!  Now to open PyMOL they can open a Terminal window, `cd` to whatever 
directory they want to work in, and launch PyMOL by typing `pymol`.  This would 
not only get them a more up-to-date PyMOL version, but as an added bonus, a 
little exposure to a Unix command line environment.

Hope that helps.

Cheers,
Jared




On Sep 2, 2016, at 4:24 PM, Paul Paukstelis 
> wrote:

Are there known session issues with MacPymol? I've saved a session for
my students to look at using my linux incentive linux build and tried
various session compatibility settings (1.6, 1.74, 1.76) but in all
cases the preset scenes I've saved in the session are not loaded when
the session is opened in MacPymol (educational version 1.7.6 I believe).

Thanks,

--paul

--
___
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

--
___
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

Re: [PyMOL] Pymol spheres/circles

2016-08-30 Thread Sampson, Jared M.
Hi Laura -

You can also choose single atom selection mode through the menu: click Mouse > 
Selection mode > Atoms and then click your alpha carbon atom.  However, it can 
be tricky to hit the right atom if you're only looking at a cartoon 
representation, so I usually prefer to use the PyMOL command line as Osvaldo 
mentioned with something like:

```
select mutant, myprotein and resi 2
show spheres, mutant and name CA
```

Hope that helps.

Cheers,
Jared



On Aug 30, 2016, at 8:18 AM, Smith, Laura 
> wrote:

Hi,

I’m pretty new to Pymol and not that great with all the syntax etc.

I am wanting to easily show where a mutation is located in  cartoon model. I’ve 
tried to label the residues with spheres but it generates more than one dot and 
that’s not what I want. I just want one single sphere/circle/dot localised to 
an atom on the structure for me to label myself.

Basically like figure 2A in this paper >> 
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1326319/

Thanks,
Laura


--
___
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

--
___
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

Re: [PyMOL] Active site in Pymol

2016-08-24 Thread Sampson, Jared M.
Hi Farzaneh -

Are you looking for something programmatic to use for many different 
structures, or just analyzing a single structure?

With just one structure (or a few) you can do most of this using the GUI by eye.

1. To find the length of each H-bond involving your ligand, (let's say the 
object or selection is called "my_ligand"), click "S (show) > Labels" for the 
'my_ligand_polar_conts' object that was created when finding the H-bonds.

2. To see which kinds of residues are involved, you can type on the PyMOL 
command line: `show sticks, byres (my_ligand within 4)` which will show sticks 
for the entire residue (byres) of any residue with any atom within 4 Å of 
my_ligand.

3. For the number of H-bonds in an individual active site, you can probably 
just count them by eye.

Alternatively, if you need a more automated approach, have a look at Thomas 
Holder's Polarpairs plugin: http://www.pymolwiki.org/index.php/Polarpairs

Hope that helps.

Cheers,
Jared



On Aug 23, 2016, at 2:39 AM, Farzaneh Namazifar 
> wrote:

Hi Dear all;
I am a PyMol user.  I read the PyMOL 
tutorial
 about the hydrogen bond. I need some informations about hydrogen bond like:
1- length of hydrogen bond between two residue
2- which kind of residues are in the hydrogen bond
3- Number of hydrogen bond in active site
As above, I need informations about  Hydrophobicity of residues in the active 
site. and else information about pi-pi interaction in DNA... I need your help 
...
Best Regards.
Thank you in advance.
--
___
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

--
___
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

Re: [PyMOL] What's wrong with my pymol script?

2016-08-14 Thread Sampson, Jared M.
Hi Dd H -

`cmd.set` is the wrong command to use here.  (It's for changing settings, not 
for going through states, although some settings can be applied to only a 
specific state).

Instead, you should use `cmd.frame(i)` to move to that frame (state) number.

Note that the `width` and `height` arguments to 
`cmd.png` are in pixels unless you include 
a unit suffix like '10in' or '10cm', and it also takes a `ray` keyword argument 
if you want to ray trace for a nicer image.  Also, this is in a PyMOL (.pml) 
script instead of a Python (.py) script, you need to enclose any statement that 
requires multiple lines (i.e. loops, if/else, etc.) within a `python` block.

```
python
for i in range(1, cmd.count_states()+1):
 cmd.frame(i)
 cmd.png("%d.png" % (i), width='10in', height='10in', dpi=300, ray=1)
python end
```

Hope that helps.

Cheers,
Jared


On Aug 14, 2016, at 9:48 AM, Dd H > 
wrote:

Hi everyone,
I want to render images of frames of my trajectory that loaded in pymol with 
the script below. After running this script, pymol outputs images and they are 
all the same. So what's wrong with my script?

for i in range(1, cmd.count_states()+1):
 cmd.set("state", i, "traj")
 cmd.png("%d.png" % (i), width=10, height=10, dpi=300)

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. 
http://sdm.link/zohodev2dev___
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

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev___
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

Re: [PyMOL] Modeling protein-dna complex

2016-08-14 Thread Sampson, Jared M.
Hi soumi - 

A command-line version of what David said is the following:

save new_complex.pdb, protein_selection or dna_selection

where `protein_selection` and `dna_selection` include all the atoms you want to 
have in the final PDB.  They could be object names if you have each protein and 
the DNA in separate objects.

Hope that helps.

Cheers,
Jared

> On Aug 13, 2016, at 12:15 PM, David Hall  wrote:
> 
> Select the protein you want and the dna, then save the selection as a PDB.
> 
> There are many ways to make a selection; visually, the easiest might be:
> 
> You said you’ve removed the DNA from the protein-dna complex, so now you 
> should have:
> 
> (1) an object that has just your protein that you want in the complex
> (2) an object that has just your DNA that you want in the complex
> 
> In the bottom right, where it typically says “Selecting Residues”, click 
> where it says Residues until that it says “Objects”
> 
> Click on your protein
> 
> Click on your dna
> 
> Click on File->Save Molecule and save “sele” as a PDB file.
> 
>> On Aug 13, 2016, at 8:22 AM, soumi  wrote:
>> 
>> Hi,
>>I carry on my research work on protein-dna complex system.I have one dna 
>> pdb and one protein-dna complex pdb.I want to make new protein-dna complex 
>> pdb taking  dna from single pdb and protein from protein-dna complex.Protein 
>> possess similar DNA-binding specificities.I superimpose two pdb file and 
>> remove dna from protein-dna complex pdb .But I can not save new protein-dna 
>> complex.Please let me know by pymol how I would be able to model of the 
>> referred paper was done.
>> Thanks
>> soumi
>> --
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are 
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
>> J-Flow, sFlow and other flows. Make informed decisions using capacity 
>> planning reports. 
>> http://sdm.link/zohodev2dev___
>> 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
> 
> 
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are 
> consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
> J-Flow, sFlow and other flows. Make informed decisions using capacity 
> planning reports. http://sdm.link/zohodev2dev
> ___
> 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

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
___
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

Re: [PyMOL] Scripting in Pymol (+)

2016-07-13 Thread Sampson, Jared M.
Hi James -

For the first part, you should use split_states and super or cealign, as in my 
response to one of your emails last month.

https://sourceforge.net/p/pymol/mailman/message/35156097/

Then, once you have aligned all the trajectory structures (let's say they're 
called traj_01 through traj_10), you can create new objects from each of the 
snapshots and the heme using the `or` operator in the selection passed to 
`create`.

create heme_traj_01, traj_01 or resn HEM
create heme_traj_02, traj_02 or resn HEM
etc.

Hope that helps.

Cheers,
Jared

For 1, you need to get your MD simulatio
On Jul 12, 2016, at 3:05 AM, James Starlight 
> wrote:

Dear Pymol Users!

Here I desice to continue my topic regarding scripting in Pymol;

My current task:
I have 1 X-ray structure of cythochrome-C with HEME residue embedded
within the protein as a cofactor
I have 10 snapshots of cythochrome-C from MD trajectory where HEME was
not present explicitly

What I need from pymol to write some script, which will
1) align (superimpose) each MD snapshot againt reference
2) copy HEME residue from reference to each of the superimpsoed
snapshot within the same position.

Thanks so much for any suggestions regarding realization !

James

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
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

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev___
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

[PyMOL] Resetting PyMOL via API for unit testing

2016-06-24 Thread Sampson, Jared M.
tl;dr: Is there a way to fully stop and restart PyMOL "sessions" using the API 
to avoid crossover between unit tests?

Hi everyone -

I'm working on unit testing for a plugin and have been trying to figure out how 
to test some functionality from within a PyMOL session.  I have a partially 
working solution, but the problem arises that I can't adequately reinitialize 
PyMOL between tests, and sometimes end up getting carryover between tests.

Here's a working example of this behavior using the built-in `unittest` testing 
framework:

```
import unittest

import __main__
__main__.pymol_argv = ['pymol','-qkc']
import pymol
from pymol import cmd

class TestPymolApi(unittest.TestCase):
def setUp(self):
pymol.finish_launching()
cmd.reinitialize()

def tearDown(self):
#cmd.quit()  # ***this line hangs if uncommented***
pass

def test_1(self):
'''No value for stored.foo.'''
from pymol import stored
with self.assertRaises(AttributeError):
stored.foo

def test_2(self):
'''Sets a value for stored.foo.'''
from pymol import stored
stored.foo = 'bar'

#def test_3(self):
#'''Fails due to carryover from test_2.'''
#self.test_1()

if __name__ == '__main__':
unittest.main()
```


Running `python basic_tests.py` yields the following output (each dot 
represents a successful test):

```
$ python basic_tests.py
..
--
Ran 2 tests in 0.043s

OK
```


But if I uncomment `test_3` and re-run (the tests are executed in standard 
string-sorting order by function name), it fails because the value of 
`stored.foo` is retained even after reinitialization after `test_2`.  (The 
`setUp` and `tearDown` functions are run before and after each test, 
respectively.)

```
$ python basic_tests.py
..F
==
FAIL: test_3 (__main__.TestPymolApi)
--
Traceback (most recent call last):
  File "basic_tests.py", line 32, in test_3
self.test_1()
  File "basic_tests.py", line 24, in test_1
stored.foo
AssertionError: AttributeError not raised

--
Ran 3 tests in 0.110s

FAILED (failures=1)
```

Maybe this is a bug in `cmd.reinitialize()`?  If not, it is unexpected behavior 
(at least in my opinion), and could be improved.

Anyway, this is why I'm trying to figure out another way to reset PyMOL using 
the API.  So if I then uncomment the `cmd.quit()` line to try to get complete 
shut down and restart of PyMOL, unittest hangs on the tearDown of the first 
test and I have to interrupt the process with .

I found an old 
thread where Jason 
mentioned using (admittedly experimental) `pymol2.PyMOL().start/stop()` to, 
well, start and stop PyMOL sessions.  However, in Open Source PyMOL 1.8.2.1, it 
appears to be broken:

```
$ python
>>> import pymol2
>>> p = pymol2.PyMOL()
>>> p.start()
Segmentation fault: 11
```

So, again, my question is: Is there any way to reliably start and stop multiple 
PyMOL sessions or completely reset it using the API?

Looking forward any suggestions or further discussion.

Cheers,
Jared








--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
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

Re: [PyMOL] Analysis of docking poses from 2 nmr-ensembles

2016-06-13 Thread Sampson, Jared M.
Hi James -

First, it will be useful to split the 
states.

split_states ensemble1
split_states ensemble2
delete ensemble1
delete ensemble2

Then, superimpose all structures onto a 
reference structure for easier visualization.  This won't affect your distance 
measurements, but will make it easier to see the changes from one object to the 
next.

python
ref = 'ensemble1_0001'   # your reference object
for obj in cmd.get_names():
if obj != ref:
cmd.super(obj, ref)
python end

For your residue pair analysis, you have to decide what kind of distance you 
want to measure (e.g. CA-CA; average position of all atoms in the residue; 
closest atoms, which would require looping through all atom pairs in each 
residue pair and keeping only the shortest distance).  Then create selection 
strings based on those criteria, use them in 
distance measurement, and print 
them or add them to a variable to be output.  If you want to create and 
visualize distance objects, use `distance` instead of `get_distance` and pass a 
distance object name as the first parameter before the selections.

python
sel1 = "resi 100 and name CA"
sel2 = "resi 200 and name CA"
sel3 = "resi 300 and name CA"
for obj in cmd.get_names():
d12 = cmd.get_distance("{} and {}".format(obj, sel1), "{} and 
{}".format(obj, sel2))
d23 = cmd.get_distance("{} and {}".format(obj, sel2), "{} and 
{}".format(obj, sel3))
print "{}: '{}' to '{}' distance = {}".format(obj, sel1, sel2, d12)
print "{}: '{}' to '{}' distance = {}".format(obj, sel2, sel3, d23)
python end

This is just a very quick example; really there are many different ways to do 
this, and you'll have to find what kind of analysis your particular structure 
needs.  Also, if you want to look at H-bonds, it will be more complicated, 
because the angle is important as well.  In this case you may want to look at 
Thomas' Polarpairs script.

Hope that helps.

Cheers,
Jared



On Jun 13, 2016, at 9:41 AM, James Starlight 
> wrote:

Dear Pymol users!

I am studying protein-protein assosiation using 2 different proteins
as test case by means of variety of computational methods.
For my particular caseI need to compare binding poses emerged as the
result of protein-protein docking (ensemble 1: which  consists of 20
snapshots according to docking ranking) as well as MD simulation
(ensemble 2: which consists of 10 snapshots each of which represents
binding pose which has been established during long MD run).
Loading those two ensembles in pymol as 2 different models (in
NMR-like model format)  I need to performs some analysis  to find some
shared trends in each of them e.g RMSD of the distances between common
residues-pairs found in contact map analysis
or something else. What are most trivial suggestions might be in that
particular case?


Thanks for the suggestions!


James

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
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

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
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

Re: [PyMOL] Dynamic reloading of plugin

2016-04-27 Thread Sampson, Jared M.
Hi Martin - 

I've also experienced this kind of tedium.  Depending on the type of extension 
it is, you could also consider writing tests for your function that can be run 
by either:

a) importing PyMOL commands into a python (.py) script and running e.g. 
`nosetests` or other unit testing software

```extension_tests.pml
import pymol
from pymol import cmd
pymol.finish_launching()
...do stuff here...
```

or,

b) run PyMOL (.pml) scripts in command line only mode.

For example, I've used approach (b) before with a setup something like this:

```test1.pml
from pymol import cmd
frag ala
python
if 'ala' in cmd.get_names(): 
   print 'OK'
else: 
   print 'Not OK'
python end
```

Then run each test from the shell:

```
pymol -cq test1.pml
```

For running many tests automatically, I've also used a "run_tests.sh" that 
looks something like this:

```run_tests.sh
#!/bin/bash
function run_test() {
 PML="test${1}.pml"
 if [ -f "$PML" ]; then
   echo ""
   echo 
""
   echo "Running Test ${1}: $PML"
   echo ""
   pymol -ckq $PML
   echo ""
 fi
}

# call `./run_tests.sh` with no args to run all the tests (up to 100)
if [ $# -lt 1 ]; then
 for i in {1..100}  # increase if you have more than 100 tests
 do
   run_test $i
 done

# call with args, e.g. `./run_tests.sh 1 2 4 7` to run specific test(s)
else
 for i in $@
 do
   run_test $i
 done
fi 
```

Hope this is helpful.  Good luck!

Cheers,
Jared




> On Apr 25, 2016, at 11:06 AM, Thomas Holder  
> wrote:
> 
> Hi Martin,
> 
> how about:
> 
> set_key F1, run script.py; function_from_script()
> 
> Reduces step 3) and 4) to hitting "F1" on the keyboard.
> 
> Cheers,
> Thomas
> 
> On 24 Apr 2016, at 06:36, Martin Hediger  wrote:
> 
>> Hi all
>> 
>> When working on a PyMOL extension script, my workflow is currently something 
>> like this:
>> 
>> 1) Start PyMOL
>> 2) Work on script
>> 3) PyMOL> run script.py
>> 4) PyMOL> function_from_script()
>> 5) See if function works, go back to 2)
>> 
>> Is it possible to have PyMOL automatically re-run the script everytime i 
>> save it?
>> 
>> Thanks and best regards
>> Martin
>> 
>> -- 
>> Martin R. Hediger, PhD
>> Mittlere Strasse 65
>> 4056 Basel
> 
> -- 
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
> 
> 
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> 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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
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

Re: [PyMOL] on the alignment command

2016-04-15 Thread Sampson, Jared M.
Hi Smith -

`Align` takes selections as arguments, so something like the following should 
work.

align protA and chain A+B+C, protB and chain E+F+G

You could also use `super` or `cealign` instead of align, although with 
cealign, you should reverse the order of the arguments to achieve the same 
result.

Cheers,
Jared


On Apr 12, 2016, at 5:11 AM, Smith Liu 
> wrote:

Dear All,

Suppose my protein A PDB contains chian A, B, C, D, and my protein B PDB 
contains chain E, F, G, H, I want to align all protein A without chain D, with 
all protein B without chain H, will you please tell me the align command?

Smith



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
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

Re: [PyMOL] pymolrc location

2016-04-08 Thread Sampson, Jared M.
It should be a plain text file with no filename extension (i.e. no ".txt") in 
your home directory, with the full path:

/Users/yourusername/.pymolrc

You can do this with any text editor (including TextEdit--press Cmd-Shift-T to 
make it plain text), or, alternatively, the shell command:

echo "set auto_show_classified" >> ~/.pymolrc

which appends the quoted text to a new line in .pymolrc, creating the file if 
it doesn't exist.

Cheers,
Jared

On Apr 8, 2016, at 11:42 AM, harold steinberg 
> wrote:

Sorry to be inept… I've never had the opportunity to learn beyond the basics of 
Unix.

create a txt file or create a pml file?
Place it on the hard drive next to the library and system folder?
Or place it in the User folder next to the library folder?


On Apr 8, 2016, at 9:47 AM, David Hall 
> wrote:

Make a file at ~/.pymolrc

-David

On Apr 8, 2016, at 10:35 AM, harold steinberg 
> wrote:

where in OS X is pymolrc located?

On Apr 7, 2016, at 2:39 PM, Thomas Holder 
> wrote:

pymolrc

H. Adam Steinberg
7904 Bowman Rd
Lodi, WI 53555
608/592-2366


--
___
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

H. Adam Steinberg
7904 Bowman Rd
Lodi, WI 53555
608/592-2366


--
___
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

--
___
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

Re: [PyMOL] The Wiki appears outdated or in error

2016-03-25 Thread Sampson, Jared M.
Hi Jim -

Here's a patch for Open Source PyMOL (rev4153) that adds the 
"collada_background_box" setting (default=0).  If you're using Open Source 
PyMOL and are up to applying it and rebuilding, feel free to use it.  
Otherwise, I already sent it to Thomas, so hopefully it will be incorporated 
into SVN and Incentive PyMOL soon.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 24, 2016, at 2:26 PM, Sampson, Jared M. 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:

Hi Jim -

When I

set geometry_export_mode, 1

in PyMOL, then save myfile.dae, then import into MeshLab, MeshLab hangs.

I can confirm that this happens for me, too.  I guess maybe Meshlab requires 
the camera?

As a workaround, you can go back to the previous version with 
collada_geometry_mode=1 and simply delete the box.  You can do this within 
Meshlab by using the "Select Connected Components in a region" tool to select a 
corner the box, then clicking the "Delete the current set of selected faces and 
all the vertices surrounded by that faces" button (see attached screenshot).  
Then, if you zoom in (the box is 100x larger than the largest dimension of the 
scene), your scene will be there.

I'm working on a patch right now to exclude the bounding background box from 
default COLLADA output and make it optional via a new `collada_background_box` 
setting.

Sorry for the confusion, hope this clears it up.

Cheers,
Jared

--
Jared Sampson
Columbia University




collada_background_box.patch
Description: collada_background_box.patch
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351=/4140___
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

Re: [PyMOL] The Wiki appears outdated or in error

2016-03-24 Thread Sampson, Jared M.
Hi Jim -

When I

set geometry_export_mode, 1

in PyMOL, then save myfile.dae, then import into MeshLab, MeshLab hangs.

I can confirm that this happens for me, too.  I guess maybe Meshlab requires 
the camera?

As a workaround, you can go back to the previous version with 
collada_geometry_mode=1 and simply delete the box.  You can do this within 
Meshlab by using the "Select Connected Components in a region" tool to select a 
corner the box, then clicking the "Delete the current set of selected faces and 
all the vertices surrounded by that faces" button (see attached screenshot).  
Then, if you zoom in (the box is 100x larger than the largest dimension of the 
scene), your scene will be there.

I'm working on a patch right now to exclude the bounding background box from 
default COLLADA output and make it optional via a new `collada_background_box` 
setting.

Sorry for the confusion, hope this clears it up.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 24, 2016, at 1:05 PM, James Kress 
<jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>> wrote:

Hi Jared,

When I

set geometry_export_mode, 1

in PyMOL, then save myfile.dae, then import into MeshLab, MeshLab hangs.  Is 
there an alternative to MeshLab I can use to generate the u3d file?

Thanks.

Jim

James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org<http://www.kressworks.org/>
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential or 
proprietary information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, immediately 
contact the sender by reply e-mail and destroy all copies of the original 
message.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Wednesday, March 23, 2016 10:53 PM
To: jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>
Cc: pymol-users <pymol-users@lists.sourceforge.net>
Subject: Re: [PyMOL] The Wiki appears outdated or in error

Hi Jim -

This is something we've been talking about changing.  The entire scene as 
viewed within PyMOL is inside that block, including the camera position.   (The 
interior surface of the block itself provides the background color of the 
scene.)  Some viewers, e.g. Mac Preview.app, default to displaying from the 
camera position, but others, including MeshLab, don't, which is understandably 
confusing.

To export only the geometry without any of the scene information, you can `set 
geometry_export_mode, 1` in PyMOL before saving the .dae.

Hope that helps!

Cheers,
Jared

P.S. if you are able to work out a protocol/workflow for generating 3D PDFs 
that is better than what's on the wiki, I hope you will consider updating the 
wiki to help others who might try it in the future.

Jared Sampson
Columbia University

On Mar 23, 2016, at 8:26 PM, James Kress 
<jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>> wrote:

I installed v 1.8.0.6

When I save ‘myfile.dae’ and then import into MeshLab, all I get is a solid 
gray block.

What do I need to do in PyMOL to export my DNA structure?

Thanks.

Jim

James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org<http://www.kressworks.org/>
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential or 
proprietary information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, immediately 
contact the sender by reply e-mail and destroy all copies of the original 
message.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Tuesday, March 22, 2016 1:40 PM
To: jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>
Cc: pymol-users 
<pymol-users@lists.sourceforge.net<mailto:pymol-users@lists.sourceforge.net>>
Subject: Re: [PyMOL] The Wiki appears outdated or in error

Hi Jim -

The COLLADA exporting code was incorporated into Open Source PyMOL starting 
with 1.7.3.2 (SVN 4097), but I'm not sure when it made it into Incentive PyMOL, 
so if that's what you're using, 1.7.4 might be just barely too early to have 
that capability.  You could try saving as VRML2, (`save myfile.wrl`) and use 
MeshLab to convert that instead of the COLLADA file--I think VRML output is 
more complete than IDTF.

Alternat

Re: [PyMOL] The Wiki appears outdated or in error

2016-03-23 Thread Sampson, Jared M.
Hi Jim -

This is something we've been talking about changing.  The entire scene as 
viewed within PyMOL is inside that block, including the camera position.   (The 
interior surface of the block itself provides the background color of the 
scene.)  Some viewers, e.g. Mac Preview.app, default to displaying from the 
camera position, but others, including MeshLab, don't, which is understandably 
confusing.

To export only the geometry without any of the scene information, you can `set 
geometry_export_mode, 1` in PyMOL before saving the .dae.

Hope that helps!

Cheers,
Jared

P.S. if you are able to work out a protocol/workflow for generating 3D PDFs 
that is better than what's on the wiki, I hope you will consider updating the 
wiki to help others who might try it in the future.

Jared Sampson
Columbia University

On Mar 23, 2016, at 8:26 PM, James Kress 
<jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>> wrote:

I installed v 1.8.0.6

When I save ‘myfile.dae’ and then import into MeshLab, all I get is a solid 
gray block.

What do I need to do in PyMOL to export my DNA structure?

Thanks.

Jim

James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org<http://www.kressworks.org/>
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential or 
proprietary information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, immediately 
contact the sender by reply e-mail and destroy all copies of the original 
message.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Tuesday, March 22, 2016 1:40 PM
To: jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>
Cc: pymol-users <pymol-users@lists.sourceforge.net>
Subject: Re: [PyMOL] The Wiki appears outdated or in error

Hi Jim -

The COLLADA exporting code was incorporated into Open Source PyMOL starting 
with 1.7.3.2 (SVN 4097), but I'm not sure when it made it into Incentive PyMOL, 
so if that's what you're using, 1.7.4 might be just barely too early to have 
that capability.  You could try saving as VRML2, (`save myfile.wrl`) and use 
MeshLab to convert that instead of the COLLADA file--I think VRML output is 
more complete than IDTF.

Alternatively, you could install a more recent open source PyMOL using 
instructions available on the wiki: 
http://www.pymolwiki.org/index.php/Category:Installation.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 21, 2016, at 5:46 PM, James Kress 
<jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>> wrote:

Hi Jared,

The version of PyMOL I am using (1.7.4.0) does not recognize the dae file type.

Here is the message PyMOL generates:

PyMOL>save output_no_H2O.dae
Save-Warning: Unrecognized file type -- defaulting to PDB format.
Save: wrote "output_no_H2O.dae".

I get the same error message if I use the command ‘save output_no_H2O.dae’

Jim


James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org<http://www.kressworks.org/>
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential or 
proprietary information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, immediately 
contact the sender by reply e-mail and destroy all copies of the original 
message.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Wednesday, March 16, 2016 2:28 PM
To: jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>
Cc: pymol-users@lists.sourceforge.net<mailto:pymol-users@lists.sourceforge.net>
Subject: Re: [PyMOL] The Wiki appears outdated or in error

Hi James -

If I remember correctly, PyMOL's IDTF output currently only supports triangles 
meshes (not cylinders or spheres, e.g.), so unfortunately you're basically 
limited to surface representations for output directly into that format.

As a workaround, you could try saving your scene in COLLADA format (`save 
myfile.dae`), and use an external program (e.g. Blender, Meshlab) to convert to 
IDTF or U3D.  When doing so, please note that you'll probably need to `set 
collada_geometry_mode=1` to specifically use the subset of COLLADA elements 
supported by those two programs (they only allow  elements to 
describe the triangles, which are a more g

Re: [PyMOL] color an isosurface with a rainbow

2016-03-23 Thread Sampson, Jared M.
Hi H. Adam -

Try the http://pymolwiki.org/index.php/Distancetoatom script by Andreas 
Warnecke and use it to set b (or your own custom property in recent Incentive 
PyMOL versions) based on the distance from a point.

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 23, 2016, at 5:20 PM, harold steinberg 
> wrote:

I have a pdb ‘xyz1’ and create a mapA, then create a surfA.

set surface_quality, 1
alter all, b=50
alter all, q=1
set gaussian_resolution,5
map_new mapA, gaussian, 1, sele or pdb, 6
isosurface surfA, mapA

I can then color that surfA with any solid color.

How can one color the surfA with a rainbow affect that radiates out from the 
center, or similar.

This is easy to do with a protein (pdb) but I cannot get a ramp to work with a 
surf.


H. Adam Steinberg
7904 Bowman Rd
Lodi, WI 53555
608/592-2366

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351=/4140___
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

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351=/4140___
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

Re: [PyMOL] The Wiki appears outdated or in error

2016-03-22 Thread Sampson, Jared M.
Hi Jim -

The COLLADA exporting code was incorporated into Open Source PyMOL starting 
with 1.7.3.2 (SVN 4097), but I'm not sure when it made it into Incentive PyMOL, 
so if that's what you're using, 1.7.4 might be just barely too early to have 
that capability.  You could try saving as VRML2, (`save myfile.wrl`) and use 
MeshLab to convert that instead of the COLLADA file--I think VRML output is 
more complete than IDTF.

Alternatively, you could install a more recent open source PyMOL using 
instructions available on the wiki: 
http://www.pymolwiki.org/index.php/Category:Installation.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 21, 2016, at 5:46 PM, James Kress 
<jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>> wrote:

Hi Jared,

The version of PyMOL I am using (1.7.4.0) does not recognize the dae file type.

Here is the message PyMOL generates:

PyMOL>save output_no_H2O.dae
Save-Warning: Unrecognized file type -- defaulting to PDB format.
Save: wrote "output_no_H2O.dae".

I get the same error message if I use the command ‘save output_no_H2O.dae’

Jim


James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org<http://www.kressworks.org/>
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential or 
proprietary information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, immediately 
contact the sender by reply e-mail and destroy all copies of the original 
message.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Wednesday, March 16, 2016 2:28 PM
To: jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>
Cc: pymol-users@lists.sourceforge.net
Subject: Re: [PyMOL] The Wiki appears outdated or in error

Hi James -

If I remember correctly, PyMOL's IDTF output currently only supports triangles 
meshes (not cylinders or spheres, e.g.), so unfortunately you're basically 
limited to surface representations for output directly into that format.

As a workaround, you could try saving your scene in COLLADA format (`save 
myfile.dae`), and use an external program (e.g. Blender, Meshlab) to convert to 
IDTF or U3D.  When doing so, please note that you'll probably need to `set 
collada_geometry_mode=1` to specifically use the subset of COLLADA elements 
supported by those two programs (they only allow  elements to 
describe the triangles, which are a more general, verbose description than the 
more concise  and  output generated with the default 
setting).

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 12, 2016, at 11:24 PM, James Kress 
<jimkress...@kressworks.org<mailto:jimkress...@kressworks.org>> wrote:

Among the export functions, a particular interest of mine is the as a
idtf file as "precursor" for a 3d pdf mentioned at

http://www.pymolwiki.org/index.php/3d_pdf

where I experience difficulties I want to address here.

   While the export via the CLI works fine for creating a *.png picture
or a VRML *.wrl-geometry, the similar export as *.idtf creates only a
header to describe the scenery, but not the (expected) spheres and tubes
to represent atoms and molecular bonds.  The file generated is the same,
regardless if I request the data export via

save /home/user directory/target directory/test.idtf

or the recommended

save /home/user directory/target directory/test.idtf,*

Marking/highlighting the molecule in question does not alter the situation.

   The relative orientation of the model in regard to the observer is
provided, however, in the programs command line, like

3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=50.00, 3Dcoo=0 0 -50.00

  In addition, there is no *.tex file written -- well in contrast to the
pymol-wiki page -- that I would expect to be created in the very same
directory, too.  (This is contrast to jmol offering export as *.idtf
while simultaneously writing a *.tex file, too.)  Should I look up in a
different directory instead?  May be a mistake during the installation
be a reason why I do not obtain (yet) a functional *.idtf?  Do I need to
load another / an additional plugin to enlarge the export functions?

Thanks.

Jim

James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org<http://www.kressworks.org/>
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the i

Re: [PyMOL] The Wiki appears outdated or in error

2016-03-19 Thread Sampson, Jared M.
Hi James -

If I remember correctly, PyMOL's IDTF output currently only supports triangles 
meshes (not cylinders or spheres, e.g.), so unfortunately you're basically 
limited to surface representations for output directly into that format.

As a workaround, you could try saving your scene in COLLADA format (`save 
myfile.dae`), and use an external program (e.g. Blender, Meshlab) to convert to 
IDTF or U3D.  When doing so, please note that you'll probably need to `set 
collada_geometry_mode=1` to specifically use the subset of COLLADA elements 
supported by those two programs (they only allow  elements to 
describe the triangles, which are a more general, verbose description than the 
more concise  and  output generated with the default 
setting).

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 12, 2016, at 11:24 PM, James Kress 
> wrote:

Among the export functions, a particular interest of mine is the as a
idtf file as "precursor" for a 3d pdf mentioned at

http://www.pymolwiki.org/index.php/3d_pdf

where I experience difficulties I want to address here.

   While the export via the CLI works fine for creating a *.png picture
or a VRML *.wrl-geometry, the similar export as *.idtf creates only a
header to describe the scenery, but not the (expected) spheres and tubes
to represent atoms and molecular bonds.  The file generated is the same,
regardless if I request the data export via

save /home/user directory/target directory/test.idtf

or the recommended

save /home/user directory/target directory/test.idtf,*

Marking/highlighting the molecule in question does not alter the situation.

   The relative orientation of the model in regard to the observer is
provided, however, in the programs command line, like

3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=50.00, 3Dcoo=0 0 -50.00

  In addition, there is no *.tex file written -- well in contrast to the
pymol-wiki page -- that I would expect to be created in the very same
directory, too.  (This is contrast to jmol offering export as *.idtf
while simultaneously writing a *.tex file, too.)  Should I look up in a
different directory instead?  May be a mistake during the installation
be a reason why I do not obtain (yet) a functional *.idtf?  Do I need to
load another / an additional plugin to enlarge the export functions?

Thanks.

Jim

James Kress Ph.D., President
The KressWorks® Foundation
An IRS Approved 501 (c)(3) Charitable, Nonprofit Organization
“Engineering The Cure” ©
(248) 605-8770

Learn More and Donate At:
Website: http://www.kressworks.org
Facebook: https://www.facebook.com/KressWorks.Foundation/
Twitter: @KressWorksFnd

Confidentiality Notice | This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential or 
proprietary information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, immediately 
contact the sender by reply e-mail and destroy all copies of the original 
message.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140___
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

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
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

Re: [PyMOL] How to tell from within a script if a plugin is loaded?

2016-02-19 Thread Sampson, Jared M.
Hi Thomas -

Thanks for the clarification on cmd.extend() and the difference between how 
commands and functions are made available. I hadn't thought to just add the 
function to cmd directly.  This will come in handy!

Cheers,
Jared

--
Jared Sampson
Columbia University

On Feb 18, 2016, at 1:14 PM, Thomas Holder 
<thomas.hol...@schrodinger.com<mailto:thomas.hol...@schrodinger.com>> wrote:

Hi Jared,

The plugin system isn't really tuned for API extension. As Tsjerk pointed out, 
cmd.extend only registers a command, not a cmd. function. Also, scripts 
which are installed as plugins get loaded asynchronously from the external GUI. 
I suggest you do the following:

1) Inside your plugin (Python module), do:

from pymol import cmd
def my_func(): ...
cmd.my_func = my_func
cmd.extend('my_func', my_func)

2) The plugin's __init_plugin__ (or __init__) function should only be 
responsible for adding Plugin menu entries, not for anything else.

3) Inside your test file, do:

from pymol import cmd
import pmg_tk.startup.my_plugin
# (now cmd.my_func should be available immediately)

Hope that helps.

Cheers,
 Thomas

On 17 Feb 2016, at 11:32, Sampson, Jared M. 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:

Hi Tsjerk -

Thanks for the suggestion.  I tried this with:

import time
from pymol import cmd
while not hasattr(cmd, 'my_func'):
time.sleep(0.5)

Unfortunately that also causes everything to hang.  I think I might need to do 
this in a separate thread.  I'll have to look into how to do that.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Feb 16, 2016, at 2:47 PM, Tsjerk Wassenaar 
<tsje...@gmail.com<mailto:tsje...@gmail.com>> wrote:

Hi Jared,

The extend function must set an attribute "my_func" on cmd. You can test for 
that with hasattr:

while not hasattr(cmd, "my_func"):
   # wait some more

Hope it helps,

Tsjerk

On Feb 16, 2016 20:07, "Sampson, Jared M." 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:
To my previous message I should add that it works fine if I do:

```
import pmg_tk.startup.my_plugin as mp
mp.my_func()
```

but I'd like to use the `cmd.my_func()` version, so that `my_func` will work in 
a .pml script.

>From `help(cmd)` I found `cmd.kw_list`, but this apparently doesn't include 
>"extended" functions, even after the function is loaded.

```
PyMOL>print 'ray' in cmd.kw_list
True
PyMOL>print 'my_func' in cmd.kw_list
False
```

Looking forward to any suggestions.  Thanks!

Cheers,
Jared

--
Jared Sampson
Columbia University

On Feb 16, 2016, at 1:50 PM, Sampson, Jared M. 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:

Hi PyMOLers -

Maybe some more experienced users/developers can help me out here.  I'm trying 
to write some automated test scripts for the plugin I'm writing, but the test 
functions end up running before the plugin is loaded.  Is there a way to tell 
if a plugin has been loaded from within a .pml or .py script?  For example, if 
the plugin makes commands available via `cmd.extend('my_func', my_func)`, how 
can I run `cmd.myfunc()` from a script and not have it execute before the 
plugin finishes loading?

I've tried something like this:

```
import time
from pymol import cmd
loaded = 0
while not loaded:
   try:
   cmd.my_func()  # if it's loaded no exception will be raised
   loaded = 1
   except:
   time.sleep(0.5)
```

But this just hangs, as apparently `time.sleep()` halts the execution of all 
threads, so the plugin won't ever be loaded.

Thanks,
Jared

--
Jared Sampson
Columbia University

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
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

Re: [PyMOL] How to tell from within a script if a plugin is loaded?

2016-02-17 Thread Sampson, Jared M.
Hi Tsjerk -

Thanks for the suggestion.  I tried this with:

import time
from pymol import cmd
while not hasattr(cmd, 'my_func'):
time.sleep(0.5)

Unfortunately that also causes everything to hang.  I think I might need to do 
this in a separate thread.  I'll have to look into how to do that.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Feb 16, 2016, at 2:47 PM, Tsjerk Wassenaar 
<tsje...@gmail.com<mailto:tsje...@gmail.com>> wrote:


Hi Jared,

The extend function must set an attribute "my_func" on cmd. You can test for 
that with hasattr:

while not hasattr(cmd, "my_func"):
# wait some more

Hope it helps,

Tsjerk

On Feb 16, 2016 20:07, "Sampson, Jared M." 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:
To my previous message I should add that it works fine if I do:

```
import pmg_tk.startup.my_plugin as mp
mp.my_func()
```

but I'd like to use the `cmd.my_func()` version, so that `my_func` will work in 
a .pml script.

>From `help(cmd)` I found `cmd.kw_list`, but this apparently doesn't include 
>"extended" functions, even after the function is loaded.

```
PyMOL>print 'ray' in cmd.kw_list
True
PyMOL>print 'my_func' in cmd.kw_list
False
```

Looking forward to any suggestions.  Thanks!

Cheers,
Jared

--
Jared Sampson
Columbia University

On Feb 16, 2016, at 1:50 PM, Sampson, Jared M. 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:

Hi PyMOLers -

Maybe some more experienced users/developers can help me out here.  I'm trying 
to write some automated test scripts for the plugin I'm writing, but the test 
functions end up running before the plugin is loaded.  Is there a way to tell 
if a plugin has been loaded from within a .pml or .py script?  For example, if 
the plugin makes commands available via `cmd.extend('my_func', my_func)`, how 
can I run `cmd.myfunc()` from a script and not have it execute before the 
plugin finishes loading?

I've tried something like this:

```
import time
from pymol import cmd
loaded = 0
while not loaded:
try:
cmd.my_func()  # if it's loaded no exception will be raised
loaded = 1
except:
time.sleep(0.5)
```

But this just hangs, as apparently `time.sleep()` halts the execution of all 
threads, so the plugin won't ever be loaded.

Thanks,
Jared

--
Jared Sampson
Columbia University

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.net<mailto: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


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.net<mailto: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

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
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

Re: [PyMOL] How to tell from within a script if a plugin is loaded?

2016-02-16 Thread Sampson, Jared M.
To my previous message I should add that it works fine if I do:

```
import pmg_tk.startup.my_plugin as mp
mp.my_func()
```

but I'd like to use the `cmd.my_func()` version, so that `my_func` will work in 
a .pml script.

>From `help(cmd)` I found `cmd.kw_list`, but this apparently doesn't include 
>"extended" functions, even after the function is loaded.

```
PyMOL>print 'ray' in cmd.kw_list
True
PyMOL>print 'my_func' in cmd.kw_list
False
```

Looking forward to any suggestions.  Thanks!

Cheers,
Jared

--
Jared Sampson
Columbia University

On Feb 16, 2016, at 1:50 PM, Sampson, Jared M. 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:

Hi PyMOLers -

Maybe some more experienced users/developers can help me out here.  I'm trying 
to write some automated test scripts for the plugin I'm writing, but the test 
functions end up running before the plugin is loaded.  Is there a way to tell 
if a plugin has been loaded from within a .pml or .py script?  For example, if 
the plugin makes commands available via `cmd.extend('my_func', my_func)`, how 
can I run `cmd.myfunc()` from a script and not have it execute before the 
plugin finishes loading?

I've tried something like this:

```
import time
from pymol import cmd
loaded = 0
while not loaded:
try:
cmd.my_func()  # if it's loaded no exception will be raised
loaded = 1
except:
time.sleep(0.5)
```

But this just hangs, as apparently `time.sleep()` halts the execution of all 
threads, so the plugin won't ever be loaded.

Thanks,
Jared

--
Jared Sampson
Columbia University

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
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

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
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

[PyMOL] How to tell from within a script if a plugin is loaded?

2016-02-16 Thread Sampson, Jared M.
Hi PyMOLers -

Maybe some more experienced users/developers can help me out here.  I'm trying 
to write some automated test scripts for the plugin I'm writing, but the test 
functions end up running before the plugin is loaded.  Is there a way to tell 
if a plugin has been loaded from within a .pml or .py script?  For example, if 
the plugin makes commands available via `cmd.extend('my_func', my_func)`, how 
can I run `cmd.myfunc()` from a script and not have it execute before the 
plugin finishes loading?

I've tried something like this:

```
import time
from pymol import cmd
loaded = 0
while not loaded:
try:
cmd.my_func()  # if it's loaded no exception will be raised
loaded = 1
except:
time.sleep(0.5)
```

But this just hangs, as apparently `time.sleep()` halts the execution of all 
threads, so the plugin won't ever be loaded.

Thanks,
Jared

--
Jared Sampson
Columbia University

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
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

Re: [PyMOL] PyMOL-users Digest, Vol 116, Issue 15

2016-02-02 Thread Sampson, Jared M.
Hi Annemarie -

Fun problem.  It looks like cmd.transform_selection() only works with 
"molecule" type objects, not with CGOs. You could try doing something like 
what's in the 3rd example in http://www.pymolwiki.org/index.php/Axes, 
calculating the new object matrix itself by transforming the current one, then 
applying it to the object using cmd.set_object_ttt().

Alternatively, if you can reproducibly identify any vector that should be 
perpendicular to the membrane, you could use those points as the start and end 
points for your initial load_cgo command.  For example, if your receptor 
happens to have a symmetric channel, something like this might work.

```
# create pseudoatoms at the average positions of residues at the top and bottom 
of the chain
pseudoatom top,  and n. CA and chain A+B+C+D
pseudoatom bot,  and n. CA and chain A+B+C+D

# Orient to the pseudoatoms and fine tune the positions along the viewport Y 
axis.
# (Make sure you don't move the view until you're done positioning the 
pseudoatoms.)
orient (top or bot)
turn z, 90  # assuming `orient` put them along X and you want them along Y
translate [0, 2, 0], top
translate [0, -1.5, 0], bot

# Get the coordinates of the two end points
from pymol import stored
stored.start = []
stored.end = []
iterate_state 1, top, stored.start = (x,y,z)
iterate_state 1, bot, stored.end = (x,y,z)

# Create the CGO cylinder (I made it semitransparent)
from pymol.cgo import ALPHA, CYLINDER
x1,y1,z1 = stored.start
x2,y2,z2 = stored.end
r1,g1,b1 = 1, 1, 0
r2,g2,b2 = 1, 1, 0
radius = 100
cmd.load_cgo([ ALPHA, 0.5, CYLINDER, x1, y1, z1, x2, y2, z2, radius, r1, g1, 
b1, r2, g2, b2 ], "membrane")

```

Not sure if that will be applicable to your use case, but hopefully it will at 
least give you an idea of one approach that could work.

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Columbia University


On Jan 29, 2016, at 4:33 PM, Honegger Annemarie 
> wrote:

I am trying to show some cell surface receptors and to indicate their position 
relative to the membrane.

I thought to indicate the plane of the membrane by a flat disk, a ago cylinder.

x1,y1,z1 = 0, -1, 0 # start point
r1,g1,b1 = 1, 1, 0 # color (yellow)
x2,y2,z2 = 0, -2, 0 # end point
r2,g2,b2 = 1, 1, 0 # color (yellow)
radius = 100
cmd.load_cgo( [ 9.0, x1, y1, z1, x2, y2, z2, radius, r1, g1, b1, r2, g2, b2 ], 
"membrane" )

When I try to move this cylinder into the correct position with 
cmd.transform_selection,
using the transformation parameters extracted from get_view (reordering them as 
needed)
I get the error message "Selector-Error: Invalid selection name “membrane” “

The same transform command works fine if I apply it to a pseudo atom originally 
generated with coordinates 0,0,0.

Any suggestion how else I could indicate the membrane, or how I could place my 
ego object parallel
to the screen yz plane? I have to be able to do this in a reproducible fashion, 
as I have to  do this
for a large number of constructs that bend my receptors relative to the 
membrane in various ways.

Thanks for your help
Annemarie
___

Dr. Annemarie Honegger PhD
Department
of Biochemistry
Zürich University
Winterthurerstrasse 190
CH-8057 Zürich
Switzerland

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
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

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
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

Re: [PyMOL] using "bymol" in combination with "within"

2015-12-03 Thread Sampson, Jared M.
Hi Andrew -

If you're just looking to expand the selection from atoms in water molecules to 
entire water molecules, I would actually use `byres` instead of `bymol`.  The 
`bymolecule` selector is apparently dependent on how PyMOL sees the bonds (e.g. 
try `fetch 3ghe, async=0; select test, bymol chain H and resi 30` -- you only 
select up to the gap at resi 127).  `Byres` should get the entire HOH residue 
as defined by the residue name and number, as long as they are unique for each 
of your water molecules.

So, in short, this should work:

select closewats, byres (wats within 3 of solute)

Or as Spencer mentioned, using the built-in keywords:

select closewats, byres (solvent within 3 of organic)

Or, if you have multiple organic components and only one of them is your 
ligand, which has the residue name DRG:

select closewats, byres (solvent within 3 of resn DRG)

Hope that helps.

Cheers,
Jared

—
Jared Sampson
Graduate Student
Department of Biochemistry and Molecular Biophysics
Columbia University

On Dec 2, 2015, at 2:57 PM, Andrew Kalenkiewicz 
> wrote:

Hi Spencer,

Thanks for your response! I was also originally under the impression that my 
selection #2 should be a superset of selection #1, but that is definitely not 
the case. There are atoms in selection #1 that are not included in selection #2.

What I want to do is select all the water molecules that have at least one of 
their atoms within 3 angstroms of my protein-ligand complex (the solute). Based 
on the above discrepancy, I know that selection #2 does not give me this. This 
is corroborated by an independent calculation I did in a different program (the 
Bio3D pacakge in R).

All best,
Andrew

On Wed, Dec 2, 2015 at 10:53 AM, Spencer Bliven 
> wrote:
Andrew,

The 'byres' selector expands the inner selection to include all covalently 
bonded atoms. Thus, your selection #2 should be a superset of selection #1. Are 
you sure that's not the case?

What do your 'wats' and 'solute' selections refer to? Are you trying to find 
the water molecules to some selected organic solvent molecule? If so, you might 
mean

select wats within 3 of (bymolecule solute)

This would first expand selection 'solute' to encompass any covalently 
connected atoms, then would return any atoms from selection 'wats' which are 
within 3Å of the resulting molecule.

A more complete explanation of what you're trying to select (and which PDB 
entry, if applicable) would be helpful.

-Spencer

P.S. You might also be interested in the predefined keywords 'solvent' (all 
waters) and 'organic' (ligands, buffers).

On Wed, Dec 2, 2015 at 3:32 PM Andrew Kalenkiewicz 
> wrote:
Dear PyMOL users,

I'm wondering if anyone knows how exactly a selection is defined if you utilize 
both the "bymol" and "within" commands together. For instance, consider the 
following two selections:

1. "select closewats, wats within 3 of solute"
2. "select closewats, bymol (wats within 3 of solute)"

In the latter case, it seems to me that the distance cutoff imposed by within 
is not by "closest atom" for each respective molecule (which is what I actually 
want). Visually, I can see that the first selection includes more total water 
molecules than the second selection. So what does the distance cutoff refer to? 
The geometrical center? Center of mass? I couldn't find anything on the PyMOL 
wiki that explains this.

Thanks,
Andrew

--
Andrew Kalenkiewicz
Biomedical Engineering M.S.E. '15
Cellular & Molecular Biology B.S. '13
University of Michigan, Ann Arbor
734-709-0355
aj...@umich.edu
--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140___
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



--
Andrew Kalenkiewicz
Biomedical Engineering M.S.E. '15
Cellular & Molecular Biology B.S. '13
University of Michigan, Ann Arbor
734-709-0355
aj...@umich.edu
--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.

Re: [PyMOL] on axis of the subunit

2015-11-30 Thread Sampson, Jared M.
Hi Smith -

I’m not quite sure what you mean by "axis of a subunit."  If you mean the 
principal axis of that selection of atoms, `orient my_selection` will get it 
aligned along one of the axes.  Then you can create pseudoatoms on that axis 
and create a dash between them with the distance command.

# Get it lined up with the viewport axes.
select domain, chain A and resi 1-100
orient domain

# Here I’m assuming this put the long axis of the domain along the
# x axis.  We move the view along the x axis, and place pseudoatoms
# at the viewport center in two places.  You can change the length of the
# displayed axis based on how far you move.
move x, -10
pseudoatom ps1
move x, 20
pseudoatom ps2
move x, -10
distance axis, ps1, ps2

This is a bit clumsy and not a rigorous approach, but it will work for any 
other kind of vector you want to show, as long as you can get it aligned with 
one of the view axes.

Cheers,
Jared

—
Jared Sampson
Graduate Student
Department of Biochemistry and Molecular Biophysics
Columbia University

On Nov 29, 2015, at 7:42 AM, Smith Liu 
> wrote:

Dear All,

Will you please show me how to display an axis of a subunit or a domain by 
pymol?

Smith



--
___
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

--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140___
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

Re: [PyMOL] on axis of the subunit

2015-11-30 Thread Sampson, Jared M.
Hi Smith -

Check out how I did it in the http://pymolwiki.org/index.php/Elbow_angle 
script.  As long as you have the vectors, the angle is easy.  In particular, 
have a look at this line:

elbow = int(numpy.degrees(numpy.arccos(numpy.dot(direction_v, 
direction_c


i.e. the angle (in radians) will be given by the arccos of the dot product of 
the two vectors.  For the elbow angle script, I converted to degrees and 
reported an integer value.

Cheers,
Jared

—
Jared Sampson
Graduate Student
Department of Biochemistry and Molecular Biophysics
Columbia University

On Nov 30, 2015, at 8:33 PM, Smith Liu 
<smith_liu...@163.com<mailto:smith_liu...@163.com>> wrote:


Thanks Jared, it works.

In addition, if by your way I created 2 vectors for 2 different chains, will 
you please show me how to determine the angle formed by the 2 vectors created?

Smith






At 2015-12-01 00:51:46, "Sampson, Jared M." 
<jms2...@cumc.columbia.edu<mailto:jms2...@cumc.columbia.edu>> wrote:
Hi Smith -

I’m not quite sure what you mean by "axis of a subunit."  If you mean the 
principal axis of that selection of atoms, `orient my_selection` will get it 
aligned along one of the axes.  Then you can create pseudoatoms on that axis 
and create a dash between them with the distance command.

# Get it lined up with the viewport axes.
select domain, chain A and resi 1-100
orient domain

# Here I’m assuming this put the long axis of the domain along the
# x axis.  We move the view along the x axis, and place pseudoatoms
# at the viewport center in two places.  You can change the length of the
# displayed axis based on how far you move.
move x, -10
pseudoatom ps1
move x, 20
pseudoatom ps2
move x, -10
distance axis, ps1, ps2

This is a bit clumsy and not a rigorous approach, but it will work for any 
other kind of vector you want to show, as long as you can get it aligned with 
one of the view axes.

Cheers,
Jared

—
Jared Sampson
Graduate Student
Department of Biochemistry and Molecular Biophysics
Columbia University

On Nov 29, 2015, at 7:42 AM, Smith Liu 
<smith_liu...@163.com<mailto:smith_liu...@163.com>> wrote:

Dear All,

Will you please show me how to display an axis of a subunit or a domain by 
pymol?

Smith



--
___
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.net<mailto: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





--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140___
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

Re: [PyMOL] on async

2015-11-22 Thread Sampson, Jared M.
Hi Smith -

I assume you’re referring to something like `fetch 1xyz, async=0`.  This means 
that the PyMOL interpreter should wait until the PDB file is downloaded and 
loaded before continuing with the next step.

Normally, the commands will be issued one immediately after the other and the 
next one may start before the current one finishes.  So multiple commands may 
be running at the same time, or asynchronously.

For example, if you were to run a script containing the following:

fetch 1xyz
as cartoon
color blue, chain A

Depending on the speed of the download, the protein would likely end up looking 
just like if you only called `fetch 1xyz`, as the other two commands will have 
started (and finished) before the `fetch` is complete.

Cheers,
Jared


On Nov 21, 2015, at 6:11 AM, Smith Liu 
> wrote:

Dear All,

Will you please tell me the meaning of "async"in pymol script?

Smith



--
___
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

--
___
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