allpy
changeset 1023:4732047ae426
allpy/structure.py: cosmetic improvements of blocks_to_pymol()'s implementation
Refactor private function sequence_line() from private function block_line()
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Thu, 15 Mar 2012 19:47:56 +0400 |
parents | 7fcb6f20898b |
children | b187b16c7532 |
files | allpy/structure.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/allpy/structure.py Wed Mar 14 17:54:01 2012 +0400 1.2 +++ b/allpy/structure.py Thu Mar 15 19:47:56 2012 +0400 1.3 @@ -514,10 +514,13 @@ 1.4 return pdb_id_parse(s.pdb_chain.get_parent().get_parent().get_id())['code'] 1.5 def monomer_id(m): 1.6 return m.pdb_residue.get_id()[1] 1.7 + def sequence_line(s): 1.8 + return "(%(pdb)s and chain %(chain)s)" % \ 1.9 + {'pdb': sequence_to_pdb(s), 'chain': s.pdb_chain.get_id()} 1.10 def block_line(b, s): 1.11 - return '(resi %(resi)s) and %(pdb)s and name ca and chain %(chain)s' % \ 1.12 + return '(resi %(resi)s) and name ca and %(seq)s' % \ 1.13 {'resi': ','.join(str(monomer_id(c[s])) for c in b.columns), 1.14 - 'pdb': sequence_to_pdb(s), 'chain': s.pdb_chain.get_id()} 1.15 + 'seq': sequence_line(s)} 1.16 pdbs = set(sequence_to_pdb(s) for s in self.sequences) 1.17 for pdb in pdbs: 1.18 file.write("fetch %(pdb)s, async=0\n" % {'pdb': pdb})