On Oct 21, 2012, at 2:21 AM, Strotz von Moos Dean wrote:

Hi Eric,

Thank you for your kind response, I did indeed not realize the necessity to look up the residue and that it is not sufficient to just supply the sequence number.

I have a follow up question, if I may: 
I have not been able to figure out how to color the bonds individually, according to the list of colors supplied in the pseudobondsToAdd list.

Rather the color is always set according to the last color supplied in the list, since the command in the code obviously colors the group as a whole:

    for line in data:
    r1, A1, r2, A2, c = line
    r1 = int(r1)
    r2 = int(r2)
    A1 = unicode(A1)
    A2 = unicode(A2)
    rId1 = resLookup[r1]
    rId2 = resLookup[r2]
    grp = getPseudoBondGroup("mybonds", associateWith=model)
    grp.newPseudoBond(rId1.atomsMap[A1][0],rId2.atomsMap[A2][0])
    grp.color = getColorByName(c)

After consulting the commands index, it is not clear to me how to write the code to color the pseudobonds individually with the input of the color from the variable c.

Hi Dean,
Yes, you need to color the individual pseudobonds.  The first thing to know is that newPseudoBond returns the created pseudobond instance.  Second, that pseudobond has a 'color' attribute you can set.  Third, bonds and pseudobonds are, by default, colored in "halfbond" mode, i.e. each side of bond/pseudobond having the same color as the atom it's attached to.  So, the pseudobond's 'halfbond' attribute has to be set to False in order for the color you assign to show.
With all that then, change:

    grp.newPseudoBond(rId1.atomsMap[A1][0],rId2.atomsMap[A2][0])
    grp.color = getColorByName(c)

to:

    pb = grp.newPseudoBond(rId1.atomsMap[A1][0],rId2.atomsMap[A2][0])
    pb.color = getColorByName(c)
    pb.halfbond = False

--Eric

                        Eric Pettersen
                        UCSF Computer Graphics Lab

                        http://www.cgl.ucsf.edu