[PyMOL] Deleting and Loading multiple SDF files

2010-09-22 Thread Renuka Robert






p { margin-bottom: 0.08in; }

Dear Pymol users



I have to do TWO jobs simultaneously in
PYMOL.



JOB 1: Load multiple *sdf files



I have set of ligand files in *.sdf
format as follows:



/home/user/Model_1/cluster_1.sdf
/home/user/Model_1/cluster_2.sdf
/home/user/Model_1/cluster_3.sdf



/home/user/Model_2/cluster_1.sdf
/home/user/Model_2/cluster_2.sdf
/home/user/Model_2/cluster_3.sdf



/home/user/Model_3/cluster_1.sdf
/home/user/Model_3/cluster_2.sdf
/home/user/Model_3/cluster_3.sdf



I've got an answer from one of the
PYMOL user as:



PyMOLimport glob
PyMOLfor i in
glob.glob(cluster_*.sdf): cmd.load(i)



But this command works only in the
present working directory. For the next try I have to change my
directory every time. Like:



cd /home/user/Model_1/
PyMOLimport glob
PyMOLfor i in
glob.glob(cluster_*.sdf): cmd.load(i)



cd /home/user/Model_2/
PyMOLimport glob
PyMOLfor i in
glob.glob(cluster_*.sdf): cmd.load(i)



cd /home/user/Model_3/
PyMOLimport glob
PyMOLfor i in
glob.glob(cluster_*.sdf): cmd.load(i)



Could you please tell me how to load
these multiple *.sdf files in one command without changing the
directory?



JOB2: Delete multiple *.sdf files



I have to analyze cluster_*.sdf files
of several 100 directories.
 So when I load cluster_*.sdf files from
directory Model_2, the already loaded cluster:*.sdf files from
Model_1 should be deleted. 
Like wise when I load cluster_*.sdf files
from directory Model_3, the already loaded cluster:*.sdf files from
Model_2 should be deleted.

I am not good in programming. Could
anybody help me in scripting to sort out this problem?



Thanks in advance.
Regards
Renuka


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
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] Deleting and Loading multiple SDF files

2010-09-22 Thread Jason Vertrees
Hi Renuka,

Check out the loadDir PyMOL script (
http://www.pymolwiki.org/index.php/LoadDir).  You can do stuff like,

# load all PDBs in the directory ../
loadDir ../, *.pdb

# load all SDFs in ../../mySDFs
loadDir ../../mySDFs/state*.sdf

Cheers,

-- Jason

On Wed, Sep 22, 2010 at 9:12 AM, Renuka Robert renukarob...@ymail.comwrote:

  Dear Pymol users


  I have to do TWO jobs simultaneously in PYMOL.


  JOB 1: Load multiple *sdf files


  I have set of ligand files in *.sdf format as follows:


  /home/user/Model_1/cluster_1.sdf

 /home/user/Model_1/cluster_2.sdf

 /home/user/Model_1/cluster_3.sdf


  /home/user/Model_2/cluster_1.sdf

 /home/user/Model_2/cluster_2.sdf

 /home/user/Model_2/cluster_3.sdf


  /home/user/Model_3/cluster_1.sdf

 /home/user/Model_3/cluster_2.sdf

 /home/user/Model_3/cluster_3.sdf


  I've got an answer from one of the PYMOL user as:


  PyMOLimport glob

 PyMOLfor i in glob.glob(cluster_*.sdf): cmd.load(i)


  But this command works only in the present working directory. For the
 next try I have to change my directory every time. Like:


  cd /home/user/Model_1/

 PyMOLimport glob

 PyMOLfor i in glob.glob(cluster_*.sdf): cmd.load(i)


  cd /home/user/Model_2/

 PyMOLimport glob

 PyMOLfor i in glob.glob(cluster_*.sdf): cmd.load(i)


  cd /home/user/Model_3/

 PyMOLimport glob

 PyMOLfor i in glob.glob(cluster_*.sdf): cmd.load(i)


  Could you please tell me how to load these multiple *.sdf files in one
 command without changing the directory?


  JOB2: Delete multiple *.sdf files


  I have to analyze cluster_*.sdf files of several 100 directories.


 So when I load cluster_*.sdf files from directory Model_2, the already
 loaded cluster:*.sdf files from Model_1 should be deleted.

 Like wise when I load cluster_*.sdf files from directory Model_3, the
 already loaded cluster:*.sdf files from Model_2 should be deleted.


 I am not good in programming. Could anybody help me in scripting to sort
 out this problem?


  Thanks in advance.

 Regards

 Renuka



 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 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
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
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] Access viewport size

2010-09-22 Thread Mark A Saper
The output of the get_view command does not save the size of the viewport.  
Thus if you want to recreate an image for ray tracing so it will have the same 
size and scale, one also needs to save the viewport dimensions.  Is there some 
way to access this information?  The viewport command only sets the viewport.

Mark
_
Mark A. Saper, Ph.D.
Associate Professor of Biological Chemistry
University of Michigan

Biophysics, 3040 Chemistry Building
930 N University Ave
Ann Arbor MI  48109-1055 U.S.A.

sa...@umich.edu phone (734) 764-3353 fax (734) 764-3323
http://www.biochem.med.umich.edu/?q=saper   http://www.strucbio.umich.edu/



--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
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] Fwd: emovie scripting

2010-09-22 Thread Sergey Ivanov
Still no ideas? Guys, how then you do movie without gui mode???

-- Forwarded message --
From: Sergey Ivanov icegood1...@gmail.com
Date: 2010/9/21
Subject: emovie scripting
To: pymol-users@lists.sourceforge.net


Hello, help me please create script that loads frames (say, 30) from
pdb files and rotate each of them by 10 frames over , say, y axis. So,
all movie should have 300 frames.
It should be smth like this:
from glob import glob
from pymol import cmd
from pmg_tk.startup import eMovie
cmd.viewport(640,480)
cmd.set(connect_mode, 1)
cmd.set(connect_bonded, 1)
cmd.set(ray_trace_frames, 0)
file_list = glob(*.pdb)
for vfile in file_list:
 cmd.load(vfile,mov)
 eMovie.mv_turn(1-10:1-1,y,180,linear)
#eMovie.movie()
cmd.mpng(mov)
cmd.quit()

--
Kind regards,
Sergey Ivanov



-- 
Kind regards,
Sergey Ivanov

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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] zoom w/o ray-trace

2010-09-22 Thread Jason Vertrees
Sergey,

After looking over your data (in another email), PyMOL was not zooming
correctly because none of your atoms were connected.  (PyMOL got the
extents right, but was still confused.)  To get around this, you can
just create a simple connected object, like a methane (8 atoms) and
position each atom the bounds of your box.  PyMOL will know how to
zoom on that object.

Cheers,

-- Jason

On Tue, Sep 21, 2010 at 1:40 PM, Sergey Ivanov icegood1...@gmail.com wrote:
 Why in case when ray tracing is off image is cutted after load procedure?
 cmd.zoom(all, 0.0, 0, 1)
 doesn't help

 --
 Kind regards,
 Sergey Ivanov

 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 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

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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] Fwd: emovie scripting

2010-09-22 Thread Jason Vertrees
Hi Sergey,

I either use the GUI or when not in the UI I utilize the moviemaking commands:
  mdo
  mview
  mset

Also, import movie and check out what it has to offer:
  import movie
  print dir(movie)

Here are some moviemaking references:
  http://pymol.sourceforge.net/newman/user/S0300movies.html
  http://www.pymolwiki.org/index.php/Category:Movies
  http://www.pymolwiki.org/index.php/Mset

Cheers,

-- Jason


On Wed, Sep 22, 2010 at 2:47 PM, Sergey Ivanov icegood1...@gmail.com wrote:
 Still no ideas? Guys, how then you do movie without gui mode???

 -- Forwarded message --
 From: Sergey Ivanov icegood1...@gmail.com
 Date: 2010/9/21
 Subject: emovie scripting
 To: pymol-users@lists.sourceforge.net


 Hello, help me please create script that loads frames (say, 30) from
 pdb files and rotate each of them by 10 frames over , say, y axis. So,
 all movie should have 300 frames.
 It should be smth like this:
 from glob import glob
 from pymol import cmd
 from pmg_tk.startup import eMovie
 cmd.viewport(640,480)
 cmd.set(connect_mode, 1)
 cmd.set(connect_bonded, 1)
 cmd.set(ray_trace_frames, 0)
 file_list = glob(*.pdb)
 for vfile in file_list:
  cmd.load(vfile,mov)
  eMovie.mv_turn(1-10:1-1,y,180,linear)
 #eMovie.movie()
 cmd.mpng(mov)
 cmd.quit()

 --
 Kind regards,
 Sergey Ivanov



 --
 Kind regards,
 Sergey Ivanov

 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 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

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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] Super Bug Report

2010-09-22 Thread David Hall
In preparing my test for the odd request that I just sent, I came
across what seems to be a bug in super.  It has to do with this weird
nucleic acid thing I was talking about.

Here's the script this time:
from pymol import cmd

cmd.fetch('1acb', async=0)
cmd.fetch('1acb', '1acb_2', async=0)
cmd.fetch('426d', async=0)


print 1acb_2; print cmd.super('1acb', '1acb_2')[0]
print 426d; print cmd.super('1acb', '426d')[0]
print 1acb_2_again; print cmd.super('1acb', '1acb_2')[0]

~ ~/src/pymol_trunk_20100922/pymol -qrkc script2.py
PyMOLrun script2.py,main
1acb_2
0.0
426d
0.0
1acb_2_again
2.80655193329

super should give an rms between 1acb and 1acb_2 of 0.0, which it does
at first.  But once you super your protein to a nucleic acid that has
a calcium ion, when you run exactly the same command, you all of a
sudden get 2.8.  Very weird...

Note, this does not happen if you use 100d, which is a nucleic acid
without a calcium ion, does not happen if you use a pdb file with a
calcium ion, and does happen with 1d56, which is another nucleic acid
with a calcium ion I just pulled out.

In pymol 1.2, it also behaved incorrectly:
~ pymol -qrkc script2.py
PyMOLrun script2.py,main
1acb_2
0.0
426d
nan
1acb_2_again
nan


-David

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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] Request: Change in behavior of super on nucleic acids?

2010-09-22 Thread David Hall
I realize this is an edge case, where behavior is not always well
defined in programs, but I have a request for a behavior (and the
behavior actually seemed to change between 1.2 and 1.3)

My example script:
from pymol import cmd

cmd.fetch('1acb', async=0)
cmd.fetch('1acb', '1acb_2', async=0)
cmd.fetch('100d', async=0)
cmd.fetch('426d', async=0)

print 1acb_2; print cmd.super('1acb', '1acb_2')[0]
print 1zna; print cmd.super('1acb', '100d')[0]
print 426d; print cmd.super('1acb', '426d')[0]


To explain, 1acb is a protein, 100d is a nucleic acid, 426d is also a
nucleic acid, but with a calcium, whose CA atom seems to impact the
behavior of super.  I want to be able to tell that 1acb and 1acb_2 are
identical.

In 1.2, when I ran this:
 pymol -qrkc script.py
PyMOLrun script.py,main
1acb_2
0.0
1zna
 ExecutiveAlign: invalid selections for alignment.
2.79037312189e-38
426d
nan

I can see that 1acb_2 is different from the others.  I like the 426d
behavior or reporting nan, but I can deal with looking for the
ExecutiveAlign error I see with 100d.


In pymol trunk, when I ran this:
~ ~/src/pymol_trunk_20100922/pymol -qrkc script.py
PyMOLrun script.py,main
1acb
0.0
1zna
 ExecutiveAlign: invalid selections for alignment.
0.0
426d
0.0

I can still look for the ExecutiveAlign error for 100d, but I don't
have any indication of differences between 426d and 1acb.  In this
case, I can do rms_cur or something to differentiate them, but in my
real desired use case, this is not possible.

I would love it if in the case of errors in alignment or rms, when
there are no atoms used or matching, it would return nan as it used to
for 426d.  If you think I should just stop doing silly things like
trying to use pymol's super to tell if a pdb is a nucleic acid, that's
an understandable response though.

-David

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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] Access viewport size

2010-09-22 Thread Jason Vertrees
Hi Mark,

We used to be able to call this to get the viewport size.  But,
somewhere along the line Warren removed this.  I'll see if I can add
it back in, or find out why he removed it.

Cheers,

-- Jason

On Wed, Sep 22, 2010 at 2:06 PM, Mark A Saper sa...@umich.edu wrote:
 The output of the get_view command does not save the size of the viewport.
  Thus if you want to recreate an image for ray tracing so it will have the
 same size and scale, one also needs to save the viewport dimensions.  Is
 there some way to access this information?  The viewport command only sets
 the viewport.
 Mark
 _
 Mark A. Saper, Ph.D.
 Associate Professor of Biological Chemistry
 University of Michigan
 Biophysics, 3040 Chemistry Building
 930 N University Ave
 Ann Arbor MI  48109-1055 U.S.A.
 sa...@umich.edu     phone (734) 764-3353     fax (734) 764-3323
 http://www.biochem.med.umich.edu/?q=saper http://www.strucbio.umich.edu/



 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 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

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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