Re: [IMP-users] How to : Access chain properties such as chain ID. Access particle properties.
To: Help and discussion for users of IMP <>
Subject: Re: [IMP-users] How to : Access chain properties such as chain ID. Access particle properties.
From: Daniel Russel <>
Date: Tue, 22 Mar 2011 08:48:30 -0700
Reply-to: Help and discussion for users of IMP <>
For getting attribute keys, most decorators have methods to retrieve the keys they use eg Chain::get_id_key(). Some decorators may be missing those, please report ones you encounter which do.
On Mar 22, 2011, at 8:37 AM, Benjamin SCHWARZ wrote:
The chain_id is the ascii value for the letter stored in the PDB file. I think the main reason for directly returning an int instead of the char is that 26 is kind of a small limit.
Oups, thanks Daniel, I missed that method in the documentation :
c0.get_as_chain().get_id()
does the trick.
I still have a question concerning the nice way for retrieving attribute Keys
3. Is there a nicer way to get a keyType for instance from its string ? In my example, I retrieved chainKey as the third element of the integer keys list returned by get_int_attributes(), this is not very satisfying, and I thought of resorting to a function such as :
defgetChainKey( chain ):
for k in chain.get_int_attributes() :
if k.get_string() == 'chain' :
return k
returnNone
Still, I wonder if there is an IMP mechanism I am not aware of, that I should prefer instead.
--Ben.S
_______________________________________________ IMP-users mailing list "> https://salilab.org/mailman/listinfo/imp-users