allpy
changeset 1138:94ba384cfa50
structure/blocks_to_pymol: create object for each sequence
Allow several chains of one pdb
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Fri, 11 Jan 2013 21:25:33 +0400 |
parents | 5e1921224949 |
children | 205cd762fd3b |
files | allpy/structure.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/allpy/structure.py Fri Jan 11 20:47:28 2013 +0400 1.2 +++ b/allpy/structure.py Fri Jan 11 21:25:33 2013 +0400 1.3 @@ -526,14 +526,14 @@ 1.4 transparency=0.6 (only backbone C, N and CA atoms). 1.5 Atoms, involved in blocks, are shown with cartoon. 1.6 1.7 - TODO: Each block is shown in one pymol frame. 1.8 + TODO: models 1.9 """ 1.10 def sequence_to_pdb(s): 1.11 return pdb_id_parse(s.pdb_chain.get_parent().get_parent().get_id())['code'] 1.12 def monomer_id(m): 1.13 return m.pdb_residue.get_id()[1] 1.14 def sequence_line(s): 1.15 - return "(%(pdb)s and chain %(chain)s)" % \ 1.16 + return "%(pdb)s_%(chain)s" % \ 1.17 {'pdb': sequence_to_pdb(s), 'chain': s.pdb_chain.get_id()} 1.18 def columns_line(columns, s): 1.19 groups = [] 1.20 @@ -554,6 +554,11 @@ 1.21 pdbs = set(sequence_to_pdb(s) for s in self.sequences) 1.22 for pdb in pdbs: 1.23 file.write("fetch %(pdb)s, async=0\n" % {'pdb': pdb}) 1.24 + for s in self.sequences: 1.25 + file.write("create %(pdb)s_%(chain)s,%(pdb)s and chain %(chain)s\n"\ 1.26 + % {'pdb': sequence_to_pdb(s), 'chain': s.pdb_chain.get_id()}) 1.27 + for pdb in pdbs: 1.28 + file.write("delete %(pdb)s\n" % {'pdb': pdb}) 1.29 fit_to = self.sequences[0] 1.30 for i, block in enumerate(blocks): 1.31 subselections = []