OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
__init__.py
Go to the documentation of this file.
1 #------------------------------------------------------------------------------
2 # This file is part of the OpenStructure project <www.openstructure.org>
3 #
4 # Copyright (C) 2008-2011 by the OpenStructure authors
5 #
6 # This library is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU Lesser General Public License as published by the Free
8 # Software Foundation; either version 3.0 of the License, or (at your option)
9 # any later version.
10 # This library is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this library; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #------------------------------------------------------------------------------
19 from _ost_conop import *
20 
21 # The 20 standard amino acids in no particular order
22 STANDARD_AMINOACIDS=(
23  'ALA', 'ARG', 'ASN',
24  'ASP', 'GLN', 'GLU',
25  'LYS', 'SER', 'CYS',
26  'MET', 'TRP', 'TYR',
27  'THR', 'VAL', 'ILE',
28  'LEU', 'GLY', 'PRO',
29  'HIS', 'PHE',
30 )
31 
32 def ConnectAll(ent):
33  '''
34  Uses the current default builder to connect the atoms of the entity, assign
35  torsions, and fill in missing or correct erroneous information such as the
36  chemical class of the residues and the atom's element.
37 
38  :param ent: A valid entity
39  :type ent: :class:`~ost.mol.EntityHandle`
40  '''
41  conop_inst=Conopology.Instance()
42  conop_inst.ConnectAll(conop_inst.GetBuilder("DEFAULT"), ent, 0)
43 
44 def GetBuilder(name='DEFAULT'):
45  '''
46  Get registered builder by name
47 
48  :param name: The name of the builder
49 
50  :returns: The builder or None, if the builder doesn't exist
51  '''
52  return Conopology.Instance().GetBuilder(name)
53 
54 def RegisterBuilder(builder, name):
55  '''
56  Register builder to OpenStructure
57 
58  :param builder: A instance of :class:`Builder`
59 
60  :param name: The name of the builder
61  '''
62  conop_inst=Conopology.Instance()
63  conop_inst.RegisterBuilder(builder, name)
64 
65 def SetDefaultBuilder(builder_name):
66  '''
67  Set the builder with the given name as the default. You will have to register
68  a builder with :func:`RegisterBuilder` before you will be able to set it as
69  the default.
70 
71  :raises: :exc:`RuntimeError` when trying to set a builder as the default that
72  has not been registered yet.
73  '''
74  conop_inst=Conopology.Instance()
75  conop_inst.SetDefaultBuilder(builder_name)