Re: [COOT] coot scripting question

2021-11-24 Thread Artem Evdokimov
Thank you again :)

Artem

- Cosmic Cats approve of this message


On Wed, Nov 24, 2021 at 5:27 PM Paul Emsley 
wrote:

>
> On 24/11/2021 18:22, Artem Evdokimov wrote:
>
> Thank you Paul
>
> And many thanks to several kind folks who answered privately!
>
> It is always exciting to hear from the coot-master himself :)
>
> Sounds like I may have to cheat the graphics somehow or use pymol or
> raster3d.
>
> Artem
>
> On Wed, Nov 24, 2021, 10:01 AM Paul Emsley 
> wrote:
>
>> On 23/11/2021 20:03, Artem Evdokimov wrote:
>> > Dear Cooters!
>> >
>> > I am new to this list, but would love to get a little bit of help
>> > scripting Coot to do something for me, like this:
>> >
>> > 1. read one PDB and one MTZ file
>> > 2. center on a particular location (ideally defined as e.g. a residue)
>> > 3. orient in a particular way (defined as a matrix or however
>> convenient)
>> > 4. contour a map (difference or other) at a particular level
>> > 5. output a snapshot
>> >
>> > (all of this without invoking graphical output as such because I need
>> > this to happen a few hundred times, for a few hundred PDB-MTZ pairs.
>> >
>> > Is it doable?
>>
>>
>> I think so.
>>
>>
>> > Could someone recommend at least a barebones script for this?
>>
>> Do this interactively for one case and then save the state. Then look at
>> 0-coot.state.py or 0-coot.state.scm. That should give you some clues.
>>
>> As for the graphical output screenshot, I have not worked out how to do
>> that without invoking X11, so the alternative is to use raster3d.  There
>> are some parameters to tweak the raster3d representation if you don't
>> like the default.
>>
>>
> The python interface to raster3d:
>
> raster3d("raster3d-example-ligand.r3d")
>
> Then (after) in the shell, run
>
> $ render < raster3d-example-ligand.r3d > raster3d-example-ligand.png
>
> Obviously if you have 100s of them you'd given them different files names
> and batch translate them in a script.
>
> Alternatively,
>
> raster_screen_shot()
>
> will run raster3d/render for you and produce "coot.png"
>
> You will then need to use your python file-system functions skills to
> rename that to something meaningful.
>
> (Ethan Merritt is the author of Raster3D.)
>
> Paul.
>
>
>
> --
>
> To unsubscribe from the COOT list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1
>



To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1

This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/


Re: [COOT] coot scripting question

2021-11-24 Thread Paul Emsley


On 24/11/2021 18:22, Artem Evdokimov wrote:

Thank you Paul

And many thanks to several kind folks who answered privately!

It is always exciting to hear from the coot-master himself :)

Sounds like I may have to cheat the graphics somehow or use pymol or 
raster3d.


Artem

On Wed, Nov 24, 2021, 10:01 AM Paul Emsley > wrote:


On 23/11/2021 20:03, Artem Evdokimov wrote:
> Dear Cooters!
>
> I am new to this list, but would love to get a little bit of help
> scripting Coot to do something for me, like this:
>
> 1. read one PDB and one MTZ file
> 2. center on a particular location (ideally defined as e.g. a
residue)
> 3. orient in a particular way (defined as a matrix or however
convenient)
> 4. contour a map (difference or other) at a particular level
> 5. output a snapshot
>
> (all of this without invoking graphical output as such because I
need
> this to happen a few hundred times, for a few hundred PDB-MTZ pairs.
>
> Is it doable?


I think so.


> Could someone recommend at least a barebones script for this?

Do this interactively for one case and then save the state. Then
look at
0-coot.state.py  or 0-coot.state.scm. That
should give you some clues.

As for the graphical output screenshot, I have not worked out how
to do
that without invoking X11, so the alternative is to use raster3d. 
There
are some parameters to tweak the raster3d representation if you don't
like the default.



The python interface to raster3d:

raster3d("raster3d-example-ligand.r3d")

Then (after) in the shell, run

$ render < raster3d-example-ligand.r3d > raster3d-example-ligand.png

Obviously if you have 100s of them you'd given them different files 
names and batch translate them in a script.


Alternatively,

raster_screen_shot()

will run raster3d/render for you and produce "coot.png"

You will then need to use your python file-system functions skills to 
rename that to something meaningful.


(Ethan Merritt is the author of Raster3D.)

Paul.





To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1

This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/


Re: [COOT] coot scripting question

2021-11-24 Thread Artem Evdokimov
Thank you Paul

And many thanks to several kind folks who answered privately!

It is always exciting to hear from the coot-master himself :)

Sounds like I may have to cheat the graphics somehow or use pymol or
raster3d.

Artem

On Wed, Nov 24, 2021, 10:01 AM Paul Emsley 
wrote:

> On 23/11/2021 20:03, Artem Evdokimov wrote:
> > Dear Cooters!
> >
> > I am new to this list, but would love to get a little bit of help
> > scripting Coot to do something for me, like this:
> >
> > 1. read one PDB and one MTZ file
> > 2. center on a particular location (ideally defined as e.g. a residue)
> > 3. orient in a particular way (defined as a matrix or however convenient)
> > 4. contour a map (difference or other) at a particular level
> > 5. output a snapshot
> >
> > (all of this without invoking graphical output as such because I need
> > this to happen a few hundred times, for a few hundred PDB-MTZ pairs.
> >
> > Is it doable?
>
>
> I think so.
>
>
> > Could someone recommend at least a barebones script for this?
>
> Do this interactively for one case and then save the state. Then look at
> 0-coot.state.py or 0-coot.state.scm. That should give you some clues.
>
> As for the graphical output screenshot, I have not worked out how to do
> that without invoking X11, so the alternative is to use raster3d.  There
> are some parameters to tweak the raster3d representation if you don't
> like the default.
>
> Paul.
>
> 
>
> To unsubscribe from the COOT list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1
>
> This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing
> list hosted by www.jiscmail.ac.uk, terms & conditions are available at
> https://www.jiscmail.ac.uk/policyandsecurity/
>



To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1

This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/


Re: [COOT] coot scripting question

2021-11-24 Thread Marcin Wojdyr
Several years ago I needed a similar script. I don't remember the
details, but it still works, so perhaps you'll find it useful:
https://github.com/ccp4/dimple/blob/master/coots.py
The function basic_script there outputs a script that loads the data,
r3d_script outputs a script that generates input for Raster3D.

Marcin

On Tue, 23 Nov 2021 at 21:13, Artem Evdokimov  wrote:
>
> Dear Cooters!
>
> I am new to this list, but would love to get a little bit of help scripting 
> Coot to do something for me, like this:
>
> 1. read one PDB and one MTZ file
> 2. center on a particular location (ideally defined as e.g. a residue)
> 3. orient in a particular way (defined as a matrix or however convenient)
> 4. contour a map (difference or other) at a particular level
> 5. output a snapshot
>
> (all of this without invoking graphical output as such because I need this to 
> happen a few hundred times, for a few hundred PDB-MTZ pairs.
>
> Is it doable? Could someone recommend at least a barebones script for this?
>
> Many thanks :)
>
> Artem
>
> - Cosmic Cats approve of this message
>
> 
>
> To unsubscribe from the COOT list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1



To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1

This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/


Re: [COOT] coot scripting question

2021-11-24 Thread Paul Emsley

On 23/11/2021 20:03, Artem Evdokimov wrote:

Dear Cooters!

I am new to this list, but would love to get a little bit of help 
scripting Coot to do something for me, like this:


1. read one PDB and one MTZ file
2. center on a particular location (ideally defined as e.g. a residue)
3. orient in a particular way (defined as a matrix or however convenient)
4. contour a map (difference or other) at a particular level
5. output a snapshot

(all of this without invoking graphical output as such because I need 
this to happen a few hundred times, for a few hundred PDB-MTZ pairs.


Is it doable?



I think so.



Could someone recommend at least a barebones script for this?


Do this interactively for one case and then save the state. Then look at 
0-coot.state.py or 0-coot.state.scm. That should give you some clues.


As for the graphical output screenshot, I have not worked out how to do 
that without invoking X11, so the alternative is to use raster3d.  There 
are some parameters to tweak the raster3d representation if you don't 
like the default.


Paul.



To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT=1

This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/