Did I find the right examples for you? yes no

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)

src/c/o/cogent-1.5.3/cogent/format/pdb.py   cogent(Download)
from cogent.struct.selection import einput
from cogent.data.protein_properties import AA_NAMES
from cogent.parse.pdb import dict2pdb, dict2ter
 
__author__ = "Marcin Cieslik"
        fields = atom.getDict()
        if (old_fields['chain_id'] != fields['chain_id']) and old_fields['chain_id'] and old_fields['res_name'] in AA_NAMES:
                coords.append(dict2ter(old_fields))
        if (old_fields['model'] != fields['model']) and old_fields['model'] != '': # model can be 0 :)
                if old_fields['chain_id'] and old_fields['res_name'] in AA_NAMES:
                    coords.append(dict2ter(old_fields))
        old_fields = fields
    if fields['res_name'] in AA_NAMES:
        coords.append(dict2ter(fields))
    coords.append('ENDMDL\n')
    coords.append('END   \n')

src/p/y/pycogent-HEAD/cogent/format/pdb.py   pycogent(Download)
from cogent.struct.selection import einput
from cogent.data.protein_properties import AA_NAMES
from cogent.parse.pdb import dict2pdb, dict2ter
 
__author__ = "Marcin Cieslik"
        fields = atom.getDict()
        if (old_fields['chain_id'] != fields['chain_id']) and old_fields['chain_id'] and old_fields['res_name'] in AA_NAMES:
                coords.append(dict2ter(old_fields))
        if (old_fields['model'] != fields['model']) and old_fields['model'] != '': # model can be 0 :)
                if old_fields['chain_id'] and old_fields['res_name'] in AA_NAMES:
                    coords.append(dict2ter(old_fields))
        old_fields = fields
    if fields['res_name'] in AA_NAMES:
        coords.append(dict2ter(fields))
    coords.append('ENDMDL\n')
    coords.append('END   \n')

src/c/o/cogent-1.5.3/tests/test_parse/test_pdb.py   cogent(Download)
#!/usr/bin/env python
"""Unit tests for the pdb parser.
"""
from cogent.util.unit_test import TestCase, main
from cogent.parse.pdb import dict2pdb, dict2ter, pdb2dict, get_symmetry, \
    def test_dict2ter(self):
        d = {'ser_num': 1, 'chain_id': 'A', 'res_name': 'MET', 'res_ic': ' ', \
              'res_id': 1,}
        assert dict2ter(d) == 'TER       2      MET A   1 \n'
if __name__ == '__main__':

src/p/y/pycogent-HEAD/tests/test_parse/test_pdb.py   pycogent(Download)
#!/usr/bin/env python
"""Unit tests for the pdb parser.
"""
from cogent.util.unit_test import TestCase, main
from cogent.parse.pdb import dict2pdb, dict2ter, pdb2dict, get_symmetry, \
    def test_dict2ter(self):
        d = {'ser_num': 1, 'chain_id': 'A', 'res_name': 'MET', 'res_ic': ' ', \
              'res_id': 1,}
        assert dict2ter(d) == 'TER       2      MET A   1 \n'
if __name__ == '__main__':