1
2 """
3 File : uniprot2piana.py
4 Author : Ramon Aragues, Javier Garcia Garcia
5 Creation : 16.3.2004
6 Modified : Javier Garcia Garcia December 2007
7 Contents : fills up tables in database piana with information from uniprot
8 Called from :
9
10 =======================================================================================================
11
12 This file implements a program that fills up tables in database piana with information of uniprot databases
13
14 This parser uses biopython libraries and methods
15
16 Command line option '--help' describes usage of this program
17
18 For more details on how to use it, read piana/README.populate_piana_db
19 """
20
21
23
25
26 self.name = name
27 self.attrs = attrs
28 self.childs = {}
29 self.value = []
30
31
33 self.childs.setdefault(XMLNodeChild.name.lower(), []).append(XMLNodeChild)
34
36 return "".join(self.value)
37
39 self.value.append(value)
40
42
43 if child_name is None:
44 c = []
45 [ c.extend(x) for x in self.childs.values() ]
46 return c
47 return self.childs[child_name.lower()]
48
50 if( len(self.childs[child_name.lower()])!=1 ):
51
52 return None
53 return self.childs[child_name.lower()][0]
54