Yingji,
>> How can I make sure that it's labeled?
Ah, right. OK, if I have this right, you have a box and only the atoms in
the box are visible. Some groups are totally in the box, some are only
partially in the box, such that the alpha carbon is in the box, and thus
visible, and some are only partially in the box and the alpha carbon is not
in the box and thus is not visible.
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
Bob
I tried this:
>
> [javascript]
> ...... #only those atoms inside the box are visible.
> no1 = {visible}.resno.min;
> no2 = {visible}.resno.max;
> for (i=no1; i<no2+1; i++) {
>
> select {visible and resno=i}[1]; label %r;
> }
> [/javascript]
>
> It turns out that most residues are labeled correctly, but some partial
> residues are not
> Do you know why? Or is there a better way of doing it?
>
> delete file=2
>
> I see.
>
> You are asking great questions -- and look -- you found a bug! Thank you!
>
>
> Thank you!
>
> Yingjie
>
>
> ------------------------------------------------------------------------------
> 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
>
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
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