Menu

#34 PDBModel.atom2resMask problem

closed-invalid
7
2008-06-04
2008-06-04
No

To reproduce this bug:

m = PDBModel(...)

mask_unpolar= [ n in ['A','G','V','L','M','I','F','Y','W']
for n in m.sequence() ]
m['unpolar'] = m.atom2resMask( mask_unpolar )

this should give a residue mask with 1 distributed all over. Instead the result looks like this::

>>> m['unpolar']
array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, ...]

Background: May be a consequence of the new way numpy is creating True/False rather than 1/0 masks?

Workaround:
Use low-level methods, e.g.,
m['unpolar'] = numpy.take( mask_unpolar, m.resIndex() )

Discussion

  • Raik Gruenberg

    Raik Gruenberg - 2008-06-04
    • status: open --> closed-invalid
     
  • Raik Gruenberg

    Raik Gruenberg - 2008-06-04

    Logged In: YES
    user_id=589508
    Originator: YES

    Nevermind, the error was somewhere else. Nothing wrong with atom2resMask.

     

Log in to post a comment.