Hi

You're passing more than one atom per selection to the cmd.distance()
function, in which case the function returns the average between the
measured distances (http://pymolwiki.org/index.php/Distance#PYMOL_API ).

On a side note, this could be done much simpler:
fetch 2nuz, async=0
h_add resn LEU and name CD1+CD2
set distance_exclusion, 4
distance aaaa, hydro, hydro, cutoff=5.0, mode=3
run
https://github.com/Pymol-Scripts/Pymol-script-repo/raw/master/get_raw_distances.py
get_raw_distances aaaa

Cheers,
Julian

On Wed, May 4, 2016 at 11:48 PM, riddhiman sarkar <
riddhiman.sar...@gmail.com> wrote:

> Hello ,
> I am a new Pymol user. I am trying to calculate all the H-H distances
> between the methyl protons (CH3) in different Leucine residues in a
> protein, which are within 5A. For some reason, if I rerun the program with
> a distance threshold of 2A, I get different values for the same atoms. Here
> is the script that I am using. It would be great if someone can let me know
> what I am doing wrong.
> *******************************************
>
> pymol.cmd.load('2nuz.pdb', '2nuz')
> pymol.cmd.disable("all")
> pymol.cmd.enable('2nuz')
>
>
> pymol.cmd.h_add("all")
> select1= '(neighbor 2nuz and resn LEU and (name CD1 or name CD2)) and (not
> elem c)'
> atoms = pymol.cmd.get_model(select1)
> select3= '(neighbor 2nuz and resn LEU'
> select4= ' and (name CD1 or name CD2)) and (not elem c) and name '
>
> for at in atoms.atom:
>     x1=str(at.resi)
>     v1= select3 + select4 + str(at.name)
>     for at2 in atoms.atom:
>         x2= str(at2.resi)
>         v2= select3 + select4 + str(at2.name)
>         if x1== x2:
>             break
>         elif x1 != x2:
>             print
> str(at.resn)+str(at.resi)+'-'+str(at2.resn)+str(at2.resi),str(at.name
> )+'-'+str(at2.name), pymol.cmd.distance('aaaa',v1,v2,2.0)
> pymol.cmd.quit()
> ******************************************
>
> Here I get LEU10-LEU8 H01-H07 2.71310377121 if I use 5A in the distance
> command whereas I get LEU10-LEU8 H01-H07 1.78031635284 if I use 2A.
>
>
> Thanks a lot,
> Regards,
> Riddhiman Sarkar
>
>
>
>
> ------------------------------------------------------------------------------
> 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

Reply via email to