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() )
Logged In: YES
user_id=589508
Originator: YES
Nevermind, the error was somewhere else. Nothing wrong with atom2resMask.