[PyMOL] r, theta, and phi of a helix

2022-10-27 Thread Chen, Qiang
Hi, Pymol Users,

How can I extract the orientation of the helix region of a protein?

For example, I have a pentameric membrane protein, I would like to know the 
orientation angle of one helix region relative to the pentameric symmetry axis 
(Z)?

I found there is a script to calculate the angle between two helical regions.

Thanks!

Charles
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Exporting data from PyMOL into OriginLab

2021-07-23 Thread Chen, Qiang
I often process the images from pymol or originLab in GIMP or photoshop.

You could set the pixel content of your pymol image, Png - 
PyMOLWiki. But I guess this is not the 
"crop" you expect.

Best,

Charles
Png - PyMOLWiki
Comments Transparent Backgrounds. Use the `ray_opaque_background` setting to 
output images with transparent backgrounds. set ray_opaque_background, 0 This 
can be useful for presentations, images that are placed on top of a background 
of nonuniform color (e.g. gradients), and images that overlap text or other 
images.
pymolwiki.org



From: pymol-users-requ...@lists.sourceforge.net 

Sent: Friday, July 23, 2021 12:57 PM
To: pymol-users@lists.sourceforge.net 
Subject: PyMOL-users Digest, Vol 182, Issue 12

Send PyMOL-users mailing list submissions to
pymol-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=04%7C01%7Cqic8%40pitt.edu%7Cc9a0e7b479624314837e08d94dfaf736%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637626562553080025%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=9IaE4slS4EFBG%2Fz9onK%2FY6rtKceWLASxgafoQNb2BiU%3Dreserved=0
or, via email, send a message with subject or body 'help' to
pymol-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
pymol-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PyMOL-users digest..."


Today's Topics:

   1. Re: Exporting data from PyMOL into OriginLab (Neena Susan Eappen)


--

Message: 1
Date: Fri, 23 Jul 2021 12:57:12 -0400
From: Neena Susan Eappen 
To: pymol-users 
Subject: Re: [PyMOL] Exporting data from PyMOL into OriginLab
Message-ID: 
Content-Type: text/plain; charset="us-ascii"

Hello PyMOL users,

Let me clarify my question. Shown below is one example figure. There is no way 
to crop any images on Origin graphing software. For this figure, I cropped 
PyMOL peptide image files on word document and then inserted in Origin graph. 
This is time consuming.
Is there a way to crop on PyMOL?


Any insight would be appreciated,

Thank you, Neena

> On Jul 22, 2021, at 5:43 PM, Neena Susan Eappen  
> wrote:
>
> Hello PyMOL users,
>
> I have some issues exporting images from PyMOL into a data analysis software 
> called OriginLab 
> (https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.originlab.com%2Fdata=04%7C01%7Cqic8%40pitt.edu%7Cc9a0e7b479624314837e08d94dfaf736%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637626562553080025%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=2NjvYl4IspmqHt5n46tFLMwKEaFTFsNxNIt7ElII81Q%3Dreserved=0).
>  If there is anyone in this mail list who integrates figures from PyMOL into 
> Origin, please email me. I need some insights for data representation.
>
> Many thanks,
> Neena
-- next part --
An HTML attachment was scrubbed...
-- next part --
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 111385 bytes
Desc: not available

--



--

Subject: Digest Footer

___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=04%7C01%7Cqic8%40pitt.edu%7Cc9a0e7b479624314837e08d94dfaf736%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637626562553080025%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=9IaE4slS4EFBG%2Fz9onK%2FY6rtKceWLASxgafoQNb2BiU%3Dreserved=0
Unsubscribe: 
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpymol%2Flists%2Fpymol-users%2Funsubscribedata=04%7C01%7Cqic8%40pitt.edu%7Cc9a0e7b479624314837e08d94dfaf736%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637626562553080025%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=t8Uumr9EXcb2wGkQ%2FdYfC9bxnhM6JyQY%2BYZKkXpAZAk%3Dreserved=0

--

End of PyMOL-users Digest, Vol 182, Issue 12

___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] CCP4 maps not aligning to my PDB file

2021-04-12 Thread Chen, Qiang
try this.
Matrix Copy - PyMOLWiki
Matrix Copy - PyMOLWiki
Matrix_copy copies the object matrix from one object to another.. This command 
is often used after a protein structure alignment to bring other related 
objects into the same frame of reference.
pymolwiki.org



From: pymol-users-requ...@lists.sourceforge.net 

Sent: Monday, April 12, 2021 3:28 AM
To: pymol-users@lists.sourceforge.net 
Subject: PyMOL-users Digest, Vol 179, Issue 8

Send PyMOL-users mailing list submissions to
pymol-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=04%7C01%7Cqic8%40pitt.edu%7Cf9a347cfbbee4a43277708d8fd849f93%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637538093362773384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=JbDP%2FrxRuvN3r5V6OgoeUtm1zAK1lyA9Y4nrNtcWF%2FI%3Dreserved=0
or, via email, send a message with subject or body 'help' to
pymol-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
pymol-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PyMOL-users digest..."


Today's Topics:

   1. Re: CCP4 maps not aligning to my PDB file (Tamas Hegedus)
   2. Re: CCP4 maps not aligning to my PDB file
  (shubhashish chakraborty)
   3. Re: CCP4 maps not aligning to my PDB file (Tamas Hegedus)


--

Message: 1
Date: Mon, 12 Apr 2021 09:11:37 +0200
From: Tamas Hegedus 
To: pymol-users@lists.sourceforge.net
Subject: Re: [PyMOL] CCP4 maps not aligning to my PDB file
Message-ID: <7c7d2677-0e52-164b-cea6-d5ed6690b...@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi,

PyMOL seems not to primarily target working with densities.

I suggest to use Chimera if you work with cryo EM maps.
E.g. you can use it to fit your struct into the density map.
If you decide to use Chimera, be careful, a first step of frustration
could be caused by the extension of the density file. Yes, the extension
- .mrc or .map; depending on the extension the map is aligned to the
origo or not (or something like that).

Bests,
Tamas

On 4/12/21 8:34 AM, shubhashish chakraborty wrote:
> Hello,
> I am not able to align my pdb file with its respective electron
> density map generated by CCP4i. Kindly?let me know what is going wrong.
> An image is attached for better reference.
>
> Thank you
> Shubhashish Chakraborty
> PhD Research Scholar (SRF)
> Varma Lab
> Structural and Molecular biology Lab
> Advanced Centre for Treatment, Research and Education in Cancer (ACTREC)
> Khargar, Navi Mumbai
>
>
>
>
> ___
> PyMOL-users mailing list
> Archives: 
> https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fpymol-users%40lists.sourceforge.netdata=04%7C01%7Cqic8%40pitt.edu%7Cf9a347cfbbee4a43277708d8fd849f93%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637538093362773384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=MQy0dow0CfxHb6tl%2FPlYFhOti26cfcsWPgnQXaicsF8%3Dreserved=0
> Unsubscribe: 
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpymol%2Flists%2Fpymol-users%2Funsubscribedata=04%7C01%7Cqic8%40pitt.edu%7Cf9a347cfbbee4a43277708d8fd849f93%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637538093362773384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SfrNBNSJIerZDe5A7KnTe9jrnA%2BzpyWrkvRfKMBZP%2Bk%3Dreserved=0

-- next part --
An HTML attachment was scrubbed...

--

Message: 2
Date: Mon, 12 Apr 2021 12:55:16 +0530
From: shubhashish chakraborty 
To: Tamas Hegedus 
Cc: pymol-users@lists.sourceforge.net
Subject: Re: [PyMOL] CCP4 maps not aligning to my PDB file
Message-ID:

Content-Type: text/plain; charset="utf-8"

Hi,
Thank you for a reply.
I am not working with cryo-EM but it's an X-ray diffraction map.
A similar kind of problem I am facing in chimera, so what could be done?

Thank you

Shubhashish Chakraborty
PhD Research Scholar (SRF)
Varma Lab
Structural and Molecular biology Lab
Advanced Centre for Treatment, Research and Education in Cancer (ACTREC)
Khargar, Navi Mumbai




On Mon, Apr 12, 2021 at 12:42 PM Tamas Hegedus  wrote:

> Hi,
>
> PyMOL seems not to primarily target working with densities.
>
> I suggest to use Chimera if you work with cryo EM maps.
> E.g. you can use it to fit your struct into the density map.
> If you decide to use Chimera, be careful, a first step of frustration
> could be 

[PyMOL] generate non crystallic subunit

2021-04-06 Thread Chen, Qiang
Hi, Pymol-users

I have a pentameric protein. However, the PDB only contain one subunit with 
Biomt info provided as the follows.

How can I generate the other four subunit and get the whole pentamer in pymol?

Thanks!

REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, O, B, C
REMARK 350   BIOMT1   1  1.00  0.00  0.000.0
REMARK 350   BIOMT2   1  0.00  1.00  0.000.0
REMARK 350   BIOMT3   1  0.00  0.00  1.000.0
REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, O, B, C
REMARK 350   BIOMT1   2  0.309017 -0.951057  0.00  239.91182
REMARK 350   BIOMT2   2  0.951057  0.309017  0.00  -37.99830
REMARK 350   BIOMT3   2  0.00  0.00  1.000.0
REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, O, B, C
REMARK 350   BIOMT1   3 -0.809017 -0.587785  0.00  350.18719
REMARK 350   BIOMT2   3  0.587785 -0.809017  0.00  178.42929
REMARK 350   BIOMT3   3  0.00  0.00  1.000.0
REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, O, B, C
REMARK 350   BIOMT1   4 -0.809017  0.587785  0.00  178.42929
REMARK 350   BIOMT2   4 -0.587785 -0.809017  0.00  350.18719
REMARK 350   BIOMT3   4  0.00  0.00  1.000.0
REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, O, B, C
REMARK 350   BIOMT1   5  0.309017  0.951057  0.00  -37.99830
REMARK 350   BIOMT2   5 -0.951057  0.309017  0.00  239.91182
REMARK 350   BIOMT3   5  0.00  0.00  1.000.0
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] list_hb.py

2021-03-22 Thread Chen, Qiang
Hi, Pymol Users,

I used this script to find hydrogen-bond in protein, list_hb.py.

list_hb all, all, write_distances_file=hb

I find there are some pairs are clearly not hydrogen bonds, e.g.
A/VAL`257/O/774A/MET`261/O/8342.87

Also, the angle is not right for certain pair

A/HIS`400/NE2/2977B/GLN`403/OE1/70932.66

In the protein, the angle between NE2-H-OE1 is 100.8 deg

Any suggestion to find out the correct hydrogen-bonding pairs?

Thanks!
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] counting salt bridge pairs

2021-02-12 Thread Chen, Qiang
Hi, Pymol Users,

Would anyone help me how to count the salt bridges in all models?

After my script, I have the salt bridge list for each model. I would like to 
know all the possible salt bridges in all models, and their frequency of each 
salt bridge in all the models.

for example,
/A/ASP/446/OD2 to /A/LYS/239/NZ: 3.776 exist in both models, while 
A/GLU/328/OE1 to/A/ARG/322/NE: 2.377 exist in only one model.
I have total 50 models. I cannot image a manual way to isolate each salt bridge 
and count their frequency in 50 models.

My wild guess is that text processing might solve this issue.

Any suggestions?

Thanks!

The output of model0 is as follows
model0/A/GLU/328/OE1 to model0/A/ARG/322/NE: 2.377
model0/A/GLU/430/OE2 to model0/A/ARG/368/NE: 3.883
model0/A/ASP/446/OD1 to model0/A/LYS/239/NZ: 2.818
model0/A/ASP/446/OD2 to model0/A/LYS/239/NZ: 3.877
model0/B/GLU/328/OE1 to model0/B/ARG/322/NE: 2.376
model0/B/GLU/430/OE2 to model0/B/ARG/368/NE: 3.884
model0/B/ASP/446/OD1 to model0/B/LYS/239/NZ: 2.818
model0/B/ASP/446/OD2 to model0/B/LYS/239/NZ: 3.877
model0/C/GLU/328/OE1 to model0/C/ARG/322/NE: 2.377
model0/C/GLU/430/OE2 to model0/C/ARG/368/NE: 3.883
model0/C/ASP/446/OD1 to model0/C/LYS/239/NZ: 2.818
model0/C/ASP/446/OD2 to model0/C/LYS/239/NZ: 3.876
model0/D/GLU/328/OE1 to model0/D/ARG/322/NE: 2.377
model0/D/GLU/430/OE2 to model0/D/ARG/368/NE: 3.883
model0/D/ASP/446/OD1 to model0/D/LYS/239/NZ: 2.819
model0/D/ASP/446/OD2 to model0/D/LYS/239/NZ: 3.876
model0/E/GLU/328/OE1 to model0/E/ARG/322/NE: 2.378
model0/E/GLU/430/OE2 to model0/E/ARG/368/NE: 3.883
model0/E/ASP/446/OD1 to model0/E/LYS/239/NZ: 2.819
model0/E/ASP/446/OD2 to model0/E/LYS/239/NZ: 3.877

The output of model1 is as follows
model1/A/ASP/429/OD1 to model1/B/ARG/424/NE: 2.634
model1/A/ASP/429/OD2 to model1/B/ARG/424/NE: 3.672
model1/A/GLU/437/OE2 to model1/A/ARG/310/NE: 3.310
model1/A/ASP/446/OD2 to model1/A/LYS/239/NZ: 3.776
model1/B/ASP/429/OD1 to model1/C/ARG/424/NE: 2.600
model1/B/ASP/429/OD2 to model1/C/ARG/424/NE: 3.629
model1/B/GLU/437/OE2 to model1/B/ARG/310/NE: 3.311
model1/B/ASP/446/OD2 to model1/B/LYS/239/NZ: 3.777
model1/C/ASP/429/OD1 to model1/D/ARG/424/NE: 2.597
model1/C/ASP/429/OD2 to model1/D/ARG/424/NE: 3.621
model1/C/GLU/437/OE2 to model1/C/ARG/310/NE: 3.311
model1/C/ASP/446/OD2 to model1/C/LYS/239/NZ: 3.776
model1/D/ASP/429/OD1 to model1/E/ARG/424/NE: 2.574
model1/D/ASP/429/OD2 to model1/E/ARG/424/NE: 3.604
model1/D/GLU/437/OE2 to model1/D/ARG/310/NE: 3.310
model1/D/ASP/446/OD2 to model1/D/LYS/239/NZ: 3.776
model1/E/ASP/429/OD1 to model1/A/ARG/424/NE: 2.589
model1/E/ASP/429/OD2 to model1/A/ARG/424/NE: 3.604
model1/E/GLU/437/OE2 to model1/E/ARG/310/NE: 3.311
model1/E/ASP/446/OD2 to model1/E/LYS/239/NZ: 3.776




Message: 3
Date: Fri, 12 Feb 2021 14:07:13 +
From: "Chen, Qiang" 
To: "pymol-users@lists.sourceforge.net"

Subject: Re: [PyMOL] PyMOL-users Digest, Vol 177, Issue 5
Message-ID:



Content-Type: text/plain; charset="us-ascii"

In case anyone has a similar problem, here is my solution

from pymol import cmd
from glob import glob
cmd.do("run list_hb.py")

for file in glob("model*.pdb"):
print(file)
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#hydrogen bonds
cmd.do("list_hb all, all, write_distances_file=hb_"+str(obj[0])+".txt")
#salt bridge
cmd.do("select negative, (resn ASP+GLU and name OD*+OE*)")
cmd.do("select positive, (resn Lys and name NZ) or (resn ARG and name NE + 
NH*)")
cmd.do("pairwise_dist negative, positive, 4, show=N, output="+str(obj[0]))

___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] PyMOL-users Digest, Vol 177, Issue 5

2021-02-12 Thread Chen, Qiang
In case anyone has a similar problem, here is my solution

from pymol import cmd
from glob import glob
cmd.do("run list_hb.py")

for file in glob("model*.pdb"):
print(file)
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#hydrogen bonds
cmd.do("list_hb all, all, write_distances_file=hb_"+str(obj[0])+".txt")
#salt bridge
cmd.do("select negative, (resn ASP+GLU and name OD*+OE*)")
cmd.do("select positive, (resn Lys and name NZ) or (resn ARG and name NE + 
NH*)")
cmd.do("pairwise_dist negative, positive, 4, show=N, output="+str(obj[0]))

From: pymol-users-requ...@lists.sourceforge.net 

Sent: Thursday, February 11, 2021 7:02 AM
To: pymol-users@lists.sourceforge.net 
Subject: PyMOL-users Digest, Vol 177, Issue 5

Send PyMOL-users mailing list submissions to
pymol-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=04%7C01%7Cqic8%40pitt.edu%7Ce1b907f15a9b4977cd4108d8ce84e463%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637486417450124995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=GIej770e5oQdn%2FMzFCZ%2BrBEO9PCc3oJ3JLZuKHC1WWg%3Dreserved=0
or, via email, send a message with subject or body 'help' to
pymol-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
pymol-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PyMOL-users digest..."


Today's Topics:

   1. Salt bridges in same chains (Chen, Qiang)


------

Message: 1
Date: Wed, 10 Feb 2021 15:09:28 +
From: "Chen, Qiang" 
To: "pymol-users@lists.sourceforge.net"

Subject: [PyMOL] Salt bridges in same chains
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi, All,

I am writing a script to find all salt bridges in a pentameric proteins in 50 
models.

The issues are

  1.  There are no salt bridges found in the same chain. But I find some if I 
use this command.
>pairwise_dist /model0//A/LYS+ARG/NZ+NE+NH*, 
>/model0//A/ASP+GLU/OD*+OE*, 4, show=N, output=P
My guess is that pairwise_dist does not take the same sel1, sel2 as a valid 
input. Any solutions/suggestions?
  2.  The script is apparently not optimized. Any suggestions?

Thanks!

Charles

Here are what I am using now.

from pymol import cmd
from glob import glob

for file in glob("model*.pdb"):
print(file)
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#salt bridge
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_A")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_B")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_C")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_D")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_E")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_B")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_C")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_D")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_E")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_C")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_D")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_E")
cmd.do("pairwise_dist ///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_

[PyMOL] Salt bridges in same chains

2021-02-10 Thread Chen, Qiang
Hi, All,

I am writing a script to find all salt bridges in a pentameric proteins in 50 
models.

The issues are

  1.  There are no salt bridges found in the same chain. But I find some if I 
use this command.
>pairwise_dist /model0//A/LYS+ARG/NZ+NE+NH*, 
>/model0//A/ASP+GLU/OD*+OE*, 4, show=N, output=P
My guess is that pairwise_dist does not take the same sel1, sel2 as a valid 
input. Any solutions/suggestions?
  2.  The script is apparently not optimized. Any suggestions?

Thanks!

Charles

Here are what I am using now.

from pymol import cmd
from glob import glob

for file in glob("model*.pdb"):
print(file)
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#salt bridge
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_A")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_B")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_C")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_D")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_E")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_B")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_C")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_D")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_E")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_C")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_D")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_E")
cmd.do("pairwise_dist ///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_D_D")
cmd.do("pairwise_dist ///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_D_E")
cmd.do("pairwise_dist ///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_E_E")
cmd.delete("all")
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] transform an channel pore profile

2020-07-24 Thread Chen, Qiang
I got the answer.

Actually, the solution is so simple, matrix_copy.

Charles

From: Chen, Qiang
Sent: Friday, July 24, 2020 12:46 PM
To: pymol-users@lists.sourceforge.net 
Subject: transform an channel pore profile

Hi, Pymol users,

Would anyone help me to transform the calculated pore profile along with the 
protein.

I have a couple of proteins and I calculated the pore profiles using MOLE. I 
downloaded the pymol scripts to regenerate the pores with the protein. when I 
aligned these proteins, the pore apparently won't be aligned.

One solution is aligning all the proteins and then calculating the pore 
profiles. The issue is anytime I have a new protein, I need align it first and 
then calculate the pore profile.

Would there be a better way in this scenario if I already have the pore 
profiles?

I guess object_matrix can do this.

Then the question is how can I get the transformation matrix from 
align/super/cealign, and then transform the pore profile.

All recommendations and suggestions are welcome! Appreciating your help!

Thanks,
Charles


___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] transform an channel pore profile

2020-07-24 Thread Chen, Qiang
Hi, Pymol users,

Would anyone help me to transform the calculated pore profile along with the 
protein.

I have a couple of proteins and I calculated the pore profiles using MOLE. I 
downloaded the pymol scripts to regenerate the pores with the protein. when I 
aligned these proteins, the pore apparently won't be aligned.

One solution is aligning all the proteins and then calculating the pore 
profiles. The issue is anytime I have a new protein, I need align it first and 
then calculate the pore profile.

Would there be a better way in this scenario if I already have the pore 
profiles?

I guess object_matrix can do this.

Then the question is how can I get the transformation matrix from 
align/super/cealign, and then transform the pore profile.

All recommendations and suggestions are welcome! Appreciating your help!

Thanks,
Charles


___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] choice of color in util.cbc

2020-07-14 Thread Chen, Qiang
Thanks!

This works well. "Spectrum chain" is more flexible and powerful in this case.

Charles




From: Thomas Holder 
Sent: Tuesday, July 14, 2020 2:24 PM
To: Chen, Qiang 
Cc: pymol-users@lists.sourceforge.net 
Subject: Re: [PyMOL] choice of color in util.cbc

Hi Charles,

The `first_color` argument is only active with `legacy=1`.

  util.cbc 6uwz, first_color=1, legacy=1

Other options for coloring by chain:

  spectrum chain, rainbow, 6uwz

  spectrum chain, blue green red yellow, 6uwz


Hope that helps.

Cheers,
  Thomas


> On Jul 14, 2020, at 7:18 PM, Chen, Qiang  wrote:
>
> Hi, Pymol Users
>
> Is it possible to choose different color pattern when using util.cbc?
>
> Wiki says I could use the following to choose the first_color
>
> util.cbc 6uwz, first_color=1, quiet=0
>
> 6uwz is just an example of a pentameric protein.
>
> However, there is no change when specify any other number for first_color. It 
> always starts with cyan on the first chain.
>
> I know I can color the chain individually. I am just puzzled that util.cbc 
> behaves this way.
>
> I am using open-source pymol2.5.0a0 running on windows 10.
>
> Thanks!
>
> Charles
> ___
> PyMOL-users mailing list
> Archives: 
> https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fpymol-users%40lists.sourceforge.netdata=02%7C01%7Cqic8%40pitt.edu%7C7fa17ea9f1c74b8091a208d828232bad%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637303478808757916sdata=4LxB2rIRWc%2F46YtcoayR7%2Bg48nlegyee7IVfjGGKdnc%3Dreserved=0
> Unsubscribe: 
> https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpymol%2Flists%2Fpymol-users%2Funsubscribedata=02%7C01%7Cqic8%40pitt.edu%7C7fa17ea9f1c74b8091a208d828232bad%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637303478808757916sdata=tcPJS4ItBU%2BMofo9oscHVA%2FhTOE4%2FN%2FpUD5ehSbzXIU%3Dreserved=0

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

___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] choice of color in util.cbc

2020-07-14 Thread Chen, Qiang
Hi, Pymol Users

Is it possible to choose different color pattern when using util.cbc?

Wiki says I could use the following to choose the first_color

util.cbc 6uwz, first_color=1, quiet=0

6uwz is just an example of a pentameric protein.

However, there is no change when specify any other number for first_color. It 
always starts with cyan on the first chain.

I know I can color the chain individually. I am just puzzled that util.cbc 
behaves this way.

I am using open-source pymol2.5.0a0 running on windows 10.

Thanks!

Charles
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] color by index

2020-06-18 Thread Chen, Qiang
Will spectrum just works for your purpose?

spectrum count, blue red, yourprotein, byres=1

you can switch off byres if you really want color by atom index.
 
Charles

> hello everyone!
>  I am trying to color an explicit distribution by color (say blue to red)
> pls help me with the command color by index

> On Jun 18, 2020, at 12:20 AM, pymol-users-requ...@lists.sourceforge.net wrote:
> 
> Send PyMOL-users mailing list submissions to
>   pymol-users@lists.sourceforge.net
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   
> https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=02%7C01%7Cqic8%40pitt.edu%7Ce118586bf6ff40e8fb8508d8133ee536%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637280508154218214sdata=wvtOxRB5m%2Bg7ASumbPcJ%2BB%2BtJzO92NpCWEvtHb7bxsI%3Dreserved=0
> or, via email, send a message with subject or body 'help' to
>   pymol-users-requ...@lists.sourceforge.net
> 
> You can reach the person managing the list at
>   pymol-users-ow...@lists.sourceforge.net
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyMOL-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Effect of different align method (Robert Campbell)
>   2. Color by index (Vertika Gautam)
>   3. help (Vertika Gautam)
>   4. help (Vertika Gautam)
> 
> 
> --
> 
> Message: 1
> Date: Wed, 17 Jun 2020 16:49:52 -0400
> From: Robert Campbell 
> To: pymol-users@lists.sourceforge.net
> Subject: Re: [PyMOL] Effect of different align method
> Message-ID: <20200617164952.05a17...@adelie.biochem.queensu.ca>
> Content-Type: text/plain; charset=UTF-8
> 
> Hello Sunyeping,
> 
> I would first point out that if you align on chain A of each molecule, then 
> chain B of ASFV aligns with chain C of MTUB and vice versa.  In other words 
> you don't have the same assignment of chain ids in your trimer.  The 
> alignment of just alpha carbons of chain A with "align" gives an RMSD of 1.78 
> ? for 81 atoms and for "super" gives an RMSD of 1.746 ? for 81 atoms. That 
> may be the best that you can do, but if you want to align the whole trimer 
> than you need to rename chain B to chain C and chain C to chain B for one of 
> your molecules.
> 
> You can do that renaming within PyMOL with these commands:
> 
> PyMOL>alter MTUB_trimer & c. B, chain="D"
> PyMOL>alter MTUB_trimer & c. C, chain="B"
> PyMOL>alter MTUB_trimer & c. D, chain="C"
> 
> (I'm just using "D" as an intermediate name here)
> 
> If you do that, then aligning all alpha carbons gives an RMSD of 2.189 ? for 
> "align" and 1.845 ? for "super".
> 
> Cheers,
> Rob
> 
> On Wed, 2020-06-17 21:04  +0800,  sunyeping via PyMOL-users 
>  wrote:
> 
>> Hello Julien Capp?le,
>>   Thank you for your response. I didn't mean to keep the input file
>> in secrete. I have changed the access right to them, so you can
>> download them freely. Best, Yeping Sun
>> --
>> From:Julien CAPPELE 
>> Sent At:2020 Jun. 17 (Wed.) 17:05
>> To:??? 
>> Subject:Re: [PyMOL] Effect of different align method
>> 
>> Hello Sunyeping,
>> 
>> I would suggest you to try TM-align, and a very good way to use it
>> for multi-protein alignment is to use their server mTM-align.
>> TM-align is a very robust alignment tool that will in most of the
>> case, give you a better structural based alignment with low to zero
>> input from the sequence.
>> https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fyanglab.nankai.edu.cn%2FmTM-align%2Fdata=02%7C01%7Cqic8%40pitt.edu%7Ce118586bf6ff40e8fb8508d8133ee536%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637280508154218214sdata=isejknGXC9BfuPHsGXhYBsux0pWwNIBGuiZntSyR2BY%3Dreserved=0
>>  
>> 
>> Also, if you are not working on secret stuff, you can give me access
>> so I can rework the output files from mTM-align server to give you a
>> RMSD-colored alignment in PyMOL.
>> 
>> On PyMOL only, I didn't try to implement TM-align because I use
>> Windows, but the developers said that a linux implementation could be
>> possible if you are a bit familiar with compiling softwares.
>> 
>> -
>> Julien Capp?le
>> Doctorant - 2?me ann?e - ED C2MP
>> Universit? de Lorraine
>> CRM? - UMR CNRS 7036
>> julien.capp...@univ-lorraine.fr
>> Tel: (+33)6 99 18 59 03
>> -
>> 
>> Le mer. 17 juin 2020 ? 05:06, sunyeping via PyMOL-users
>>  a ?crit : Dear pymol users,
>> 
>> I am trying to align two very similar trimeric molecules. I tried
>> different alignment commands including "align", "cealign" and
>> "super", but none of them gives satisfying effect. Athough the
>> backbone conformations and orientations of two two molecules look
>> very similar, there are obvious displacements between them after
>> alignment with these three commands. The rmsd 

[PyMOL] hydrogen bond list for a series of files

2020-06-16 Thread Chen, Qiang
This script will have a memory issue. My pymol will stuck if I have more than 3 
files be processed.
file_list = [f'{m:02d}'  for m in  list(range(1,30,1))]
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]

I modified from the sample script here

https://www.pymolwiki.org/index.php/Process_All_Files_In_Directory

Save the following lines in a file named as, eg. multiple_hb.py and make sure 
list_hb.py in the working directory of searching directory.

Then run multiple_hb.py in the pymol command line.

from pymol import cmd
from glob import glob

for file in glob("model.000.*.pdb"):
print(file)
#file_list = [f'{m:02d}'  for m in  list(range(0,30,1))]
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
cmd.do("run list_hb.py")
cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(obj[0])+".txt")
cmd.delete("all”)


On Jun 16, 2020, at 11:15 AM, 
pymol-users-requ...@lists.sourceforge.net<mailto:pymol-users-requ...@lists.sourceforge.net>
 wrote:

Send PyMOL-users mailing list submissions to
pymol-users@lists.sourceforge.net<mailto:pymol-users@lists.sourceforge.net>

To subscribe or unsubscribe via the World Wide Web, visit
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371378327sdata=v28nxT%2ByGrbeZCuvUvBY327R7wDd2z%2FSDo13H8%2BoPwc%3Dreserved=0
or, via email, send a message with subject or body 'help' to
pymol-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
pymol-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PyMOL-users digest..."


Today's Topics:

  1. Re: hydrogen bond list for a series of files
 (Mooers, Blaine H.M.  (HSC))
  2. Re: hydrogen bond list for a series of files (Chen, Qiang)


------

Message: 1
Date: Tue, 16 Jun 2020 14:51:38 +
From: "Mooers, Blaine H.M.  (HSC)" 
To: "Chen, Qiang" , "pymol-users@lists.sourceforge.net"

Subject: Re: [PyMOL] hydrogen bond list for a series of files
Message-ID:
<87dcc6c40b22804192b6892e6429ec5fdbefd...@countach.hsc.net.ou.edu>
Content-Type: text/plain; charset="Windows-1252"

Hi Charlie,

This will give the desired list.

file_list = [f'{m:02d}'  for m in  list(range(1,30,1))]
print(file_list)

Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419


From: Chen, Qiang [q...@pitt.edu]
Sent: Tuesday, June 16, 2020 9:26 AM
To: Mooers, Blaine H.M.  (HSC); pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files

Hi, Blaine,

Then the question becomes how to generate a list with 30 or 300 numbers.

Will this work?
file_list=list(range(00, 30))

Thanks!

Charles



From: Mooers, Blaine H.M. (HSC) 
Sent: Tuesday, June 16, 2020 9:57 AM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charles,

You are right and I am wrong about the files needing to be loaded.

The object name has the pesky pdb file extension stripped off, so lets use the 
object name instead of using Python to strip it off for us.
We no longer need to use glob.
We do need to the create a list of strings that encode the indexing of the 
files.
This code worked for me with two files.
Adapt to your 30 or 300 files.

file_list = ['01','02']
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]


Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of 

Re: [PyMOL] hydrogen bond list for a series of files

2020-06-16 Thread Chen, Qiang
Great, thanks!

Really appreciate your help!

Charles

From: Mooers, Blaine H.M. (HSC) 
Sent: Tuesday, June 16, 2020 10:51 AM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charlie,

This will give the desired list.

file_list = [f'{m:02d}'  for m in  list(range(1,30,1))]
print(file_list)

Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419


From: Chen, Qiang [q...@pitt.edu]
Sent: Tuesday, June 16, 2020 9:26 AM
To: Mooers, Blaine H.M.  (HSC); pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files

Hi, Blaine,

Then the question becomes how to generate a list with 30 or 300 numbers.

Will this work?
file_list=list(range(00, 30))

Thanks!

Charles



From: Mooers, Blaine H.M. (HSC) 
Sent: Tuesday, June 16, 2020 9:57 AM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charles,

You are right and I am wrong about the files needing to be loaded.

The object name has the pesky pdb file extension stripped off, so lets use the 
object name instead of using Python to strip it off for us.
We no longer need to use glob.
We do need to the create a list of strings that encode the indexing of the 
files.
This code worked for me with two files.
Adapt to your 30 or 300 files.

file_list = ['01','02']
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]


Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419

________
From: Chen, Qiang [q...@pitt.edu]
Sent: Monday, June 15, 2020 10:18 PM
To: Mooers, Blaine H.M.  (HSC); pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files

Thanks, Dr. Mooers.

I modified a little.

It seems the pdb files need be loaded.

I put all the following lines in a file multifile_hb.pml

run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
import glob
load model.000.*_minimized.pdb
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in 
glob.glob("model.000.??_minimized.pdb")]

A little not so perfect is that the output file,

hb_model.000.??_minimized.pdb.txt

Is is possible to do something like this
write_distances_file=hb_"+basename(file)+".txt"

Then the output will be
hb_model.000.??_minimized.txt

I tried, and this simple thing does not work.

Any suggestion?

Thanks!

Charles
____
From: Mooers, Blaine H.M. (HSC) 
Sent: Monday, June 15, 2020 9:44 PM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charles,

Make sure that PyMOL's present working directory is where the pdb files are 
stored.
Copy and paste each of the four lines below one at a time on the command line 
in PyMOL.


run 
list_hb.py<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__list-5Fhb.py%26d%3DDwQF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3DKYQX_tOI8_HnmseLbJRMv7UTirG78evoaztp35Gg74E%26e%3Ddata=02%7C01%7Cqic8%40pitt.edu%7C912defbc336647dae60f08d81204d365%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279159230377514sdata=TmlSgLQRAHpH6y8B3uBrgkFCoe5%2B%2BDxlB5ELDeXPBWc%3Dreserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttp-2D3A-5F-5Flist-2D5Fhb.py-2526d-253DDwQF-2Dg-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18-25

Re: [PyMOL] hydrogen bond list for a series of files

2020-06-16 Thread Chen, Qiang
Hi, Blaine,

Then the question becomes how to generate a list with 30 or 300 numbers.

Will this work?
file_list=list(range(00, 30))

Thanks!

Charles



From: Mooers, Blaine H.M. (HSC) 
Sent: Tuesday, June 16, 2020 9:57 AM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charles,

You are right and I am wrong about the files needing to be loaded.

The object name has the pesky pdb file extension stripped off, so lets use the 
object name instead of using Python to strip it off for us.
We no longer need to use glob.
We do need to the create a list of strings that encode the indexing of the 
files.
This code worked for me with two files.
Adapt to your 30 or 300 files.

file_list = ['01','02']
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]


Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419

________
From: Chen, Qiang [q...@pitt.edu]
Sent: Monday, June 15, 2020 10:18 PM
To: Mooers, Blaine H.M.  (HSC); pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files

Thanks, Dr. Mooers.

I modified a little.

It seems the pdb files need be loaded.

I put all the following lines in a file multifile_hb.pml

run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
import glob
load model.000.*_minimized.pdb
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in 
glob.glob("model.000.??_minimized.pdb")]

A little not so perfect is that the output file,

hb_model.000.??_minimized.pdb.txt

Is is possible to do something like this
write_distances_file=hb_"+basename(file)+".txt"

Then the output will be
hb_model.000.??_minimized.txt

I tried, and this simple thing does not work.

Any suggestion?

Thanks!

Charles
____
From: Mooers, Blaine H.M. (HSC) 
Sent: Monday, June 15, 2020 9:44 PM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charles,

Make sure that PyMOL's present working directory is where the pdb files are 
stored.
Copy and paste each of the four lines below one at a time on the command line 
in PyMOL.


run 
list_hb.py<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__list-5Fhb.py%26d%3DDwQF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3DKYQX_tOI8_HnmseLbJRMv7UTirG78evoaztp35Gg74E%26e%3Ddata=02%7C01%7Cqic8%40pitt.edu%7C2ea32a0b061443a37f1908d811fd40fd%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279126707606574sdata=8VnRodmeEUrqQfFm7fe0gqd02cYPsKv8VxPcb09RIkQ%3Dreserved=0>
import glob
chains = [('A','B'), ('A','C'), ('A','D'), ('A','E'), ('B','C'), ('B','D'), 
('B','E'), ('C','D'), ('C','E'), ('D','E') ]
[[cmd.do("list_hb chain "+ str(i) +", chain " +str(j) + ", 
write_distances_file=hb_"+ str(file) + "_" + str(i) + "_" +str( j) + 
"_001.txt") for i, j in chains] for file in glob.glob("model.??.pdb")]

Note that you do not have to load the pdb files into PyMOL.
If you want to analyze more than 99 files and less than 999 files, add a third 
question mark to the argument of glob.glob().

Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419


From: Chen, Qiang [q...@pitt.edu]
Sent: Monday, June 15, 2020 2:53 PM
To: pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] [PyMOL] hydrogen bond list for a series of files

Hi, Pymol users

Could you help me do this in an efficient way?

Let me describe the task I try to do.

I have a series of numerically ordered files, say model00.pdb model.01.pdb …… 
model.30.pdb

All the pdb have the same protein composition, chain A, B, C, D, and E. Their 
re

Re: [PyMOL] hydrogen bond list for a series of files

2020-06-15 Thread Chen, Qiang
Thanks, Dr. Mooers.

I modified a little.

It seems the pdb files need be loaded.

I put all the following lines in a file multifile_hb.pml

run 
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
import glob
load model.000.*_minimized.pdb
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
[cmd.do("list_hb chain F, chain A:E, 
write_distances_file=hb_"+str(file)+".txt") for file in 
glob.glob("model.000.??_minimized.pdb")]

A little not so perfect is that the output file,

hb_model.000.??_minimized.pdb.txt

Is is possible to do something like this
write_distances_file=hb_"+basename(file)+".txt"

Then the output will be
hb_model.000.??_minimized.txt

I tried, and this simple thing does not work.

Any suggestion?

Thanks!

Charles

From: Mooers, Blaine H.M. (HSC) 
Sent: Monday, June 15, 2020 9:44 PM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: hydrogen bond list for a series of files

Hi Charles,

Make sure that PyMOL's present working directory is where the pdb files are 
stored.
Copy and paste each of the four lines below one at a time on the command line 
in PyMOL.


run list_hb.py
import glob
chains = [('A','B'), ('A','C'), ('A','D'), ('A','E'), ('B','C'), ('B','D'), 
('B','E'), ('C','D'), ('C','E'), ('D','E') ]
[[cmd.do("list_hb chain "+ str(i) +", chain " +str(j) + ", 
write_distances_file=hb_"+ str(file) + "_" + str(i) + "_" +str( j) + 
"_001.txt") for i, j in chains] for file in glob.glob("model.??.pdb")]

Note that you do not have to load the pdb files into PyMOL.
If you want to analyze more than 99 files and less than 999 files, add a third 
question mark to the argument of glob.glob().

Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419


From: Chen, Qiang [q...@pitt.edu]
Sent: Monday, June 15, 2020 2:53 PM
To: pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] [PyMOL] hydrogen bond list for a series of files

Hi, Pymol users

Could you help me do this in an efficient way?

Let me describe the task I try to do.

I have a series of numerically ordered files, say model00.pdb model.01.pdb …… 
model.30.pdb

All the pdb have the same protein composition, chain A, B, C, D, and E. Their 
relative position is different in each file.

I would like to check the hydrogen bonds between, say, chain A and B.

Thanks to Prof. Robert L. Campbell, I can list the hydrogen bonds in one pdb 
and print the list as the follows

list_hb chain A, chain B, write_distances_file=hb_A_B_01.txt

How can I process the 30 files in an efficient way? what if I have 300 pdb 
files?

Shell script, python, or anything else?


Thanks!
Charles Chen




___
PyMOL-users mailing list
Archives: 
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__www.mail-2Darchive.com_pymol-2Dusers-40lists.sourceforge.net%26d%3DDwIGaQ%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw%26s%3DaOpeSOw9Gqop8KF8Xf_lkPoBC_MSbb5i0cKlRaIAulI%26e%3Ddata=02%7C01%7Cqic8%40pitt.edu%7C01a30e93a2ca4a40b37308d81196d7ba%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637278686852886299sdata=H%2BbXZ7ylGnf8aHeqS8UfkWyeYYuKCLZv1GikWVh2gAM%3Dreserved=0
Unsubscribe: 
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__sourceforge.net_projects_pymol_lists_pymol-2Dusers_unsubscribe%26d%3DDwIGaQ%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw%26s%3DPY-g0XYMB9DqXC06Iixbjxfqf8jB9Pb_GFu8zClx3oY%26e%3Ddata=02%7C01%7Cqic8%40pitt.edu%7C01a30e93a2ca4a40b37308d81196d7ba%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637278686852886299sdata=o1asKPIbwdAFwN%2FCJSTCXDg%2BndmmLXC8VJW8z48Y%2BAA%3Dreserved=0
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] hydrogen bond list for a series of files

2020-06-15 Thread Chen, Qiang
Hi, Pymol users

Could you help me do this in an efficient way?

Let me describe the task I try to do.

I have a series of numerically ordered files, say model00.pdb model.01.pdb …… 
model.30.pdb

All the pdb have the same protein composition, chain A, B, C, D, and E. Their 
relative position is different in each file.

I would like to check the hydrogen bonds between, say, chain A and B.

Thanks to Prof. Robert L. Campbell, I can list the hydrogen bonds in one pdb 
and print the list as the follows

list_hb chain A, chain B, write_distances_file=hb_A_B_01.txt 

How can I process the 30 files in an efficient way? what if I have 300 pdb 
files?

Shell script, python, or anything else?


Thanks!
Charles Chen




___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] renumber (Oganesyan, Vaheh)

2020-06-15 Thread Chen, Qiang


Coot is also an option.

CCP4 is much better/flexible though.
> On Jun 15, 2020, at 3:57 PM, pymol-users-requ...@lists.sourceforge.net wrote:
> 
> Send PyMOL-users mailing list submissions to
>   pymol-users@lists.sourceforge.net
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   
> https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-usersdata=02%7C01%7Cqic8%40pitt.edu%7C1cb5bc4305a54e41116508d811666261%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637278478724651262sdata=k9BDzkY3zEahzCUFU5HoykqtqexLpi6AMmoOODmi1mU%3Dreserved=0
> or, via email, send a message with subject or body 'help' to
>   pymol-users-requ...@lists.sourceforge.net
> 
> You can reach the person managing the list at
>   pymol-users-ow...@lists.sourceforge.net
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyMOL-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: renumber (Oganesyan, Vaheh)
> 
> 
> --
> 
> Message: 1
> Date: Mon, 15 Jun 2020 19:57:14 +
> From: "Oganesyan, Vaheh" 
> To: Jared Sampson 
> Cc: "pymol-users@lists.sourceforge.net"
>   
> Subject: Re: [PyMOL] renumber
> Message-ID:
>   
> 
>   
> Content-Type: text/plain; charset="utf-8"
> 
> Jared,
> 
> Are you saying it cannot be done within PyMOL? The ccp4 option is well known.
> 
> Thanks.
> 
> From: Jared Sampson 
> Sent: Monday, June 15, 2020 2:41 PM
> To: Oganesyan, Vaheh 
> Cc: pymol-users@lists.sourceforge.net
> Subject: Re: [PyMOL] renumber
> 
> Hi Vaheh -
> 
> Try `pdbset` from the CCP4 suite.
> 
> https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ccp4.ac.uk%2Fhtml%2Fpdbset.html%23renumberdata=02%7C01%7Cqic8%40pitt.edu%7C1cb5bc4305a54e41116508d811666261%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637278478724651262sdata=xdDIHjozZKMKwAR4hQiO9ghd%2FMXaqmFpSfwkZRJ4r9w%3Dreserved=0
> 
> ```
> pdbset xyzin in.pdb xyzout out.pdb > pdbset.log << EOF
> renum 1 chain H
> renum 1 chain L
> end
> EOF
> ```
> 
> Hope that helps.
> 
> Cheers,
> Jared
> 
> 
> From: Oganesyan, Vaheh 
> 
> Reply: Oganesyan, Vaheh 
> 
> Date: June 15, 2020 at 1:28:23 PM
> To: Mooers, Blaine H.M. (HSC) 
> , Jarrett Johnson 
> 
> Cc: 
> pymol-users@lists.sourceforge.net 
> 
> Subject:  Re: [PyMOL] renumber
> 
> 
> Blain,
> 
> The command will not change the numbering of amino acids starting from #1. 
> But if you got missing ones, like in my case, it will. Except for those 
> having also letter in the number field. I mean the numbering used for CDRs of 
> antibodies, not alternatives. Hence, my question, is there a command that 
> will ignore the letters in the number field and renumber the amino acids in 
> the order they appear in the file.
> 
> Thank you.
> 
> From: Mooers, Blaine H.M. (HSC) 
> mailto:blaine-moo...@ouhsc.edu>>
> Sent: Monday, June 15, 2020 12:06 PM
> To: Oganesyan, Vaheh 
> mailto:vaheh.oganes...@astrazeneca.com>>; 
> Jarrett Johnson 
> mailto:jarrett.john...@schrodinger.com>>
> Cc: 
> pymol-users@lists.sourceforge.net
> Subject: RE: [PyMOL] renumber
> 
> Hi Vaheh,
> 
> alter vh, resi=str(int(resi)+0)
> 
> will not change the residue numbers because 0 is being added.
> Replace 0 with your desired residue number offset.
> 
> Best regards,
> 
> Blaine
> 
> Blaine Mooers, Ph.D.
> Associate Professor
> Department of Biochemistry and Molecular Biology
> College of Medicine
> University of Oklahoma Health Sciences Center
> S.L. Young Biomedical Research Center (BRC) Rm. 466
> 975 NE 10th Street, BRC 466
> Oklahoma City, OK 73104-5419
> 
> 
> From: Oganesyan, Vaheh [vaheh.oganes...@astrazeneca.com]
> Sent: Monday, June 15, 2020 10:49 AM
> To: Jarrett Johnson
> Cc: 
> pymol-users@lists.sourceforge.net
> Subject: [EXTERNAL] Re: [PyMOL] renumber
> 
> Thank you Jarrett,
> 
> Then the command
> 
> alter vh, resi=str(int(resi)+0)
> 
> should work, right? But it doesn?t because there are residue numbers with 
> letters. Is there a command that will either remove the letters or won?t pay 
> attention to them and renumber sequentially.
> 
> Regards,
> 
> 
> From: Jarrett Johnson 
> mailto:jarrett.john...@schrodinger.com>>
> Sent: Monday, June 15, 2020 11:38 AM
> To: Oganesyan, Vaheh 
> 

Re: [PyMOL] Consistent coloring between sticks of sidechains and cartoon backbones in spectrum coloring

2020-05-21 Thread Chen, Qiang
I tried that.
that is actually how I found this is a way to color them according the CA color 
assigned in the spectrum.

Charles


From: Olson, Linda 
Sent: Thursday, May 21, 2020 12:24 PM
To: Chen, Qiang 
Subject: Re: Consistent coloring between sticks of sidechains and cartoon 
backbones in spectrum coloring

Have you tried going to the first option under the color by menu which colors c 
alpha by whatever they are asigned?

Linda Olson, PhD
Assistant Professor/
x-Ray Facility Manager
Dept. Biochemistry
Medical College of Wisconsin
8701 Watertown Plank Rd
Milwaukee, WI 53226

phone 414-955-8545
fax  414-456-6510

From: Chen, Qiang 
Sent: Thursday, May 21, 2020 10:20:11 AM
To: Mooers, Blaine H.M. (HSC) ; 
pymol-users@lists.sourceforge.net 
Subject: Re: [PyMOL] Consistent coloring between sticks of sidechains and 
cartoon backbones in spectrum coloring

ATTENTION: This email originated from a sender outside of MCW. Use caution when 
clicking on links or opening attachments.

Thanks, Prof. Mooers.

I tried your script. It did not report any error. but the selected residues are 
colored as the default, green for carbon.

Then I figured out I made things complicated.

I created a new object (cnsp) for the cartoon representation colored with 
spectrum.

Then I selected residues with chain A and resi 10+20+30, and showed them as 
sticks. I guess, the color info of CAs from the spectrum is missing at this 
step.

If I selected the residues with cnsp and chain A and resi 10+20+30, then showed 
them with sticks, the color of sidechain is matching with CA color in the 
spectrum.

All I need is just util.cnc.

The working script is like the following

select cnsp, chain A
spectrum count, magenta_cyan, cnsp, byres=1
select sre, cnsp and resi 10+20+30
show sticks, sre,
util.cnc sre

Charles

From: Mooers, Blaine H.M. (HSC) 
Sent: Thursday, May 21, 2020 9:19 AM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: Consistent coloring between sticks of sidechains and cartoon 
backbones in spectrum coloring

Hi Charles,

This pml script does want you want,

# Color the carvons atoms of the sidechain the same as the color of the CA atom
col=[]
# >>>> edit resi here
iterate resi 10+20+30 and name ca, 
col.append((chain,resi,name,cmd.get_color_tuple(color)))
# Define the colors ca10, ca20, and ca40
[cmd.set_color('ca'+co[1],list(co[3]) ) for co in col]
# >>>>>>Edit color names here
colorList =['ca10','ca20','ca30']
# Check this list
[print(cmd.get_color_tuple(co)) for co in colorList]
#make a list of residues
resList = [co[1] for co in col]
# Check the list
print(resList)
# Now zip the list of colors and the list of residues
pairs = list(zip(colorList,resList))
# Check the list of lists
print(pairs)
# Check the atom selection syntax
[print('resi ' + str(pairs[i][1]) + ' and (sidechain and name c*)') for i in 
range(0,len(pairs))]
# Apply the pairs after defining the indices
[cmd.color(pairs[i][0], 'resi ' + str(pairs[i][1]) + ' and (sidechain and name 
c*)') for i in range(0,len(pairs))]

The print statements are sanity checks.
You can delete them and the comments if you want a more concise script.

You can also copy and paste this compound command onto the command line to get 
the get effect.
You the up arrow key to get back the command and edit the list of residues and 
the colorList.

col=[];iterate resi 10+20+30 and name ca, 
col.append((chain,resi,name,cmd.get_color_tuple(color)));colorList 
=['ca10','ca20','ca30'];resList = [co[1] for co in col];pairs = 
list(zip(colorList,resList));[cmd.color(pairs[i][0], 'resi ' + str(pairs[i][1]) 
+ ' and (sidechain and name c*)') for i in range(0,len(pairs))]

When you enter help color, you will see that the first argument of color is the 
color, which is a string.
That string is a name or number. The number is an integer that is internally 
mapped to a color name.
You can see these by entering the following: print(cmd.get_color_indices()).

Your col object is a list of tuples.
This is not of the data type that the color command expects.
The third line of your code returns an error because col is a list of tuples 
and not a string.
That number is not the same as your color tuple.
You want to apply your color tuple.
I am not sure how to do apply the color tuple because PyMOL will take the RGB 
values as list of integers, not as a tuple.
The returned  tuple is for use in an external program.
The above script converts the tuple into a list of integers that PyMOL can work 
with.
Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419

____
From: Ch

Re: [PyMOL] Consistent coloring between sticks of sidechains and cartoon backbones in spectrum coloring

2020-05-21 Thread Chen, Qiang
Thanks, Prof. Mooers.

I tried your script. It did not report any error. but the selected residues are 
colored as the default, green for carbon.

Then I figured out I made things complicated.

I created a new object (cnsp) for the cartoon representation colored with 
spectrum.

Then I selected residues with chain A and resi 10+20+30, and showed them as 
sticks. I guess, the color info of CAs from the spectrum is missing at this 
step.

If I selected the residues with cnsp and chain A and resi 10+20+30, then showed 
them with sticks, the color of sidechain is matching with CA color in the 
spectrum.

All I need is just util.cnc.

The working script is like the following

select cnsp, chain A
spectrum count, magenta_cyan, cnsp, byres=1
select sre, cnsp and resi 10+20+30
show sticks, sre,
util.cnc sre

Charles

From: Mooers, Blaine H.M. (HSC) 
Sent: Thursday, May 21, 2020 9:19 AM
To: Chen, Qiang ; pymol-users@lists.sourceforge.net 

Subject: RE: Consistent coloring between sticks of sidechains and cartoon 
backbones in spectrum coloring

Hi Charles,

This pml script does want you want,

# Color the carvons atoms of the sidechain the same as the color of the CA atom
col=[]
# >>>> edit resi here
iterate resi 10+20+30 and name ca, 
col.append((chain,resi,name,cmd.get_color_tuple(color)))
# Define the colors ca10, ca20, and ca40
[cmd.set_color('ca'+co[1],list(co[3]) ) for co in col]
# >>>>>>Edit color names here
colorList =['ca10','ca20','ca30']
# Check this list
[print(cmd.get_color_tuple(co)) for co in colorList]
#make a list of residues
resList = [co[1] for co in col]
# Check the list
print(resList)
# Now zip the list of colors and the list of residues
pairs = list(zip(colorList,resList))
# Check the list of lists
print(pairs)
# Check the atom selection syntax
[print('resi ' + str(pairs[i][1]) + ' and (sidechain and name c*)') for i in 
range(0,len(pairs))]
# Apply the pairs after defining the indices
[cmd.color(pairs[i][0], 'resi ' + str(pairs[i][1]) + ' and (sidechain and name 
c*)') for i in range(0,len(pairs))]

The print statements are sanity checks.
You can delete them and the comments if you want a more concise script.

You can also copy and paste this compound command onto the command line to get 
the get effect.
You the up arrow key to get back the command and edit the list of residues and 
the colorList.

col=[];iterate resi 10+20+30 and name ca, 
col.append((chain,resi,name,cmd.get_color_tuple(color)));colorList 
=['ca10','ca20','ca30'];resList = [co[1] for co in col];pairs = 
list(zip(colorList,resList));[cmd.color(pairs[i][0], 'resi ' + str(pairs[i][1]) 
+ ' and (sidechain and name c*)') for i in range(0,len(pairs))]

When you enter help color, you will see that the first argument of color is the 
color, which is a string.
That string is a name or number. The number is an integer that is internally 
mapped to a color name.
You can see these by entering the following: print(cmd.get_color_indices()).

Your col object is a list of tuples.
This is not of the data type that the color command expects.
The third line of your code returns an error because col is a list of tuples 
and not a string.
That number is not the same as your color tuple.
You want to apply your color tuple.
I am not sure how to do apply the color tuple because PyMOL will take the RGB 
values as list of integers, not as a tuple.
The returned  tuple is for use in an external program.
The above script converts the tuple into a list of integers that PyMOL can work 
with.
Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419

____
From: Chen, Qiang [q...@pitt.edu]
Sent: Wednesday, May 20, 2020 7:50 PM
To: pymol-users@lists.sourceforge.net
Subject: [EXTERNAL] [PyMOL] Consistent coloring between sticks of sidechains 
and cartoon backbones in spectrum coloring

Hi, Pymol-users

I have my protein shown as cartoon and colored with spectrum. Now I would like 
to show several residues at different places with sticks representation. when I 
tried, I can not get the color consistent between the backbone CA and the 
carbons on the sidechain.

I searched the archives, and tried something like this.

col=[]
iterate resi 10+20+30 and name ca, 
col.append((chain,resi,name,cmd.get_color_tuple(color)))
cmd.color(col,"all")
util.cnc("all")

The first two lines will get me a color_tuple of the selected residues (CA)
The third line will color all atoms as the same color of CA.
The fourth line will color all none carbon atoms with the default colors.

However, this does not work as I thought.

Would anyone point out what mistakes I made here? Or any other solution to get 
the consistence between CA and the 

[PyMOL] Consistent coloring between sticks of sidechains and cartoon backbones in spectrum coloring

2020-05-20 Thread Chen, Qiang
Hi, Pymol-users

I have my protein shown as cartoon and colored with spectrum. Now I would like 
to show several residues at different places with sticks representation. when I 
tried, I can not get the color consistent between the backbone CA and the 
carbons on the sidechain.

I searched the archives, and tried something like this.

col=[]
iterate resi 10+20+30 and name ca, 
col.append((chain,resi,name,cmd.get_color_tuple(color)))
cmd.color(col,"all")
util.cnc("all")

The first two lines will get me a color_tuple of the selected residues (CA)
The third line will color all atoms as the same color of CA.
The fourth line will color all none carbon atoms with the default colors.

However, this does not work as I thought.

Would anyone point out what mistakes I made here? Or any other solution to get 
the consistence between CA and the sidechain?

Your help is high appreciated!

Thanks!

Charles
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe