Thanks so much, Bob! This seems to be working perfectly.
The only change I had to make is that rings.length is an array of zeros. So I used rings.lines.count.

I was able to get His rings with
ringsh = {*}.find("SMARTS","c1cncn1", true)
and then make a single array

ringsall = rings + ringsh

Jmol continues to amaze and delight me!
Eric

On 2/10/15 5:47 PM, Robert Hanson wrote:
This is what SMARTS searching does.

rings = {*}.find("SMARTS","c1ccccc1", true)  // an array of atom sets
centers = rings.xyz   // centers of those atom sets; still an array
print centers[1]
print centers[2]
...


On Tue, Feb 10, 2015 at 3:59 PM, Eric Martz <[email protected] <mailto:[email protected]>> wrote:

    I would like to generate a list of distances between the centers of
    aromatic rings, identifying the pair of residues that each distance
    represents.

    I believe the following reports the center of the 6-carbon ring of
    Tyr3
    in 1pgb:


$ load =1pgb
IMMUNOGLOBULIN BINDING PROTEIN          23-NOV-93   1PGB
TWO CRYSTAL STRUCTURES OF THE B1 IMMUNOGLOBULIN-BINDING
DOMAIN OF STREPTOCCOCAL PROTEIN G AND COMPARISON WITH NMR
found biomolecule 1: A

// all rings:

$ rings = {*}.find("SMARTS","c1ccccc1", true)
$ print rings.xyz
{13.123668 14.505501 26.274666}
{7.7295 15.019166 20.959}
{1.7821666 16.910334 17.072166}
{7.07 8.775001 16.5255}
{15.482834 9.6655 22.505835}
{11.408334 10.879166 21.280832}

// just tyr

$ rings = {tyr}.find("SMARTS","c1ccccc1", true)
$ print rings.xyz
{13.123668 14.505501 26.274666}
{1.7821666 16.910334 17.072166}
{15.482834 9.6655 22.505835}

// with labels

for (var i = 1; i <= rings.length; i++) {
 print (rings[i])[1].label("%n%r") + " " + rings[i].xyz
}

TYR3 {13.123668 14.505501 26.274666}
TYR33 {1.7821666 16.910334 17.072166}
TYR45 {15.482834 9.6655 22.505835}

If I had such lists, how would I generate a list of distances between

    the ring-centers, being able to identify the two residues for each
    distance?


// use .xyz.distance  (average position...distance....)

 for (var i = 1; i <= rings.length; i++) {
  for (var j = i + 1; j <= rings.length; j++) {
print (rings[i])[1].label("%n%r") + "\t" + (rings[j])[1].label("%n%r") + "\t" + rings[i].xyz.distance(rings[j].xyz).format("%6.3f")
  }
}

TYR3    TYR33    14.802
TYR3    TYR45     6.572
TYR33    TYR45    16.423


:)



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to