Esben,

load molA.pdb
select selA, resi 100-200

create molAcpy, molA
select selAcpy, selA in molAcpy

Note that this will only work if the atom identifiers: name, resi, resn,
segi, chain are all unique. The "in" operator does not distinguish based on
the "alt" (alternate conformer) property, so all matching conformers for a
residue will be selected in the new selection if any were selected in the
original.

Cheers,
Warren


-----Original Message-----
From: pymol-users-boun...@lists.sourceforge.net
[mailto:pymol-users-boun...@lists.sourceforge.net] On Behalf Of Esben Jannik
Bjerrum
Sent: Thursday, December 14, 2006 6:54 AM
To: pymol-users@lists.sourceforge.net
Subject: [PyMOL] Copy a selection for a new molecule?

Hi All
    in one of my scripts I have a problem with getting a selection for a new
molecule which is created from a copy of another which also have a
selection. In the first one a selection is made of the user, but after
creating a new molecule from the whole of the old, I cannot use the old
selection directly.
I could of course specify the selection in the script itself, but for
interactive use of user-defined selections I've tried

    stored.list=[]
    cmd.iterate(selection+ " & name ca","stored.list.append(resi)")
    print stored.list
    cmd.select("newsel","none")
    for resi in stored.list:
        print resi
        cmd.select("newsel", "newsel or ("molecule2" &resi %s)"%resi)

Is there a more elegant and or robust way of doing this? I'm especially
tired of the iterating through the list for each new molecule.

Best Regards
Esben



 
____________________________________________________________________________
________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's
Techsay panel and you'll get the chance to share your opinions on IT &
business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users


Reply via email to