Re: [PyMOL] question about ray after alter and rebuild

2005-10-23 Thread Kristian Rother

--- Chung-Ming Yu  wrote:

> Dear all:
> 
> I changed the topology of secondary structures with
> 'alter' commands and then
> I used 'rebuild' command to show the new topology of
> secondary structures in
> multiple structura alignment. I pointed out three
> structures for further
> processing within all 12 structures. However, when I
> try to ray the structural
> resolution (only 3 of all 12 structures) to
> 2000x2000 with 'ray 2000, 2000', I
> always received a low resolution (as screen
> resolution only) result. How could
> I do? Thanks a lot!
> 
> Fisher C.-M. Yu
> 
> yucm...@gate.sinica.edu.tw
> 
> 
> 
>
---
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training
> Course
> Free Certification Exam for All Training Attendees
> Through End of 2005
> Visit http://www.jboss.com/services/certification
> for more information
> ___
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/pymol-users
> 





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



RE: [PyMOL] PyMol training

2005-10-10 Thread Kristian Rother
Dear PyMOL users,

there will be a PyMOL training in the area of Berlin,
Germany, soon. It is scheduled for October 19th, 15.00
at the beamlines of the BESSY II synchrotron.

Please contact me for details.

Kristian Rother

Charite - Universitaetsmedizin Berlin
kristian.rot...@charite.de







__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



[PyMOL] rtools 0.7 release

2005-03-24 Thread Kristian Rother
Dear PyMOL users,

i am happy to announce that the rtools package is out in a new polished
version (finally). You can get it from

http://www.rubor.de/bioinf

rtools is a PyMOL plugin that has
- a click-box for frequently used commands
- commands for easily making
- plugins for some external programs such as DSSP, HBEXPLORE, PASS
- connections to the PDB and Columba databases (the latter is just being
published, therefore you might not have heard of it yet
http://www.columba-db.de).
- some other stuff

There are two major changes to version 0.6
- better installation
- better documentation

As always, i'm curious about your comments, and probably, bug reports.

Cheers,

Kristian Rother






Re: [PyMOL] Getting Closer to Wiki Time!

2005-02-16 Thread Kristian Rother
Hi,

here's my 2cents on Wiki topics:

* Displaying biochemical properties
* Coloring molecules
* Rendering molecules
- I miss a topic like 'basics of displaying molecules'.
- What about 'displaying basic chemical properties', like double bonds, 
h-bonds, bond angles and b-factors.
- Modeling and editing structures. How to do electrostatics and energy 
minimization.
- Launching PyMOL (has been asked often)
- Some kind of 'script collection' would be very useful.

Some examples on what could appear within these topics are found on
http://www.rubor.de/bioinf/pymol_tips.html

Yours,

   Kristian Rother
   Charite - Universitätsmedizin Berlin




[PyMOL] Re:Wiki Brain Storming

2005-02-08 Thread Kristian Rother
On Tuesday 08 February 2005 01:44, Warren DeLano wrote:
> Say, what do people think about the idea of creating a PyMOL Wiki to hold
> nuggets of information like this? Or is there a better alternative to
> Wiki now available?

As i have been maintaining sort of PyMOL FAQ for some time, i would definitely 
like a Wiki, too. Simply because it would take less time for me to update a 
Wiki rather than HTML pages. Thus, i strongly encourage setting up a Wiki, 
and i would like to transfer all the answers i have collected there.

If anyone is wondering what i'm talking about, look at 
http://www.rubor.de/bioinf/pymol_tips.html

I know Wiki's that suffer or starve from inactivity, but i never heard of one 
that got unusable because malevolent users permanently put *graffitti* on the 
pages. 
However, a good Wiki needs to be structured beforehand, rather than having 
everything grow by itself. Users will add things where aproppriate, anyway. 
Thus, in a heavily used Wiki its definitely easy to get lost.

my 2cents.

   Kristian Rother
   Charite - Medical University of Berlin





[PyMOL] Re: List participation commentary

2004-11-22 Thread Kristian Rother
On Monday 22 November 2004 18:49, Cameron Mura wrote:
> >Ultimately the mailing list serves as a form of living manual to the
> > program, so it would be nice to preserve as many of these insights as
> > possible!

Well, i have written up and sorted a number of answers to common problems on 
my homepage. However, it's far away from being a wiki. Neither it is complete 
in any way.

http://www.rubor.de/bioinf/pymol_tips.html

Yours,

   Kristian Rother
   Humboldt Universität Berlin



[PyMOL] Re: PDB-Codes

2004-10-14 Thread Kristian Rother
Dear Christian,

Summary:
From within the same PyMOL instance, the command
pdb 1n1m 
works, but the script
> from pymol import cmd
> time.sleep(1)
>
> list = ('1n1m')
>
> for strc in list:
>     pdb strc
does not.
(IMO, the import is not necessary here).

Analysis:
You use the code above as a PyMOL .pml script. Thus, PyMOL will interpret each 
command primarily as a PyMOL command. If no matching command is found, the 
Python things will be tried.

Translation:
PyMOL probably thinks that 'strc' is the PDB-code rather than the variable. It 
tries to download 'pdbstrc.ent' from the PDB server.

Question:
Does a script just containing
'pdb 1n1m' work? I guess yes.

Solution - Go Python:
script.py 
---
from pymol import cmd
time.sleep(1)

list = ('1n1m')
for strc in list:
     cmd.do('pdb %s'%(strc))

start it with:
run script.py

I hope that helps,

    Kristian 



Re: [PyMOL] rtools from .pml scripts

2004-10-08 Thread Kristian Rother
Dear Jacob and Andreas,

The PyMOL launching procedure occurs IMO in three
steps:
1) Start main PyMOL window and command processor
2) Start floating Tk window
3) Start plugins
(it should be similar when you use PyMOL in batch
mode).

Thus, it may occur that commands from your .pml
scripts  are executed while the rtools plugin has not
been initialized yet.
A simple solution would be to issue a delay of 2-5 sec
at the start of the script to make sure rtools is up
and running.
You could do this using:

time.sleep(5)

This is actually pure Python, but it works from the
PyMOL cmd line as well.

Yours,

Kristian Rother
Humboldt Universität Berlin



--- Jacob Corn  wrote:

> This is, unfortunately, not the case. For our
> installation, rtools 
> already starts automatically (it's in the
> pmg_tk/startup directory). 
> Adding "run /rtools.py" to the .pymolrc does
> not allow rtools to 
> be used from within the script.
> 
> Jacob
> 
> andr...@biochem.utah.edu wrote:
> > Jacob,
> > 
> > I believe rtool will always be usable if you put
> > run /rtools.py
> > into your .pymolrc file.
> > 
> > 
> > Andreas
> > 
> > 
> > 
> > 
> > 
> >>This is an odd concidence, since I was just about
> to post about
> >>something very similar.
> >>I would like to use rtools commands from a .pml
> that is read from the
> >>command line (eg - with the -qc flag, instead of
> using the graphical
> >>interface).
> >>When starting pymol normally, rtools loads and
> everything is hunky dory.
> >>However, even if I add a "run /rtools.py"
> command to the .pml
> >>script, none of the rtools commands are
> recognized. Manually running
> >>rtools.py from within the .pml produces no errors.
> >>Is there a way to use rtools from within a script
> that never sees the
> >>graphical front end?
> >>
> >>Jacob
> >>
> > 
> > 
> > 
> > 
> > 
> >
>
---
> > This SF.net email is sponsored by: IT Product
> Guide on ITManagersJournal
> > Use IT products in your business? Tell us what you
> think of them. Give us
> > Your Opinions, Get Free ThinkGeek Gift
> Certificates! Click to find out more
> >
>
http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > ___
> > PyMOL-users mailing list
> > PyMOL-users@lists.sourceforge.net
> >
>
https://lists.sourceforge.net/lists/listinfo/pymol-users
> > 
> 
> -- 
> Jacob Corn
> UC Berkeley - Berger Lab
> Lab: 510-643-8893
> Fax: 510-643-9290
> jc...@uclink.berkeley.edu
> 
> 
>
---
> This SF.net email is sponsored by: IT Product Guide
> on ITManagersJournal
> Use IT products in your business? Tell us what you
> think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates!
> Click to find out more
>
http://productguide.itmanagersjournal.com/guidepromo.tmpl
> ___
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/pymol-users
> 




__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 



[PyMOL] Script Box 0.7 release

2004-07-23 Thread Kristian Rother

Hello,

the old code of the scriptBox was converted into a modern PyMOL plugin, 
hopefully eliminating all installation problems and stripping down code 
size to 3 KB.


It is also available from
http://www.rubor.de/bioinf/pymol_extensions.html

Kristian Rother





[PyMOL] Plugin: Protscale color gradients

2004-07-23 Thread Kristian Rother

Dear PyMOL users,

One of our students and i have written a plugin that colors proteins by 
the amino acid scales on www.Expasy.ch.


It is available at http://www.rubor.de/bioinf

Also, i have updated the PyMOL tips pages to reflect some topics 
discussed here in recent months.


Yours,

  Kristian Rother




Re: [PyMOL] Rtools Question

2004-05-16 Thread Kristian Rother

Dear Tony,

You can get quite far with the mvCmd command. The parser will get 
confused if you issue complex commands that way, but there are workarounds.


Example:
You want to rotate one chain only over some movie frames.

Step 1) write a rotate.pml script, containing:
rotate x,5,chain A

Step 2) use it from mvCmd:
mvCmd 1-100,@rotate.pml
movie

For more complex things (like using the sin()-smoothed movement 
features), you will probably need to hack into rtools/rMovie.py


Yours,

   Kristian


Tony Giannetti wrote:

Hello all,
This may have already been answered but I don't see it in the archives.
I've got rTools working under MacPyMol and the effects are great.  I'm
working with a scene that has many objects loaded at once and I want to have
some of them move independently over each other.  So far I can only get
rTools to apply rotations/translations to the whole scene, but not to
individual objects.  I can probably work around this using the alpha channel
and then pasting the rendered images back onto the original scene in
photoshop, but I'm wondering if there's a command scheme that will allow
object one to rotate and translate according to rTools commands without
altering the other objects in the scene.  Thanks much,
Tony




---
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users









[PyMOL] local PDB updates

2003-10-22 Thread Kristian Rother

Hello,

There is a script which accesses a PDB server to get the weekly update 
lists of PDB structures. It downloads the new and modified structures 
and can be run as a cronjob under Linux.


The script is freely accessible from http://www.rubor.de/bioinf/

Cheers,

  Kristian Rother





Re: [PyMOL] individual surfaces?

2003-09-09 Thread Kristian Rother
Am Dienstag, 9. September 2003 09:14 schrieb Dirk Kostrewa:
> Dear PyMol users,
>
> I'm currently trying to display individual surfaces around different
> selections of a molecule to show how they contact each other.

The trick is to define the selections as individual objects:

create obj1, (resi 431)
create obj2, (resi 440)
show surface, obj1
show surface, obj2

results in two separate surface objects.

Regards,

Kristian Rother

> However,
> either I get only the last surface displayed or a joined surface using the
> command examples below:
>
> this one gives only the surface of residue 440
>
> show surface, (  resid 431 )
> flag ignore, (  not resid 431  )
> show surface, (  resid 440 )
> flag ignore, (  not resid 440  )
> rebuild
>
> whereas this one gives the joint surface of residues 431 and 440
>
> show surface, ( resid 431 or resid 440 )
> flag ignore, (  not ( resid 431 or resid 440 )  )
> rebuild
>
> How can I display the individual surfaces separately?
>
> Alternatively, is there a command to display atoms in a CPK representation?
>
> Best regards,
>
> Dirk.

---




[PyMOL] Starting PyMOL from Java

2003-09-08 Thread Kristian Rother
Hello PyMOL and Java users,

We have found a solution to the problem we reported last week.

Bug:
Pymol occasionally  blocked when started with java.Runtime.exec.


Description:
The error was in our java-application since it is quite difficult to use the 
Process class properly.
The error was hard to find because it only occured in some java-versions.   

When processes that write to stdout are launched with
Runtime.exec(...) it is important to read the output into a
BufferedInputStream.
Otherwise the process is stopped after some amount of produced output
because of pipe_wait. In this case listing processes with ps shows an S 
(stopped) instead of R (running).

In our application we used InputStream but should have 
BufferedInputStream.

Yours,

Christoph Gille & Kristian Rother







[PyMOL] Starting Pymol from Java

2003-09-01 Thread Kristian Rother
Hello PyMOL users,

We have problems with starting pymol from another application and are
unable to find the reason.

A short listing demonstrating the problem is here
http://www.rz.charite.de/bioinf/strap/PymolBug.java

The problem occurs only on some computers.
On the computers where it occurs it is  completely reproduce-able.

On most computers pymol is correctly started and the protein given as 
argv[0] is loaded.

However on one LINUX PC a problem occurs if and only if java version
1.4.2 is used.  The same java version worked, however, on another
LINUX PC with very similar configuration which has a faster CPU.  The
problem occurred also on an MaciBook, java1.4.1_01

The problem presents as follows:

Pymol is started and feels fine until after 10s the load-command is
send by the java program via standard input to pymol

Immediately after receiving the data pymol is frozen and revives after
terminating the process-object in java with destroy.


Has anyone seen something similar?

Greeting, 
   Kristian Rother




[PyMOL] rTools 0.6.0 released

2003-07-28 Thread Kristian Rother

Hello PyMOL users,

There are some recent improvements and bugfixes to the rTools suite 
available. The package rTools 0.6.0 can be regarded as beta, it is 
available from:


http://www.rubor.de/bioinf

New features include:
- more detailed instructions for Win and MacOSX users.
- states can be freely assigned to movie frames.
- separate mvTurn and (as suggested by Richard Ball)
- color fading in movies. (written by Tserk Wassenaar)

rTools for PyMOL is a collection of useful stuff not yet contained in 
PyMOL itself. It includes.


- some dialog boxes for rapidly running scripts etc.
- access to the PDB from PyMOL.
- integration of external applications (DSSP, PASS, HBExplore, calc-surface)
- commands for easier creation of animations


As rTools is not really mature, i still like to hear of bugs in it 
(kristian.rot...@charite.de).


Yours,

Kristian Rother

Protein Structure Theory Group
Institute of Biochemistry
Humboldt University Berlin




Re: [PyMOL] appending states to objects

2003-07-18 Thread Kristian Rother
Am Donnerstag, 17. Juli 2003 23:05 schrieb Vajdos, Felix:
> Is there a way to append states to objects within pymol?
>
> Here's the scenario:
> Now, each animation is 50 frames (states) long, and runs fine.  What I
> would like to do is at the end of each animation sequence to simply have
> the final state rock back and forth, as in with the "rock" button on the
> Tcl window. However, I do not want to have the whole thing rocking during
> the animation.

Dear Felix,

Though it may sound a little like advertisement, i recommend the rTools 
package for PyMOL. (http://www.rubor.de/bioinf).  
Here, you can issue some commands assigning states to frames, like

mvRot 1-500:1-50,z,90
mvRot 501-1000:50-1,z,-90
Which will let states 1 to 50 be shown across the first 500 frames (however, 
state 50 is shown only in the last frame). In the second 500 frames, the 
order is reversed, i.e. the sequence plays backwards.

You can also simply assign commands to frames, leaving the state untouched:
mvSinmove 1001-1100,x,10
mvSinset 1001,1100,transparency,0.0,1.0

To play the animation, just type:
movie

And yes, you can get the structure rocking with these commands.
I apologize it does not run perfectly yet, as a bugfix release of rTools is 
about to appear within a week.

I hope that was not too confusing,

Kristian





[PyMOL] Pymol Tips updated

2003-07-13 Thread Kristian Rother

Hello PyMOL users,

the collection of tips and examples from this mailing list has been 
updated. I also broke up the FAQ page because it has grown too large.

the location is unchanged on

http://www.rubor.de/bioinf/


Yours,

Kristian Rother




Re: [PyMOL] Movement in animations: version 2

2003-04-03 Thread Kristian Rother
Dear Kelley,

> created /tmp and /pdb directories 

It is meant to be in C:\tmp and C:\pdb, just in Unix-style notation. How would 
You say this in Mac?

> I should state that several aspects of the install
> instructions in regard to the directory structures in my system were
> unclear.

In fact, i don't know if anyone has ever used rTools on MacOS before. If there 
is one, could You please write me, how You got it running?

--- debugging ---

> In both versions of Pymol described above, when a simple move command is
> inserted into a script as follows:
>
> mset 1 x100
> mvMove 20-40,x,80
> movie
>
> I get the following error messages:
>
> PyMOL>mset 1 x100
> PyMOL>mvMove 20-40,x,80
> Traceback (most recent call last):
>   File "/Applications/PyMOL/Darwin/modules/pymol/parser.py", line 234, in
> parse
> exec(com2[nest],pymol_names,pymol_names)
>   File "", line 1
>  mvMove 20-40,x,80
>  ^
>  SyntaxError: invalid syntax

OK, the mvMove command is apparently not known to Your PyMOL. Did You try to 
install it in $PYMOL/modules/pmg_tk/startup/rubor (without the PMGApp.py 
modification)?
When PyMOL starts up, do You get any error messages in the text screen? (press 
ESC).

We are looking forward to help You,

Kristian Rother






Re: [PyMOL] command-line and python scripts

2003-03-26 Thread Kristian Rother
Dear Markus,

> 1) How can I supply arguments to a python script,
> when I invoke it from 
> the pymol command line?

Write the python script like

def bla(arg1,arg2):
any.python.commands(arg1,arg2)
return

from pymol import cmd
cmd.extend('blacommand',bla)

Now you can call your function 'bla' from the PyMOL 
command line:

PyMOL> blacommand pdb1cso,42

Which would be like in Python:

bla('pdb1cso','42')



> 2) Can I set user variables in the pymol command
> line and access them 
> in a python script?

same answer as for 1).

 
> 3) Can I rerun a python script and use generator
> functions that I 
> initialised in the run before?

Sorry, I did not understand this question completely
(might be same answer as above two).


> 4) Can I temporarily return control to pymol from
> within a running a 
> python script and continue running the script after
> I have finished 
> interacting with pymol?

You should probably check out the Script Box utility,
if You have not already (http://www.rubor.de/bioinf

 
> 5) Can I query the active state of a pymol object
> (and other properties 
> as well) from withing a python script?

Yes. Look at: 
http://www.rubor.de/bioinf/pymol_tips.html#getcoord


> 6) 
dunno
 
> 7) 
also.

Good luck,

Kristian Rother

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com



Re: [PyMOL] different transparencies

2003-03-17 Thread Kristian Rother

Michal Bozon wrote:
I would like to have some spheres transparent, but some spheres leave 
opaque. Or to have spheres with different transparencies. Is it possible?


Yes, it is.

just tried it:

PyMOL>set sphere_transparency,0.5
 Setting: sphere_transparency set to 0.5.
PyMOL>set sphere_transparency,0.2,c1
 Setting: sphere_transparency set to 0.2 in object 'c1'.
PyMOL>set sphere_transparency,0.8,c2
 Setting: sphere_transparency set to 0.8 in object 'c2'.
PyMOL>rebuild


Kristian Rother



__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com



[PyMOL] Using PyMOL from Java

2003-02-17 Thread Kristian Rother

Dear PyMOL users,

We have written a Java class allowing to bind Java applications to use PyMOL. 
It has been developed and tested on a SuSe Linux 8.0 machine, but migration 
to other OS'es should be no problem.

It is hereby published using the Python License. Thus, You may modify and 
distribute the source code, as long as the original notices are kept in.

We hope this program will serve You well,

Kristian Rother and Christoph Gille

Institute of Biochemistry
Humboldt University Berlin
import java.util.zip.*;
import java.io.*;
import java.util.*;

/**
		Name:Pymol.java
  Purpose: A class that allows to start PyMOL from Java programs and to 
   ship commands to PyMOL from an application.
  Author:  Kristian Rother and Christoph Gille
   (kristian.rot...@charite.de, christoph.gi...@charite.de)

  Created: 2003/02/17
  Copyright:   (c) 2003
  Licence: Python License

		This class was originally written to provide PyMOL support for Strap.
		Strap is an application for editing structural alignments of proteins.

*/

public class Pymol {

public static String examples[]=	new String[] {
"load pdb1cse.ent",
"color blue,pdb1cse",
"show sticks,pdb1cse",
"hide spheres",
"Color Molecule Atoms Specified Specification 0,255,255"
};
// Name of the PyMOL executable with command-line options
public static String customize[]= new String[] {
"pymol -p"
};

private static OutputStream stdin=null;
private static Runtime rt=Runtime.getRuntime();
private static Process process=null;

public Pymol() {}

// 
public static boolean  launch() {
String pymol=customize[0];
try {
process=rt.exec(pymol);
stdin=process.getOutputStream();
} catch(Exception e){
System.err.println("Pymol.java:  Error launching Pymol");
return false;
}
try{Thread.currentThread().sleep(5000);}catch (Exception e){};
return true;
}
//
/**
			When loadProtein is called the first time
			process will be null;
			When process already terminated 	process.exitValue() succeeds;
			In both cases launch Pymol again.
*/
public boolean loadProtein(File pdb) {
// process terminated
try {
process.exitValue();
process=null;
}
catch(Exception e){};

if (process==null) launch();
if (process==null) {
System.err.println("Could not launch PyMOL.\nIs  the path of the executable set right ?\nPlease type the complete path of the binary into the file "+customize[0]);
return false;
}
interpret("load "+pdb+",prot");
return true;
}
// -+---
public String interpret(String s) {
System.err.println(getClass().getName()+": "+s);

try {
stdin.write(s.getBytes());
stdin.write('\n');
stdin.flush();
}catch(Exception e){
System.err.println("Error in "+getClass().getName()+".interpret("+s+") \n  "+e);
}
return "";
}
// 
public void dispose() {interpret("delete all");}
public String[] getExamples() {return examples;}
// 

/** 
Example application of Pymol.java 
*/
public static void main(String argv[]) {
int n=argv.length;
if (n<1) {
System.err.println("Demo: loads  some proteins into pymol and renders the 2nd and 3rd residue with spheres");
System.err.println("Usage:  java Pymol protein.pdb [protein2.pdb ...] ");
return;
}
Pymol pym=null;
for(int i=0;i

Re: [PyMOL] neighbor selection

2003-02-07 Thread Kristian Rother
Dear Nukri,


> When I do
> select cont,(/molA//s/401 around 4)
> it sure selects all atoms from molA that are within 4 A from residue 401
> but it also selects
> ALL other atoms from the current session (but not displayed) that are
> within 4 A.
> What needs improvement - the program or my command?

The latter, of course :-)

select cont,(/molA//s/401 around 4.0 and molA)

or 

select cont,(/molA//s/401 around 4.0 and chain s)


Kristian Rother







Re: [PyMOL] running pymol in command mode

2003-02-06 Thread Kristian Rother
Dear Matt,

There is a straighter way to do it. Try just 

pymol.com pymol_script.pml

(This works at least on my Linux machine).
You can also try

cat pymol_script.pml | pymol.com -p

or even

tail -f pymol_script.pml | pymol.com -p

The latter allows one to append lines to the pymol script from an external 
program, which will be executed immediately.

Kristian


> I'm trying to use pymol to render a large number of complex images in
> order to make a molecular movie. 
..
>
> However, I'm having trouble getting the command mode to function.  It
> appears that one should launch pymol like so:
>
> pymol.com -c < pymol_script
>
> where "pymol_script" is a script file that you could otherwise invoke
> from the GUI's command line by "@pymol_script".  However, when I try
> this with a simple script like:





Re: [PyMOL] Associating data structure with CGO object

2003-01-31 Thread Kristian Rother
Dear Mike,

> Where would I store the reference to the object (containing my data) so
> that I can retrieve it on the second call?  Can I link it to the CGO object
> or something?

You can reference the object in Your Python script just like:

my_data = []

(but i'd prefer using a class for that). What is important is that a 
cmd.extend(x,y) call should be called somewhere in the script, otherwise 
Python thinks the data will be no longer used and calls the Garbage 
Collection.

Kristian


> - Original Message -
> From: "Kristian Rother" 
> To: "Mike Liang" 
> Cc: 
> Sent: Thursday, January 30, 2003 3:53 AM
> Subject: Re: [PyMOL] Associating data structure with CGO object
>
> > Dear Mike,
> >
> > You can at least do the following:
> >
> > *** first call of command ***
> > - parse the file
> > - store the data in an object (dictionary, list, etc.) - you can probably
> > store the Strings that make up the CGO object.
> > - refine the data using the cutoff
> > - create CGO object from refined data
> >
> > *** second call of command ***
> > - delete CGO object
> > - refine the data using the cutoff
> > - create CGO object from refined data
> >
> > Message: You can create objects in Python scripts that are persistent as
> long
> > as PyMOL is running.
> > This should work a lot faster than parsing the file several times.
> >
> > Kristian
> >




Re: [PyMOL] Associating data structure with CGO object

2003-01-30 Thread Kristian Rother
Dear Mike,

You can at least do the following:

*** first call of command ***
- parse the file
- store the data in an object (dictionary, list, etc.) - you can probably 
store the Strings that make up the CGO object.
- refine the data using the cutoff
- create CGO object from refined data

*** second call of command ***
- delete CGO object
- refine the data using the cutoff
- create CGO object from refined data

Message: You can create objects in Python scripts that are persistent as long 
as PyMOL is running.
This should work a lot faster than parsing the file several times.

Kristian


> What I want to do is parse a file that has a bunch of coordinates and draw
> the spheres in PyMOL.  But then I want to be able to adjust the cutoff for
> which points are to be drawn.
>
> What I was doing now was first to run the script to bind the function to a
> command.  Then the function will load the file and draw the spheres at a
> particular cutoff.  If I rerun the function, it will delete the old CGO
> object, parse the file again, and recreate a new CGO.  But if the file is
> really big, this becomes cumbersome.
>
> Or maybe what I need to do is create a "pymol object" and then have it
> create the CGO object everytime it needs to be drawn.  Then have my
> function be able to update the cutoff parameter for the object.
>
> Thanks!
> Mike
>




Re: [PyMOL] ScriptBox

2003-01-08 Thread Kristian Rother
> If anyone has any suggestions they'd be most appreciated. I like ScriptBox
> a lot so do you think there's any chance of incorporating this into PyMol
> either as a GUI window or as its own dropdown scripts menu that could also
> list all the scripts in a given directory??

Hello,

There is a very recent (6.1.) package of rTools available from 
http://www.rubor.de/bioinf , where ScriptBox and some other tools are 
contained. Most things are accessible from menus, You can also add Your own 
scripts to the box using the add_script command.
rTools 0.5.2 is still a Beta release, although many bugs have been fixed 
already. Particularly, installation under Windows is still a little 
eXPerience.

Kristian Rother





Re: [PyMOL] recent problems

2003-01-02 Thread Kristian Rother

David wrote:


How do I access the objects I load from files (e.g. pdb file) directly
(i.e. in a script)? If I want to print the coordinates of an atom, or
the value of at a point in the electron density grid?


http://www.rubor.de/bioinf/pymol_tips.html#getcoord



Eric Hu wrote:

>Hi, I wonder if anyone has had the similar problem. I
>can see both the label and dash at normal window.
>After raytracing there is only a yellow dotted line
>between two atoms without the distance. How can I make
>the distance shown on the raytracing picture? Thanks!

As far as i know, the only way is to use CGO-Text for labels. This is 
tough, though.


http://www.rubor.de/bioinf/pymol_tips.html#cgolabels

--

Fei Xu wrote:

>Would you like to tell me what kind of commands I can use to draw a line
>in pymol, if I know the exact location of this line in 3D-space?


You can use CGO objects from a python script like this:

# cgo-example.py
from pymol import cmd
from pymol.cgo import *

obj = [CYLINDER, 0.1, 0.1, 0.1, 10.0, 0.0, 0.0, 0.1, 0.0, 0.0, 1.0, 1.0, 
0.0, 0.5,]


cmd.load_cgo(obj,'hbonds')

The values in the obj array are: [CYLINDER, start_position X,Y,Z, 
end_position X,Y,Z, thickness, unknown, color

pos1 xyz, pos2 xyz, thick, start_color R,G,B, end_color R,G,B]


Happy New Year!

Kristian Rother





Re: [PyMOL] accessing objects directly

2002-12-22 Thread Kristian Rother

Hi David,

try this:

http://www.rubor.de/bioinf/pymol_tips.html#getcoord


Kristian



David wrote:

Hi,

How do I access the objects I load from files (e.g. pdb file) directly
(i.e. in a script)? If I want to print the coordinates of an atom, or
the value of at a point in the electron density grid?








[PyMOL] Re: molecular surfaces

2002-12-12 Thread Kristian Rother
Dear Rajarshi Guha,

You could at least try to reconfigure Robert Campbell's Color-by-B-factor 
script. It assigns each atom its own color according to another value.

http://www.rubor.de/bioinf/pymol_tips.html#bfac

Kristian




Re: [PyMOL] (no subject)

2002-11-19 Thread Kristian Rother

Fei Xu wrote:

HI! Dr. Delano:
Would you like to tell me how I can control the size of the ball, if I
pick an atom and show it like a ball?


Dear Fei Xu:

1. You select an atom
2. You display it as a ball
3. You type:
set sphere_scale = 2.0

Here, the number is the size proportional to an original size of 1.0.

Unfortunately, settings for individual objects are not functional yet.


Kristian








[PyMOL] practical PyMOL FAQ

2002-11-08 Thread Kristian Rother

Hello all,

In case somebody is new to the mailing list and wonders what problems 
have already been solved, it might be a good idea to take a look at:


http://www.rubor.de/bioinf/pymol_tips.html

which is basically a collection of examples for doing things with molecules.
I have compiled a lot of recent postings there. However, the topics 
around Stereo 3D and MacOSX were not included (i know nothing about both 
of them).



Kristian




Re: [PyMOL] multi-step movie

2002-10-18 Thread Kristian Rother

Hello Gabriel,

Your Questions:


1. How can you make a molecule rotate 10 times only,


go to http://www.rubor.de/bioinf and download the movieScript module
and issue the following commands:

mvClear
mvRot 1-500,x,3600
mvCmd 501,mstop
movie

Explanation:
This tells movieScript to rotate the molecule in frames 1 to 500 around 
3600 degrees, then calls the mstop command in frame 501.




2. Is there any script command, that put the script on
"hold" until you press the mouse or the keyboard
button ? This is useful for multi-step movie.


I think this should be done using the raw_input("press any key")
function from a python script.



3. Is there any possibility to do zoom-in , for
example, into the active site.


of course, there is (e.G. 'actsite' is your active site subselection):

hide all # molecule gets invisible
orient actsite   # now the active site fills out all the screen
move z,-200  # zoom out
move x,50# move a little to the side

# Now your molecule is ready to come to the scene:
show cartoon# make the molecule visible
mvClear
mvSinmove 1-100,x,-50
mvSinmove 1-100,z,200
mvCmd 101,mstop
movie

best wishes,

  Kristian Rother







Re: [PyMOL] rotation about an arbitrary vector?

2002-08-20 Thread Kristian Rother

Dear Will,

You wrote:


The camera
movement I would like to do is a little more than simple rotations or
spirals, so it would be very helpful to me to be able to rotate about
an arbitrary vector, rather than just the principle axes, in mdo
commands. Is there a way to do this? 


There is. The movie.py script does exactly this: camera movements. 
Basically, any movement can be achieved by adding x,y and z rotations.
You can specify how quick each axis is to be rotated and so on. Any 
camera movement can be smoothed, if You like.


http://www.rubor.de/bioinf/pymol_movie.html

As You wrote You are making movies of trajectories i assume that Your 
animation uses more than one state. Movie.py doesn't get alongt with 
them at the moment. This is because i don't know what would be useful.

If You want to go with movie.py, write me, and we'll get something on that.

Kristian




[PyMOL] rTools and Movie for PyMOL released

2002-08-11 Thread Kristian Rother

Dear fellows,

We would like to present some effort we have made to integrate some
structure analysis tools into PyMOL. I won't go into detail much, feel 
free to test it out.


Additionally, i have written a script that provides PyMOL commands 
making creation of smooth animations fairly easy.


All the stuff can be found on:
   http://www.rubor.de/bioinf

Authors  : K. Rother, C. Froemmel et al.,
Institute: Protein Structure Theory Group, Charite Berlin
   http://www.charite.de/bioinf

I am very curious to hear bug reports.

Kristian




Re: [PyMOL] Secondary structure assignments

2002-07-29 Thread Kristian Rother

OK, heres what we've got:

The DSSP program is available for Linux and Windows from
http://www.cmbi.kun.nl/swift/dssp/ .

I have written a Python script that parses the output of DSSP and alters 
the annotation in PyMOL. You just start the script, then You have a


dssp 

command available.

The script can be found on my homepage,

http://www.rubor.de/bioinf/pymol_extensions.html

along with some useful stuff

http://www.rubor.de/bioinf/index.html

However, the script works for sure only on Unix. For Windows, i still 
need to figure out how to

- redirect the output of Dssp on Windows
- assign platform-independent Paths correctly.

If someone could test the script, that would be great.


Kristian






Re: [PyMOL] Update to ScriptBox 0.3 for PyMOL

2002-06-20 Thread Kristian Rother


Hello PyMOL users,

As suggested by Warren, i have made some improvements to the ScriptBox, 
which should integrate better into PyMOL now,


I have written a small program that lets you select your favorite PyMOL 
script from a comfortable box floating beside your PyMOL window.


The URL is still the same:


http://www.rubor.de/bioinf/scriptBox.html

On my page, there is also a 'quick and dirty' hack for PyMOL.
FilePipe.py allows to execute PyMOL commands from a shell. It starts its 
own thread and reads lines from a text file. This doesn't work well, but 
it works.

Does anyone have a better idea to do this?



If you want to have both GUIs running simulaneously, then try using the
startup directory in modules/pmg_tk (you'll need to modify ScriptBox.py
to have an __init__ method which creates the window, but simply
returns instead of forking a thread or calling mainloop)


Thanks, this works in fact really well.


Kristian





[PyMOL] Release of ScriptBox 0.2 for PyMOL

2002-06-15 Thread Kristian Rother

Hello PyMOL users,

I have written a small program that lets you select your favorite PyMOL 
script from a comfortable box floating beside your PyMOL window.


ScriptBox 0.2 can be found at:
http://www.rubor.de/bioinf/scriptBox.html

Its my first release, so the program might still have bugs.

BTW, is there any collection of scripts on the internet to browse through?


Kristian Rother