[chimera-dev] Fwd: Question about coloring the points on a Ramachandran plot
Conrad Huang
conrad at cgl.ucsf.edu
Wed Jun 20 10:56:37 PDT 2012
Below are the changes I made to make unselected points be drawn as
outlines while selected points are filled. (This should be the same as
your method 1, but I do not see any artifacts or strangeness like half
the points being blacked out.) There is still the issue of the order in
which points are drawn (points drawn earlier will be obscured by points
drawn later). There is only a static list of points in the Ramachandran
tool, so selected points that appear earlier in the list may be obscured
by the outlines of unselected points that appear later in the list. One
way to get around this is to reorder your list so that selected points
appear at the end. Another possibility is to draw in two passes, first
unselected then selected. I know the reordering method works because
I've used it in another application; the two-pass method _should_ work
but I've not tested it.
Please let me know if my code or explanation does not work as expected.
Conrad
===================================================================
--- __init__.py (revision 36720)
+++ __init__.py (working copy)
@@ -53,13 +53,16 @@
MPLDialog.fillInUI(self, f)
def _displayData(self):
- colors = ['b'] * len(self.phi)
+ edgecolors = ['b'] * len(self.phi)
+ facecolors = ['none'] * len(self.phi)
for n in self.selectedIndices:
- colors[n] = 'r'
+ edgecolors[n] = 'r'
+ facecolors[n] = 'r'
ax = self.subplot
ax.clear()
self._showRegion(ax)
- ax.scatter(self.phi, self.psi, c=colors, picker=True)
+ ax.scatter(self.phi, self.psi, facecolors=facecolors,
+ edgecolors=edgecolors, picker=True)
ax.set_xlabel("phi")
ax.set_xlim(-180, 180)
ax.set_xticks(range(-180, 181, 60))
On 6/19/12 10:52 AM, Eric Pettersen wrote:
> Hi Trina,
> I'm forwarding this to the chimera-dev list to give the "Ramachandran
> plot guy" (Conrad Huang) a chance to answer. I think he's recently done
> many of the same things for a custom script so he's better suited for
> answering...
>
> --Eric
>
> Begin forwarded message:
>
>> *From: *Trina Manalo <trinamanalo_2014 at depauw.edu
>> <mailto:trinamanalo_2014 at depauw.edu>>
>> *Date: *June 19, 2012 7:56:53 AM PDT
>> *To: *pett at cgl.ucsf.edu <mailto:pett at cgl.ucsf.edu>
>> *Subject: **Question about coloring the points on a Ramachandran plot*
>>
>> Hi Eric,
>>
>> I had emailed you about the animated Ramachandran plots, which I have
>> gotten to work. I have a new question to ask you concerning the points
>> of the plot.
>>
>> I've tried coloring the plots by opening Chimera as
>> an administrator and going to IDLE. Then I tried editing the file
>> labeled "_init_" under the "Ramachandran" folder that comes with the
>> program when it is installed. In the file, under "def
>> _displayData(self)" I tried to do 2 things:
>>
>> 1. Change the non-selected residue points to be transparent, so that
>> only the outlines of the non-selected residue points are visible. I
>> want to do this so that the selected residue point is visible when it
>> is behind a lot of points. I got it to be somewhat successful,
>> however, only half of the points turn out this way. The other half
>> turned out to be blacked out and I'm not sure why.
>>
>> 2. Get rid of the non-selected residue points all together so that the
>> only point I see is the residue point that I am interested in
>> following. I tried adding the phrase "marker='None' " in the
>> "ax.scatter" line, but that didn't work.
>>
>> I'd greatly appreciate your help.
>>
>> Thanks,
>> Trina
>>
>>
>>
>
>
>
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
>
More information about the Chimera-dev
mailing list