Re: [PyMOL] Selection of chains based on PDB header

2017-06-15 Thread John Berrisford

Dear Julian

You can also try the PDB plugin which places each chain into a selection 
automatically for you.


https://pymolwiki.org/index.php/PDB_plugin


Regards

John
PDBe


On 12/06/2017 17:10, Thomas Holder wrote:

Hi Julian,

A one-liner to create chain selections looks like this:

for c in cmd.get_chains(): cmd.select("chain_" + c, "chain " + c)

PyMOL doesn't provide access to the PDB header fields. In principle PyMOL 
provides a way to access everything inside mmCIF files, see:

https://pymolwiki.org/index.php/Cif_keepinmemory

However, instead of doing this, I recommend to use the PDBe web API which provides the 
data in a friendly JSON data structure. I've attached a Python script which creates 
molecule (or chain) selections for 5n61 as an example. I recommend to load PDB structures 
from mmCIF or MMTF format, which not only have chain identifiers, but also molecule 
identifiers ("segi" field in PyMOL).

Hope that helps.

Cheers,
   Thomas


On Jun 12, 2017, at 12:21 PM, Julian Reitz <julianr1...@gmail.com> wrote:

Dear all,

I have a pdb-file with multiple chains (5N61).

Is there an easy way to create selections for all the chains that are defined 
in the pdb-header (A to U) without doing it manually for every chain (select A, 
chain A)?
Is it also possible to use the MOLECULE information from the header to name the 
selections?

Thank you in advance,

Julian

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



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


--
John Berrisford
PDBe
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Hinxton
Cambridge CB10 1SD UK
Tel: +44 1223 492529

http://www.pdbe.org
http://www.facebook.com/proteindatabank
http://twitter.com/PDBeurope

--
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 crash when raytracing empty graphics

2015-08-17 Thread John Berrisford
Dear Spencer

It is possible to work this out using the PDBe API. 
for our interactive API see:
http://www.ebi.ac.uk/pdbe/api/doc/

The molecules url will give you this information:
http://www.ebi.ac.uk/pdbe/api/pdb/entry/molecules/1a1q

entity 1 has ca_p_only: true, 
which means cartoon will not work for this chain - so we use ribbon instead 
with the command
pymol.cmd.set(ribbon_trace_atoms, 1)


This test allows us to make images such as those shown on the entry page for 
1a1q at PDBe
http://www.ebi.ac.uk/pdbe/entry/pdb/1a1q

The images are made with pymol (currently 1.6, but also works in 1.7)

Regards

John
PDBe 


On Monday 17 August 2015 15:40:14 Spencer Bliven wrote:
 We have a pipeline that uses pymol to create images using the headless
 command line interface. I've discovered that PyMOL 1.7.4 and 1.7.6 (at
 least) crash if you try to ray-trace an empty viewport.
 
 Example:
 
 pymol -q -c -d 'fetch 1a1q,async=0;as cartoon;ray'
 
 This particular example only has CA atoms, so the cartoon mode doesn't show
 anything. In interactive mode I would `set cartoon_trace_atoms,1` but when
 batch processing there isn't a good way of detecting whether anything is
 showing or not.
 
 The error is:
 
 *** glibc detected ***
 /home/user/software/packages/pymol-v1.7.4.4/pymol.exe: double free or
 corruption (out): 0x7f11f8744f40 ***
 
 I've reproduced the error on Redhat 6 and Ubuntu 14.04, with PyMOL 1.7.4.1
 through 1.7.6.3.
 
 Attached is a stack trace.
 
 
 Any suggestions on ensuring that there are some polygons in frame would
 also be appreciated. Say, if there was a way to detect that cartoon would
 fail so that I can switch to a lines or nonbonded representation (I wish
 that was the default fallback for cartoon).
 
 Thanks,
 Spencer
 

-- 
John Berrisford
PDBe
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Hinxton
Cambridge CB10 1SD UK
Tel: +44 1223 492529
--
___
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] shadows on floors

2004-03-24 Thread John Berrisford
I am try to create a picture with shadows visible on the background of the
image. I have so far managed to create a floor, following the example of David
Cooper (movies section of pymol web site) and create shadows on a grey and blue
backgound. Is this the best way of creating a background, or is there a better
way?

But, I don't seem to be able to make a white background with shadows on (rgb
1,1,1 is white?). Is this possible?

Is it possible to create your own background colours (set_color doesn't seem to
work in the floor.py script in the example by David Cooper).

Also as a side note, what are the rgb codes that pymol uses, are they standard 0
to 1 (the same as molscript) or 0 to 255? Using some of the rgb codes from
molscript only seems to produce a grey background.

Thank you

John

-- 
John Berrisford
Department of Molecular Biology and Biotechnology
University of Sheffield

email: j.berrisf...@sheffield.ac.uk



[PyMOL] sphere sizes

2004-02-26 Thread John Berrisford
I am trying to create a picture containing a metal ion and water molecules.  The
problem that I am having is that I wish to display them both as spheres, but of
different sizes. Pymol (version 0.93 and 0.95 beta 11 ) seems to only use the
last sphere size command i.e. set sphere_scale, 0.1 in the script and
effectively ignore any previous sphere_scale command.

Am I doing something wrong and there is another, better way of doing this, for
example linking the size command to an object?

I have been so far unable to work out how to do this.

Thanks

John

-- 
John Berrisford
Department of Molecular Biology and Biotechnology
University of Sheffield

email: j.berrisf...@sheffield.ac.uk



RE: [PyMOL] drawing hydrogen bonds or dashes

2004-02-20 Thread John Berrisford
Thanks that works fine apart from one thing: 
I wish to display lines between 97AOE1 and MN in two overlapped structures, with
identical chain identification, in two different colours. Using the below
command draws two lines in the same colour. Is there a way a specifying a line
between the two below atoms only within a specific pdb file (defined as an
object).

eg line between A97OE1 and MN only within object e4_final.

I hope this is clear

thanks

John

Quoting Warren DeLano war...@delanoscientific.com:

 John,
 
 Welcome to PyMOL!
 
  I wish to do the equivalent to the following molscript 
  command line position res-atom A97 OE1 to position res-atom M200 MN;
 
dist my_line, a/97/OE1, M/200/MN
hide labels
 
 Also note that PyMOL can draw hydrogen-bonds automatically using its limited
 chemical intuition according to the global h_bond_... settings. (Sorry
 guys, that isn't documented -- I am thinking about creating a new command
 for it since dist isn't the right place for this).
 
dist hbnd, all, all, mode=2
hide labels
 
 (But I don't think that will help with MN.)
 
 If you don't want dashes, then
 
set dash_length, 3
set dash_gap, 0
 
 Seems to work for me...
 
 Cheers,
 Warren
 
 
  -Original Message-
  From: pymol-users-ad...@lists.sourceforge.net 
  [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of 
  John Berrisford
  Sent: Thursday, February 19, 2004 10:09 AM
  To: pymol-users@lists.sourceforge.net
  Subject: [PyMOL] drawing hydrogen bonds or dashes
  
  I have searched the manual and forum and cannot find how to 
  draw a hydrogen bond between two specific atoms. 
  
  I wish to do the equivalent to the following molscript 
  command line position res-atom A97 OE1 to position res-atom M200 MN;
  
  which draws a line between two atoms A97 OE1 and Mn200. So 
  not a hydrogen bond but a specific line.
  
  Is this possible in pymol?
  
  I have read posts on changing the thickness of a dash and the 
  number of dashes in a line. But none on how to draw the line.
  
  Can anyone help me, i'm a new user by the way!
  
  thanks
  
  John
  
  
  
  ---
  SF.Net is sponsored by: Speed Start Your Linux Apps Now.
  Build and deploy apps  Web services for Linux with a free 
  DVD software kit from IBM. Click Now!
  http://ads.osdn.com/?ad_id=1356alloc_id=3438op=click
  ___
  PyMOL-users mailing list
  PyMOL-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/pymol-users
  
 
 
 


-- 
John Berrisford
Department of Molecular Biology and Biotechnology
University of Sheffield

email: j.berrisf...@sheffield.ac.uk



[PyMOL] drawing hydrogen bonds or dashes

2004-02-19 Thread John Berrisford
I have searched the manual and forum and cannot find how to draw a hydrogen bond
between two specific atoms. 

I wish to do the equivalent to the following molscript command
line position res-atom A97 OE1 to position res-atom M200 MN;

which draws a line between two atoms A97 OE1 and Mn200. So not a hydrogen bond
but a specific line.

Is this possible in pymol?

I have read posts on changing the thickness of a dash and the number of dashes
in a line. But none on how to draw the line.

Can anyone help me, i'm a new user by the way!

thanks

John




[PyMOL] selecting multiple atoms ie oxygen

2004-02-18 Thread John Berrisford
I wish to select multiple oxygens (labelled O1, O2 etc.. within my pdb file) and
colour them red for example. Is there any easy way of doing this other than
typing out a list of all the oxygens I wish to select?

eg. color red, (5paa and (name o1+o1a+o2+o3+o4+o5+o1p+o2p+o3p))

I know in molscript its posible to use a o* label to select all oxygens, is such
a switch possible in pymol. It doesn't work, or I am using the wrong syntax if
its possible.

Any thoughts would be appreciated.

John