Re: [PyMOL] selection help + align question

2005-01-21 Thread Jules Jacobsen

Hi,

I've written a script for aligning all structures loaded against your 
structure of choice:



def __init__(self):
cmd.extend('allalign',allAlign)

def allAlign(id=''):
Aligns all models in a list to the
specified model where '' is the model id you want to 
align 	 all others against. Written by Jules Jacobsen 
(jacob...@ebi.ac.uk). Feel free to do whatever you like with this code.

id = id.lower()
pdbList = cmd.get_names()

for entry in pdbList[:]:
entry = entry.strip()
if entry not in id:
cmd.do('align %s, %s\n'%(entry,id))

cmd.do('zoom %s'%(id))
cmd.do('show cartoon, %s'%(id))


just save the section above as a seperate file ie allalign.py and put it 
in the PyMOL\modules\pmg_tk\startup directory.


the script is run using the command 'allalign x' where x is the model 
you wish to align all others against.


This is one of my first teetering steps into Python so if anyone can 
suggest a better way of writing it i'd be keen to hear


Jules



Douglas Kojetin wrote:

Thanks for that one; it works as advertised.

Another question:  if I have 10 different structures read into PyMOL, 
what is the best (most accurate) method for aligning the structures as 
an ensemble?  Currently, I'm aligning all to the first structure read in 
(i.e. 21, 31, etc.) using a for loop and the 'align' command.  Since 
the structures have different sequences, I cannot use 'intra_fit', etc., 
is that right?  Are there any other commands or methods of aligning that 
might be easy to script?


Thanks,
Doug


On Jan 20, 2005, at 2:12 PM, Warren DeLano wrote:


Doug,

Setwise logical ANDs and ORs are tricky at first.  In this case, you 
want to
create a new set that contains atoms in a1 *or* a2.  There aren't any 
atoms

that are in both a1 and a2 which is why you're ending up with an empty
object.

create one, a1 or a2


-Original Message-
I'm having some problems with selection syntax w/ multiple objects.
I've loaded four different PDB files (in sequence  structure):

load 1.pdb, a1
load 2.pdb, a2
load 3.pdb, b1
load 4.pdb, b2

I wanted to create two new selections:

one = a1  a2
two = b1  b2

I've tried many different combinations of PyMOL selection
syntax, but I cannot get the objects to add to the same
selection (using 'create' or
'select'):

create one, a1 + a2
create one, a1 and a2
create one, object a1 + object a2
create one, a*

 From what I've read in the manual, I think these commands
are not working because they actually work to select atoms
that are the same between a1  a2.  The manual says it
'selects atoms included in both s1 and s2'.

Any clues or hints?

Thanks,
Doug





---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users






Re: [PyMOL] selection help + align question

2005-01-20 Thread Douglas Kojetin

Thanks for that one; it works as advertised.

Another question:  if I have 10 different structures read into PyMOL, 
what is the best (most accurate) method for aligning the structures as 
an ensemble?  Currently, I'm aligning all to the first structure read 
in (i.e. 21, 31, etc.) using a for loop and the 'align' command.  
Since the structures have different sequences, I cannot use 
'intra_fit', etc., is that right?  Are there any other commands or 
methods of aligning that might be easy to script?


Thanks,
Doug


On Jan 20, 2005, at 2:12 PM, Warren DeLano wrote:


Doug,

Setwise logical ANDs and ORs are tricky at first.  In this case, you 
want to
create a new set that contains atoms in a1 *or* a2.  There aren't any 
atoms

that are in both a1 and a2 which is why you're ending up with an empty
object.

create one, a1 or a2


-Original Message-
I'm having some problems with selection syntax w/ multiple objects.
I've loaded four different PDB files (in sequence  structure):

load 1.pdb, a1
load 2.pdb, a2
load 3.pdb, b1
load 4.pdb, b2

I wanted to create two new selections:

one = a1  a2
two = b1  b2

I've tried many different combinations of PyMOL selection
syntax, but I cannot get the objects to add to the same
selection (using 'create' or
'select'):

create one, a1 + a2
create one, a1 and a2
create one, object a1 + object a2
create one, a*

 From what I've read in the manual, I think these commands
are not working because they actually work to select atoms
that are the same between a1  a2.  The manual says it
'selects atoms included in both s1 and s2'.

Any clues or hints?

Thanks,
Doug