Hi Bob,

Your answer is very thorough. My problem is solved. More importantly, I learned 
a lot from your solutions. Thank you!

Two side questions: 
1. when replying to a thread, does the title of my email matter? For example, 
should I use "Re: Jmol-users Digest, Vol 58, Issue 33" or "Re: jmolEvaluate 
problem" as my title? 

2. if at the end of a thread, I just want to say thank you to the people who 
have offered help, should I reply to [email protected] or just 
reply to those people? =)

Yingjie

> If you label the alpha carbons, then some of those labels won't appear,
> because they are not visible.
> 
> Well, first question, I guess, is: How did you make them visible or not?
> 
> Also, where do you  want the labels to appear?
> 
> This worked reasonably well:
> 
> load =1crn
> 
> # establish the box
> boundbox {0 0 0} {10 10 10}
> 
> # just to see what I'm working with
> boundbox on
> 
> # select all alpha carbons for groups  with any atoms in the box
> select *.ca and within(group, within(boundbox))
> label %r
> 
> # display only these groups
> display within(group, selected)
> 
> # "hide" all atoms outside the box. The labels will
> # still be there, because I'm not turning those off
> select not within(boundbox)
> spacefill off;wireframe off
> 
> 
> I guess the only question is whether you think the labels are in the right
> place.
> 
> Let's see if I can label JUST the atoms in the box. This time I'll define
> some variables so we can make sense of the logic:
> 
> load 1crn.pdb
> boundbox {0 0 0} {10 10 10}
> boundbox on
> inBox = within(boundbox)
> display inBox
> select *;labels off
> allGroupsIntersectingBox = {within(group, inBox)}
> allGroupsInBox = {allGroupsIntersectingBox and not within(group, not inBox)}
> allGroupsPartiallyInBox = {allGroupsIntersectingBox and not allGroupsInBox}
> allAlphaInBox = {*.ca and allGroupsInBox}
> allTerminatingAtoms = {allGroupsPartiallyInBox and connected(not inBox)}
> selectedAtoms = allAlphaInBox or allTerminatingAtoms
> select selectedAtoms
> label %r
> 
> # That comes close, but includes two labels for some groups that have two
> # connections into the box. I guess if you want only one label per group you
> still
> # have to use a for loop:
> 
> finalSelection = ({})
> var nAtoms = selectedAtoms.size
> for (var i = 1; i <= nAtoms; i++) {
>  var a = selectedAtoms[i]
>  if ({finalSelection and within(group, a)}.size == 0) {
>    finalSelection |= a
>  }
> }
> select *;labels off
> select finalSelection
> label %r
> 
> 


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to