clearing the "rank" property also works for me, then the script should not 
depend on retain_order anymore:

    currentName = "%s_%s" % (solutionPymolString, currentChain)
    cmd.alter(currentName, "chain='%s';rank=-1" % currentChain)

However, I think there is also a problem with your script, you're creating 
copies of copies, every iteration will pick up the previously created chains 
and create another copy of the whole thing. Creating the copies in a new object 
will fix this:

newPymolString = 'newobj'
cmd.create(newPymolString, "none")

angle = 360.0/monomers
chains = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", 
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
for i in range(1, monomers):
        currentChain = chains[i]
        currentName = "%s_%s" % (solutionPymolString, currentChain)
        cmd.create(currentName, solutionPymolString, 1, 1)
        cmd.rotate([1, 0, 0], i * angle, currentName, 1, 0, None, [0, 0, 0])
        cmd.alter(currentName, "chain='%s';rank=-1" % currentChain)
        cmd.create(newPymolString, newPymolString + ' or ' + currentName, 1, 1)
        cmd.delete(currentName)


Cheers,
  Thomas

On 01 Mar 2017, at 14:10, Thomas Holder <thomas.hol...@schrodinger.com> wrote:

> Hi Gregor,
> 
> Looks like retain_order is on for her. This should fix it:
> 
> PyMOL> set retain_order, off
> 
> https://pymolwiki.org/index.php/Retain_order
> 
> Cheers,
>  Thomas
> 
> On 01 Mar 2017, at 10:28, Gregor Hagelüken <hagelue...@pc.uni-bonn.de> wrote:
> 
>> Hi,
>> 
>> I use a python script to copy an object, rotate it, alter its chain ID and 
>> then merge it with the original object.
>> Here is the relevant part of my script:
>> 
>>                      angle = 360.0/monomers
>>                      chains = ["A", "B", "C", "D", "E", "F", "G", "H", "I", 
>> "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", 
>> "Y", "Z"]
>>                      for i in range(1, monomers):
>>                              currentChain = chains[i]
>>                              cmd.create("%s_%s" %(solutionPymolString, 
>> currentChain), solutionPymolString, 1, 1)
>>                              cmd.rotate([1, 0, 0], i * angle, "%s_%s" 
>> %(solutionPymolString, currentChain), 1, 0, None, [0, 0, 0])
>>                              cmd.alter("%s_%s" %(solutionPymolString, 
>> currentChain), "chain='%s'" %currentChain)
>>                              cmd.create("%s" %(solutionPymolString), "%s or 
>> %s_%s" %(solutionPymolString, solutionPymolString, currentChain), 1, 1)
>>                              cmd.delete("%s_%s" %(solutionPymolString, 
>> currentChain))
>> 
>> This works fine with PyMOL 1.8.3 and 1.8.5 on my computer (macOS Sierra).
>> 
>> I have given the script to another person and for her it produces a very 
>> strange result.
>> The resulting structure is only visible in lines or sticks mode. And it 
>> looks like this in the sequence viewer:
>> <PastedGraphic-2.tiff>
>> 
>> She used the same input structure as I did but she has PyMOL 1.8.4 and uses 
>> Windows. Could this be a PyMOL bug?
>> 
>> Cheers,
>> Gregor
> 
> -- 
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.

-- 
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to