allpy
changeset 1027:f31601bca2ac
blocks_to_pymol(): show blocks with cartoon, other with transparent sticks
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Fri, 16 Mar 2012 00:10:42 +0400 |
parents | ca2cf2377bed |
children | aac0f23643f2 |
files | allpy/structure.py |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/allpy/structure.py Thu Mar 15 23:17:23 2012 +0400 1.2 +++ b/allpy/structure.py Fri Mar 16 00:10:42 2012 +0400 1.3 @@ -511,8 +511,11 @@ 1.4 Other sequences are fitted to the main sequence, using all the columns 1.5 from any block, which contains both sequences. 1.6 1.7 + All involved chains are shown with sticks, transparency=0.6 1.8 + (only backbone C, N and CA atoms). 1.9 + Atoms, involved in blocks, are shown with cartoon. 1.10 + 1.11 TODO: Each block is shown in one pymol frame. 1.12 - NOTE: Hide everything except involved chains, represented as cartoon 1.13 """ 1.14 def sequence_to_pdb(s): 1.15 return pdb_id_parse(s.pdb_chain.get_parent().get_parent().get_id())['code'] 1.16 @@ -550,7 +553,13 @@ 1.17 'fit_from': columns_line(columns, fit_from) + " and name ca"}) 1.18 file.write("hide everything, all\n") 1.19 for s in self.sequences: 1.20 - file.write("show cartoon, %(seq)s\n" % {'seq': sequence_line(s)}) 1.21 + file.write("show sticks, %(seq)s and name c+n+ca\n" % 1.22 + {'seq': sequence_line(s)}) 1.23 + for block in blocks: 1.24 + for s in block.sequences: 1.25 + file.write("show cartoon, %(seq)s\n" % 1.26 + {'seq': columns_line(block.columns, s)}) 1.27 + file.write("set stick_transparency, 0.6, all\n") 1.28 1.29 class BlockMixin(base.Block, AlignmentMixin): 1.30 """Mixin to add 3D properties to blocks.