A general solution to such inquiries is found in Jmol 11.6. Jmol now
allows an extended version of the select command specifically for this
sort of complex selection. The syntax is:


select {someOverallAtomExpression} (some math expression using variable _x)

"_x" here represents "each atom of the atom expression." This allows
for a quite flexible query capability.

For example:

cdrStart = 10
cdrEnd = 15

select {:a} (_x.resno - within("chain", _x)[1].resno >= cdrStart - 1
&& _x.resno - within("chain",_x)[1].resno <= cdrEnd - 1)


selects the 10th through the 15th residues in chain a because
within("chain", _x)[1] gets you the first atom of the chain containing
the atom _x.

You can speed up this search (which isn't very slow anyway) by just
scanning the alpha carbons, then pulling in their entire group.

select {*.ca:a} (_x.resno - within("chain", _x)[1].resno >= cdrStart -
1 && _x.resno - within("chain",_x)[1].resno <= cdrEnd - 1)
select within(group,selected)

You could create a function that does this:

function selectCDR(chainID, r1, r2)
  script inline @{"select *.ca and :" + chainID}
  select {selected} (_x.resno - within("chain", _x)[1].resno >= r1 - 1
&& _x.resno - within("chain",_x)[1].resno <= r2 - 1)
  select within(group,selected)
  return {selected}
end function

Here I return the value of the selection, just because perhaps I want
to do something with it:


  color @{selectCDR("a",97,115)} red

same as

  selectCDR("a",97,115)
  color red




Bob Hanson


On Wed, Dec 10, 2008 at 4:15 AM, Angel Herraez <[EMAIL PROTECTED]> wrote:
> Hello Umanga
>
> Jmol will always use the residue numbers that are written in the pdb
> file (not the order in the chain or in the file).
> So, your problem seems to be in the exact data you have in your pdb
> file.
>
> That said, there may be a way for Jmol to find out the length of
> chain A and add it to the actual residue nr. in B. But I would say
> that is a non trustable solution for other models (even for this, see
> below).
>
> More things:
>
> 1. There is some error in the numbering of your first example: it
> cannot go from 98 to 97.
> a look at 1uj3.pdb gives this:
> chain A goes from residues 1 to 214
> chain B goes from residues 301 to 517
> So your offset of 215 is not valid either.
>
> 2. Your commands are OK, but you can use simpler notation for residue
> numbers:
>  select :a and (resno > 97 and resno < 106); color red
> is the same as
>  select :a and 98-105; color red
> or even
>  select 98-105:a; color red
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> 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

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to