# [Chimera-users] Electric field lines?

Tom Goddard goddard at sonic.net
Mon Dec 17 10:51:51 PST 2012

```Hi Darrell,

Ok I checked in the electrostatic field line code.  It will be in tonight's Chimera daily build but not in the Chimera 1.7 release candidate.  The code is slow (10 seconds for 1000 lines of a 100**3 potential map) and I'd like to make some other improvements, but I put it in as is so you can try it right away if you like.  Here's an example,

open potential.dx
measure fieldLines #0 lines 500 startAbove 10 color pink linewidth 2
scolor #1 volume #0 cmap -10,red:0,white:10,blue

The measure command creates the lines and the scolor command colors them.  The lines parameter is how many lines to show, with lines starting at potential magnitudes above 10 (startAbove).  There is some trickiness to which field lines are shown that is described in the email below to Conrad.

Tom

>
> On 12/13/2012 9:48 AM, Tom Goddard wrote:
>>
>> Good question.  This is the whole problem with showing field lines --
>> which of the infinity of lines to show.  I think a main impression of
>> the lines is given by how dense they are in different regions.  That
>> just depends on which you choose to show.  So the answer is I tried
>> something crazy and in that image.  The idea was I'd like lines to
>> originate around charges and the number of lines around a charge to
>> be proportional to the charge.  I want to do it with only the map.
>> So I compute the magnitude of the gradient squared divided by the
>> potential at every grid point and use the grid points with the
>> largest N values for starting N field lines.  Here's my rather shaky
>> reasoning.  Near a point charge the potential is q/r.  The gradient
>> squared divided by the potential is q/r**3 ( = (q/r**2)**2 /  (q/r)
>> ).  If the chosen points have grad squared / potential > C then they
>> are grid points where q/r**3 > C, in other words r**3 < q/C.  The
>> number of grid points around a charge used is proportional to the
>> volume r**3 so is linear in charge.  That's the theory.  I realized
>> this morning the APBS potential probably uses a Gaussian charge
>> distribution for each charge (it uses atom radius I think).  So the
>> potential close to the charge is not q/r -- no singularity at the
>> charge position.  But it still seems to concentrate field lines
>> around charges and more around bigger charges.  Probably there are
>> better approaches and probably different field line choosing methods
>> would be handy depending on what one wants to show.  It's a can of
>> worms.
>>
>> Tom
>>
>>
>>
>>
>> On Dec 13, 2012, at 9:31 AM, Conrad Huang
>> wrote:
>>
>>> Just out of curiosity, how are the field lines chosen?  There are
>>> obviously many lines to choose from, but your image shows lines
>>> that almost look hand selected.  Good job!
>>>

On Dec 13, 2012, at 5:37 AM, "Hurt, Darrell (NIH/NIAID) [E]" wrote:

> Hi Tom,
>
> This is fantastic! I noticed that you've even colored the lines by their potential. Excellent!
>
> Thank you. I look forward to using it soon!
>
> Darrell
>
>
>
> Darrell Hurt, Ph.D.
> Bioinformatics and Computational Biosciences Branch (BCBB)
> OCICB/OSMO/OD/NIAID/NIH
>
>
>
> Disclaimer: The information in this e-mail and any of its attachments is confidential and may contain sensitive information. It should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage devices. National Institute of Allergy and Infectious Diseases shall not accept liability for any statements made that are sender's own and not expressly made on behalf of the NIAID by one of its representatives.
>
> From: Tom Goddard
> Date: Thursday, December 13, 2012 1:10 AM
> To: Darrell Hurt
> Cc: chimera-users
> Subject: Re: [Chimera-users] Electric field lines?
>
> Hi Darrell,
>
>  I made a Python Chimera script to show electrostatic field lines using a potential map.  I've attached an example picture.  Didn't have time today to put this into the Chimera daily build.
>
> Tom
>
>
> [cid:AC7D498F-1D49-49C8-9E7E-91C336C2F0D0]
>
>
> On Dec 12, 2012, at 12:08 PM, "Hurt, Darrell (NIH/NIAID) [E]" wrote:
>
> Hi Chimera team,
>
> Is it possible to visualize electric field lines in Chimera from, for example, an APBS run? If so, how do I do it? I've scanned through the documentation, but didn't find anything…
>
> Thanks,
> Darrell
>
> <fieldlines_2sod.jpg>_______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

```