Re: [COOT] python or scheme?

2009-02-26 Thread Kevin Cowtan
Some of these things are not difficult, they just need a little time and 
the ideas.


I wonder if we need a 'Coot Janitors' project, modelled on the Linux 
'kernel janitors', which helps people get involved in doing some of the 
easier jobs that needs to be done.


If we were to start writing 'how to contribute to coot' documentation, 
how many people would be interested in actually doing it?


Kevin

Alastair Fyfe wrote:
my nomination for Most Useful Improvement to the Reference Manual 
would be a verbosity setting that emitted traces to the console window 
on invocation of each function for which a scriptable wrapper existed 
(basically being able to follow all interpreter to implementation 
transitions). Currently the console output is quite helpful, but could 
be more so.

thanks,
Alastair

Paul Emsley wrote:

Markus Dehnhardt wrote:

 Dear cooters,

 I am new to coot, but I have already discovered how powerful
 extensions and key bindings can be. My question is quite simple: if
 I want to generate my own extension or keybinding, which scripting
 language is better suited? I am not very familiar with either but
 willing to experiment.

 There were similar questions already on this mailing list but there
 are a couple of things that are not clear to me:

 Some of the documentation is for python some for scheme: the
 scripting interface is python and the reference manual is
 scheme. Are all functions awailable for both? Or does one have any
 advantage over the other?

Sigh... Well, you are not the first person to be confused by this. The
state of the scripting documentation has been reported as problematic
for a while.  I don't know what do to about it that does not involved
a lot of work.

Yes, the User Manual is mostly written with schemey examples.  The
reference manual I have not looked at for years :-/, the scripting
interface page is also automatically generated and provides an
interface from a C-programmers point of view - which is very like that
for Python.  I use often this quite often.  The scripting interface
for functions written in scheme/python should equivalent access to
functions that do the same thing.

The syntax of the function calls can be readily converted between
scheme and python.  There are notes available on how to do this.

The functions that we saw today, for example, could have equally well
have been written in python.

 What is other users preference: python or scheme, and why?

For those who are not influenced by me, python I'd say.  And they
chose python because it is more readily picked up for those with an
imperative or object-oriented mind-set.

Like the dolphins, I'd choose scheme for exactly the same reasons.

 How often do people, other than developers, create extensions?

Hard to say, but my feeling is not often enough.  And that is, I
suppose, is due to the poor state of the scripting/extension
documentation.

That and the fact that it takes an investment of time to learn the 
scripting

language, the Coot extensions API and the GUI toolkit.

 And finally to the scheme scripters: how did you learn scheme?

The Little Schemer and Ken Dybvig's The Scheme Programming Language.

To answer your question: python or scheme?

Yes!

We provide the best 2 languages so that you have the choice.

How to choose?  Read The Little Schemer - if you think it is
delightful and stimulating, use sheme.  If you think it is hateful,
irrelevant and full of irritating silly parentheses, use python.

HTH,

Paul.





Re: [COOT] python or scheme

2009-02-26 Thread Pete Meyer
 I am new to coot, but I have already discovered how powerful extensions and
 key bindings can be. My question is quite simple: if I want to generate my
 own extension or keybinding, which scripting language is better suited? I am
 not very familiar with either but willing to experiment.

I'd use whichever language you find easier to express whatever you're
trying to do.  Which one is easier to learn will depend on your
programming background.

 Some of the documentation is for python some for scheme: the scripting
 interface is python and the reference manual is scheme. Are all functions
 awailable for both? Or does one have any advantage over the other?

I started using scheme for historical reasons (a few years back I was
having trouble building coot, and the linux binaries shipped with scheme
enabled) and have stuck with it since.

 What is other users preference: python or scheme, and why? How often do
 people, other than developers, create extensions? And finally to the scheme
 scripters: how did you learn scheme?

I almost never write full-blown extensions.  On the other hand, it's
incredibly useful to have scripting built in to deal with specific
situations (stuff like changing the default display of models and
symmetry mates to alpha-carbon, or loading a set of maps in one shot).

As far as learning scheme, I'd check out SCIP (structure and
interpretation of computer programs).  Aside from that, it's just
another functional language that likes parenthesis.

Pete


Re: [COOT] python or scheme

2009-02-26 Thread William G. Scott

As far as learning scheme,



My $0.02:

From a purely practical standpoint, if, like me, you have limited  
time, energy and mental capacity, python would probably yield a better  
investment payback. There are numerous extensions available that make  
parsing things like pdb files very simple, there is the whole phenix/ 
cctbx resource you can make use of, and it is probably the most  
powerful and commonly employed scripting language among scientists  
(bioinformatics people like perl, for its text processing abilities).  
The syntax is very clean and straightforward and you don't have to  
deal with huge piles of dollar signs and parentheses all over the place.


Whichever you use, be sure to use an editor that employs an  
intelligent syntax highlighting mechanism, like vim, or even emacs (if  
you type with a lisp).  On OS X, TextMate is my editor of choice.


Here's  a site that lists some of the available modules:  
http://wiki.python.org/moin/NumericAndScientific

HTH,

Bill


[COOT] how to optimise the geometry in the coot

2009-02-26 Thread Jhon Thomas
Hello paul

I am completley naive with coot.I am using the coot present with the
ccp4-6.0.2, which is an older version of coot. I am facing very difficulty
in optimising the geometry of the model in coot.I follow the tutorial for
optimisation of the geometry. i go like this.

1)
a) real space refinement of particular zone and then regularization the
zone.real space refinement puts the selected model parts in the density
and regularization again optimizes the model part. but, its very hard to
maintain the perfect geometry for the model this way..

b) Rotate-translate zone followed by real space refinement and then
regularaization.

but, this i am facing very difficulty in regularization..
I always set the coot real matrix weight around 20.


Is this is the correct protocol or there is another way to control the
refinement and regularization in coot.

thnaks in advance

Regards
jhon


Re: [COOT] python or scheme

2009-02-26 Thread Ethan A Merritt
On Thursday 26 February 2009, William G. Scott wrote:
  As far as learning scheme,
 
 My $0.02:
 
  From a purely practical standpoint, if, like me, you have limited  
 time, energy and mental capacity, python would probably yield a better  
 investment payback. 

I hope you will pardon my recounting experience to the contrary.

rant severity=medium

I have struggled to learn python, gradually growing to hate it more
and more as I go.  There must be some fundamental difference in 
mind-set between my approach to scripting/programming and that of
the python crowd.  I find it counter-intuitive, seriously limiting in
non-obvious ways, and just about impossible to debug. Almost anything
else is better - perl, C, scheme, Fortran, ... 
OK, maybe direct shell scripting is worse.
I let myself be talked into using python for several reasonably
large projects that I am now left to maintain, and I regret it.
I doubt I would ever again choose it for a new project.  

 There are numerous extensions available that make   
 parsing things like pdb files very simple, there is the whole phenix/ 
 cctbx resource you can make use of, and it is probably the most  
 powerful and commonly employed scripting language among scientists  
 (bioinformatics people like perl, for its text processing abilities).  
 The syntax is very clean and straightforward and you don't have to  
 deal with huge piles of dollar signs and parentheses all over the place.

Instead you have to deal with the insanity of a language that is
sensitive to whitespace, cannot be 'grep'ed for begin/end blocks,
has no decent debuggers that I have been able to find,
and has serious problems with incompatibility across incremental 
updates of the language itself.

/rant

Granted, most of my rant against python is with regard to using it
for new code development, not so much an indictment against using it
for casual interaction with an existing program.

Anyhow, I'd recommend scheme over python for ease of casual use,
even though at this point my experience with scheme is much less than
with python.

  Ethan
 [not eager to plunge into another python bug-hunt,
  but probably destined to do so in the near future]



 Whichever you use, be sure to use an editor that employs an  
 intelligent syntax highlighting mechanism, like vim, or even emacs (if  
 you type with a lisp).  On OS X, TextMate is my editor of choice.
 
 Here's  a site that lists some of the available modules:  
 http://wiki.python.org/moin/NumericAndScientific
 
 HTH,
 
 Bill
 



-- 
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742


Re: [COOT] how to optimise the geometry in the coot

2009-02-26 Thread Paul Emsley

Jhon Thomas wrote:

Hello paul

I am completley naive with coot.I am using the coot present with the 
ccp4-6.0.2, which is an older version of coot. I am facing very 
difficulty in optimising the geometry of the model in coot.I follow 
the tutorial for optimisation of the geometry. i go like this.


1)
a) real space refinement of particular zone and then regularization 
the zone.


I doubt that that's what it says in the tutorial.


real space refinement puts the selected model parts in the density and 
regularization again optimizes the model part. but, its very hard to 
maintain the perfect geometry for the model this way..


What is wrong with the geometry?


b) Rotate-translate zone followed by real space refinement and then 
regularaization.


You need RTZ? Urgh.



but, this i am facing very difficulty in regularization..
I always set the coot real matrix weight around 20.


Is this is the correct protocol


No.

or there is another way to control the refinement and regularization 
in coot.




A rule of thumb:  don't use regularization when you have electron density.

Go to a good area of the model.  Triple refine.  Are the traffic lights 
all green?  Good.  If not change the weight until they are.


Now work on the problematic region...

HTH,

Paul.


[COOT] Open windows with startup script

2009-02-26 Thread Meindert Lamers
Dear all,

I was wondering if there is a way to open the following windows using a
startup script.
-Cell  symmetry
-Stereo/mono
-Refine regularize control
-Bond parameters.

I can get windows to open for Model/Fit/Refine, Display Manager,  Go to
atom using:
(post-model-fit-refine-dialog)
(post-go-to-atom-window)
(post-display-control-window)

but I haven't found similar commands for the 4 windows mentioned.

Thanks,
Meindert