Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/rev/53800c7e3458
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 00:57:58 2012
Кодировка:
allpy: 53800c7e3458

allpy

changeset 888:53800c7e3458

add test for secondary structure markup for sequence Module protein_pdb was copied from blocks3d/protein_pdb.py. Sequence is created from string, pdb is loaded, ss-markup is applied. Then secondary structure is checked to be entirely alpha-helix. see #120
author Boris Nagaev <bnagaev@gmail.com>
date Sun, 18 Sep 2011 15:11:49 +0400
parents 9b253b69f8f1
children 32808e442d93
files test/protein_pdb.py test/test_markups.py
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/protein_pdb.py	Sun Sep 18 15:11:49 2011 +0400
     1.3 @@ -0,0 +1,18 @@
     1.4 +
     1.5 +import sys
     1.6 +
     1.7 +from allpy import protein, structure
     1.8 +import protein_pdb
     1.9 +
    1.10 +class Sequence(protein.Sequence, structure.SequenceMixin):
    1.11 +    types = protein_pdb
    1.12 +
    1.13 +class Alignment(protein.Alignment, structure.AlignmentMixin):
    1.14 +    types = protein_pdb
    1.15 +
    1.16 +class Block(protein.Block, structure.BlockMixin):
    1.17 +    types = protein_pdb
    1.18 +
    1.19 +class Monomer(protein.Monomer):
    1.20 +    types = protein_pdb
    1.21 +
     2.1 --- a/test/test_markups.py	Sun Sep 18 15:08:40 2011 +0400
     2.2 +++ b/test/test_markups.py	Sun Sep 18 15:11:49 2011 +0400
     2.3 @@ -2,6 +2,7 @@
     2.4  from allpy import base
     2.5  from allpy import protein
     2.6  from allpy import markups
     2.7 +import protein_pdb
     2.8  
     2.9  def test_index():
    2.10      seq = protein.Sequence.from_string('SEQVENCE', name='sequence')
    2.11 @@ -110,4 +111,11 @@
    2.12      assert 'm3' not in out.markups
    2.13      assert out.markups['m4'].__class__ is MyAlignmentMarkup
    2.14  
    2.15 +def test_ss():
    2.16 +    seq = protein_pdb.Sequence.from_string('QLSSDAQTANAKADQASNDANAARS', '1jcc_B')
    2.17 +    seq.auto_pdb()
    2.18 +    seq.add_markup('ss')
    2.19 +    letters = ''.join(m.ss for m in seq)
    2.20 +    assert letters == 'HHHHHHHHHHHHHHHHHHHHHHHHH'
    2.21 +
    2.22  # vim: set ts=4 sts=4 sw=4 et: