[PyMOL] Automating pymol through PERL

2011-09-29 Thread Anasuya Dighe
Hello,
I have a .txt file which has data in the following fashion:

  19gs BSP A 1
  1a2d PYX A 117
  9rsa ADU A 125
  7kme PRR J 382
  1a0r ACE B 1
  1a0r FAR G 72
  .
  .
  .

Fields: PDB ID  LIGAND NAME  CHAIN TO WHICH IT IS ATTACHED  RESIDUE
SEQUENCE NUMBER

In such  a way, I have data of around 19,200 unique pdb files which have one or
more ligands attached to them. [PLEASE NOTE THAT there can be multiple ligands
to a particular .pdb file attached at different positions ]

For each .pdb file, I need to extract complete residues which fall within a
radius of 4.5 Angstroms of the ligand. I am calling such zones as ZONE1.I mean
residues that have any atom within 4.5 Angstroms of the ligand = zone1
Then after extracting ZONE1, I also want to extract complete residues which fall
within a radius of 4.5 Angstroms of ZONE1.. I am calling these zones as ZONE2. I
mean, residues that have any atom within 9.0 Angstroms of the ligand, but are
not already in ZONE1 = ZONE2

I am looking for a way to automate Pymol by writing a .pml script, such that
foreach pdb file, I have 2 additional files generated such that they are called
as: 19gs_BSP_z1.pdb [for ZONE1] and 19gs_BSP_z2.pdb [for ZONE2],
1a2d_PYX_z1.pdb, 1a2d_PYX_z2.pdb and so on...

Can this be done through PERL?
Please suggest me an efficient way of achieving the desired output..

Thanks,

-Anasuya



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
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] Automating pymol through PERL

2011-09-29 Thread Tsjerk Wassenaar
Hi Anasuya,

This sound like one of those very good reasons to have a go at Python,
and leave Perl behind... Together with all the plain reasons to leave
Perl behind :) First of all, check http://xkcd.com/353/

Assuming the file is called list.txt and you have all pdb files at
hand (which is not strictly necessary, as PyMOl can download them for
you), make a file called process.py with the following content



from pymol import cmd

def process_line(x):
  pdbid,res,chain,num = x.split()
  cmd.load(pdbid+.pdb)
  cmd.select(zone1,byres all within 4.5 of (chain %s and resn %s
and resi %s)%(chain,res,num))
  cmd.select(zone2,(byres all within 4.5 of zone1) and not zone1))
  cmd.save(%s-%s-%s-%s-zone1.pdb%(pdbid,res,chain,num),zone1)
  cmd.save(%s-%s-%s-%s-zone2.pdb%(pdbid,res,chain,num),zone2)
  cmd.delete(pdbid)

def process_all(filename):
  for line in open(filename):
process_line(line)

process_all(list.txt)


#==

After saving the file, do

pymol -c process.py

And that's it. Unless I made an error somewhere :P I haven't actually
tested this. But the proper solution should lie along these lines :)

Hope it helps,

Tsjerk
On Thu, Sep 29, 2011 at 8:58 AM, Anasuya Dighe
anas...@mbu.iisc.ernet.in wrote:
 Hello,
 I have a .txt file which has data in the following fashion:

          19gs BSP A 1
          1a2d PYX A 117
          9rsa ADU A 125
          7kme PRR J 382
          1a0r ACE B 1
          1a0r FAR G 72
          .
          .
          .

 Fields: PDB ID  LIGAND NAME  CHAIN TO WHICH IT IS ATTACHED  RESIDUE
 SEQUENCE NUMBER

 In such  a way, I have data of around 19,200 unique pdb files which have one 
 or
 more ligands attached to them. [PLEASE NOTE THAT there can be multiple ligands
 to a particular .pdb file attached at different positions ]

 For each .pdb file, I need to extract complete residues which fall within a
 radius of 4.5 Angstroms of the ligand. I am calling such zones as ZONE1.I mean
 residues that have any atom within 4.5 Angstroms of the ligand = zone1
 Then after extracting ZONE1, I also want to extract complete residues which 
 fall
 within a radius of 4.5 Angstroms of ZONE1.. I am calling these zones as 
 ZONE2. I
 mean, residues that have any atom within 9.0 Angstroms of the ligand, but are
 not already in ZONE1 = ZONE2

 I am looking for a way to automate Pymol by writing a .pml script, such that
 foreach pdb file, I have 2 additional files generated such that they are 
 called
 as: 19gs_BSP_z1.pdb [for ZONE1] and 19gs_BSP_z2.pdb [for ZONE2],
 1a2d_PYX_z1.pdb, 1a2d_PYX_z2.pdb and so on...

 Can this be done through PERL?
 Please suggest me an efficient way of achieving the desired output..

 Thanks,

 -Anasuya



 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.


 --
 All the data continuously generated in your IT infrastructure contains a
 definitive record of customers, application performance, security
 threats, fraudulent activity and more. Splunk takes this data and makes
 sense of it. Business sense. IT sense. Common sense.
 http://p.sf.net/sfu/splunk-d2dcopy1
 ___
 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




-- 
Tsjerk A. Wassenaar, Ph.D.

post-doctoral researcher
Molecular Dynamics Group
* Groningen Institute for Biomolecular Research and Biotechnology
* Zernike Institute for Advanced Materials
University of Groningen
The Netherlands

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
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] distance bug

2011-09-29 Thread Abhinav Verma
Hi,

 My pymol 1.4.1 works fine.
 can you try to ray trace and see if your objects are available but just not
displayed on the standard screen?

cheers,


2011/9/29 Andreas Förster docandr...@gmail.com

 Hi all,

 Has anyone noticed that the distance command behaves oddly.  Has this
 been recently introduced?

 fetch 1ubq
 zoom 1ubq
 dist 9/cg2, 73/cd2
 # output:  object dist01 is created
 # distance of 10.2 is shown, but no dashed line
 # now check this out:
 # several repetitions of the next two lines
 disable dist01
 enable dist01
 # eventually lead to the appearance of the dashed line
 # but it gets better
 disable dist01
 enable dist01
 # The distance is enabled but neither number nor dashed line are visible
 disable dist01
 enable dist01
 # Now the number and the dashed line are back

 When dist01 is enabled but invisible, disabling 1ubq brings it back, but
 it disappears again when 1ubq is re-enabled.

 With other pdb files, the distance command doesn't work at all.  It
 returns a distance of 0.0A to the screen that is only visible when the
 associated pdb object is disabled.

 I've observed this with
 pymol-py26 1.4-7 installed with fink on a MacBook running 10.6
 and with
 pymol 1.4.1 revision 3968 installed through svn on RHEL 6.1

 Notably, earlier revisions (e.g. 3958 and 3945) on RHEL 6.1 work just fine.

 Recently introduced bug?


 Andreas



 --
 Andreas Förster, Research Associate
 Paul Freemont  Xiaodong Zhang Labs
 Department of Biochemistry, Imperial College London
 http://www.msf.bio.ic.ac.uk


 --
 All the data continuously generated in your IT infrastructure contains a
 definitive record of customers, application performance, security
 threats, fraudulent activity and more. Splunk takes this data and makes
 sense of it. Business sense. IT sense. Common sense.
 http://p.sf.net/sfu/splunk-d2dcopy1
 ___
 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

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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] distance bug

2011-09-29 Thread Jason Vertrees
Hi Andreas,

It was a bug with the invalidation system. I just pushed a fix to source forge.

Thanks for bringing this to our attention.

Cheers,

-- Jason

2011/9/29 Andreas Förster docandr...@gmail.com:
 Hi all,

 Has anyone noticed that the distance command behaves oddly.  Has this
 been recently introduced?

 fetch 1ubq
 zoom 1ubq
 dist 9/cg2, 73/cd2
 # output:  object dist01 is created
 # distance of 10.2 is shown, but no dashed line
 # now check this out:
 # several repetitions of the next two lines
 disable dist01
 enable dist01
 # eventually lead to the appearance of the dashed line
 # but it gets better
 disable dist01
 enable dist01
 # The distance is enabled but neither number nor dashed line are visible
 disable dist01
 enable dist01
 # Now the number and the dashed line are back

 When dist01 is enabled but invisible, disabling 1ubq brings it back, but
 it disappears again when 1ubq is re-enabled.

 With other pdb files, the distance command doesn't work at all.  It
 returns a distance of 0.0A to the screen that is only visible when the
 associated pdb object is disabled.

 I've observed this with
 pymol-py26 1.4-7 installed with fink on a MacBook running 10.6
 and with
 pymol 1.4.1 revision 3968 installed through svn on RHEL 6.1

 Notably, earlier revisions (e.g. 3958 and 3945) on RHEL 6.1 work just fine.

 Recently introduced bug?


 Andreas



 --
         Andreas Förster, Research Associate
         Paul Freemont  Xiaodong Zhang Labs
 Department of Biochemistry, Imperial College London
             http://www.msf.bio.ic.ac.uk

 --
 All the data continuously generated in your IT infrastructure contains a
 definitive record of customers, application performance, security
 threats, fraudulent activity and more. Splunk takes this data and makes
 sense of it. Business sense. IT sense. Common sense.
 http://p.sf.net/sfu/splunk-d2dcopy1
 ___
 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




-- 
Jason Vertrees, PhD
PyMOL Product Manager
Schrodinger, LLC

(e) jason.vertr...@schrodinger.com
(o) +1 (603) 374-7120

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
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] distance bug

2011-09-29 Thread Andreas Förster
Ah, indeed, the latest revision 3969 has a correctly working distance 
command.

Thanks Jason.


Andreas


On 29/09/2011 3:08, Jason Vertrees wrote:
 Hi Andreas,

 It was a bug with the invalidation system. I just pushed a fix to source 
 forge.

 Thanks for bringing this to our attention.

 Cheers,

 -- Jason



-- 
 Andreas Förster, Research Associate
 Paul Freemont  Xiaodong Zhang Labs
Department of Biochemistry, Imperial College London
 http://www.msf.bio.ic.ac.uk

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
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