BUG: atom.select() with 'operator = "OR"'

Issue #196 resolved
Xinqiu Yao created an issue

I've made a little bit update of test-atom.select.R for a more complete test for the atom.select() function. It failed at 'operator="OR"'. Digging into more details gives following information:

 > atom.select(pdb, chain="B")

 Call:  atom.select.pdb(pdb = pdb, chain = "B")

   Atom Indices#: 77  ($atom)
   XYZ  Indices#: 231  ($xyz)

+ attr: atom, xyz, call


> atom.select(pdb, resid="GDP")

 Call:  atom.select.pdb(pdb = pdb, resid = "GDP")

   Atom Indices#: 40  ($atom)
   XYZ  Indices#: 120  ($xyz)

+ attr: atom, xyz, call

> atom.select(pdb, resid="GDP", chain="B", operator="OR")

 Call:  atom.select.pdb(pdb = pdb, resid = "GDP", chain = "B", operator = "OR")

   Atom Indices#: 175  ($atom)
   XYZ  Indices#: 525  ($xyz)

+ attr: atom, xyz, call

Note that the correct number in the last atom select should be 177 (a union of first two selects). I used the examples/test.pdb for the test.

Comments (3)

  1. Lars Skjærven

    bugfix in 302e53. thanks for spotting Xinqiu. this is getting embarrassing...

    > file <- system.file("examples/test.pdb", package="bio3d")
    > pdb=read.pdb(file)
    > atom.select(pdb, chain="B")
    
     Call:  atom.select.pdb(pdb = pdb, chain = "B")
    
       Atom Indices#: 77  ($atom)
       XYZ  Indices#: 231  ($xyz)
    
    + attr: atom, xyz, call
    > 
    > atom.select(pdb, resid="GDP")
    
     Call:  atom.select.pdb(pdb = pdb, resid = "GDP")
    
       Atom Indices#: 40  ($atom)
       XYZ  Indices#: 120  ($xyz)
    
    + attr: atom, xyz, call
    > 
    > atom.select(pdb, resid="GDP", chain="B", operator="OR")
    
     Call:  atom.select.pdb(pdb = pdb, resid = "GDP", chain = "B", operator = "OR")
    
       Atom Indices#: 117  ($atom)
       XYZ  Indices#: 351  ($xyz)
    
    + attr: atom, xyz, call
    
  2. Log in to comment