annotate commons/core/sql/TableSetAdaptator.py @ 14:c79b9ae3f65f

Deleted selected files
author m-zytnicki
date Fri, 19 Apr 2013 10:13:11 -0400
parents 769e306b7933
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
1 # Copyright INRA (Institut National de la Recherche Agronomique)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
2 # http://www.inra.fr
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
3 # http://urgi.versailles.inra.fr
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
4 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
5 # This software is governed by the CeCILL license under French law and
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
6 # abiding by the rules of distribution of free software. You can use,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
7 # modify and/ or redistribute the software under the terms of the CeCILL
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
8 # license as circulated by CEA, CNRS and INRIA at the following URL
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
9 # "http://www.cecill.info".
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
10 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
11 # As a counterpart to the access to the source code and rights to copy,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
12 # modify and redistribute granted by the license, users are provided only
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
13 # with a limited warranty and the software's author, the holder of the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
14 # economic rights, and the successive licensors have only limited
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
15 # liability.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
16 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
17 # In this respect, the user's attention is drawn to the risks associated
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
18 # with loading, using, modifying and/or developing or reproducing the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
19 # software by the user in light of its specific status of free software,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
20 # that may mean that it is complicated to manipulate, and that also
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
21 # therefore means that it is reserved for developers and experienced
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
22 # professionals having in-depth computer knowledge. Users are therefore
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
23 # encouraged to load and test the software's suitability as regards their
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
24 # requirements in conditions enabling the security of their systems and/or
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
25 # data to be ensured and, more generally, to use and operate it in the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
26 # same conditions as regards security.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
27 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
28 # The fact that you are presently reading this means that you have had
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
29 # knowledge of the CeCILL license and that you accept its terms.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
30
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
31
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
32 from commons.core.sql.ITableSetAdaptator import ITableSetAdaptator
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
33 from commons.core.sql.TableAdaptator import TableAdaptator
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
34 from commons.core.coord.Set import Set
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
35
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
36
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
37 ## Adaptator for a Set table
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
38 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
39 class TableSetAdaptator( TableAdaptator, ITableSetAdaptator ):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
40
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
41 ## Give a list of Set instances having a given seq name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
42 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
43 # @param seqName string seq name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
44 # @return lSet list of instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
45 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
46 def getListFromSeqName( self, seqName ):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
47 sqlCmd = "SELECT * FROM %s" % (self._table)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
48 colum2Get, type2Get, attr2Get = self._getTypeColumAttr2Get(seqName)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
49 sqlCmd += " WHERE " + colum2Get
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
50 sqlCmd += " = "
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
51 sqlCmd = sqlCmd + type2Get
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
52 sqlCmd = sqlCmd % "'" + attr2Get + "'"
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
53 lSet = self._iDb.getObjectListWithSQLCmd( sqlCmd, self._getInstanceToAdapt )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
54 return lSet
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
55
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
56 ## Give a list of set instances overlapping a given region
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
57 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
58 # @param query string query name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
59 # @param start integer start coordinate
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
60 # @param end integer end coordinate
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
61 # @return lSet list of set instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
62 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
63 def getListOverlappingCoord(self, query, start, end):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
64 sqlCmd = 'select * from %s where chr="%s" and ((start between least(%d,%d) and greatest(%d,%d) or end between least(%d,%d) and greatest(%d,%d)) or (least(start,end)<=least(%d,%d) and greatest(start,end)>=greatest(%d,%d))) ;' % (self._table, query, start, end, start, end, start, end, start, end, start, end, start, end)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
65 lSet = self._iDb.getObjectListWithSQLCmd( sqlCmd, self._getInstanceToAdapt )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
66 return lSet
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
67
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
68 #TODO: to test !!!
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
69 ## Give a list of Set instances overlapping a given region
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
70 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
71 # @note whole chains are returned, even if only a fragment overlap with the given region
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
72 # @param query string query name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
73 # @param start integer start coordinate
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
74 # @param end integer end coordinate
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
75 # @return lSets list of Path instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
76 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
77 def getChainListOverlappingCoord(self, query, start, end):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
78 sqlCmd = "select distinct path from %s where chr='%s' and ((start between least(%d,%d) and greatest(%d,%d) or end between least(%d,%d) and greatest(%d,%d)) or (least(start,end)<=least(%d,%d) and greatest(start,end)>=greatest(%d,%d)));" % (self._table, query,start,end,start,end,start,end,start,end,start,end,start,end)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
79 lIdentifiers = self._iDb.getIntegerListWithSQLCmd(sqlCmd)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
80 lSets = self.getSetListFromIdList(lIdentifiers)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
81 return lSets
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
82
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
83 ## Give a list of identifier numbers contained in the table
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
84 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
85 # @return lId integer list
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
86 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
87 def getIdList(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
88 sqlCmd = "select distinct path from %s;" % (self._table)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
89 lId = self._iDb.getIntegerListWithSQLCmd( sqlCmd )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
90 return lId
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
91
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
92 ## Give a list of the distinct seqName/chr present in the table
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
93 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
94 # @return lDistinctContigNames string list
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
95 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
96 def getSeqNameList(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
97 sqlCmd = "SELECT DISTINCT chr FROM %s" % ( self._table )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
98 lDistinctContigNames = self._iDb.getStringListWithSQLCmd(sqlCmd)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
99 return lDistinctContigNames
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
100
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
101 ## Give a list of Set instances having a given seq name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
102 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
103 # @param seqName string seq name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
104 # @return lSet list of instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
105 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
106 def getSetListFromSeqName( self, seqName):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
107 lSets = self.getListFromSeqName(seqName)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
108 return lSets
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
109
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
110 ## Give a set instances list with a given identifier number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
111 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
112 # @param id integer identifier number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
113 # @return lSet list of set instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
114 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
115 def getSetListFromId(self, id):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
116 SQLCmd = "select * from %s where path=%d;" % (self._table, id)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
117 return self._iDb.getObjectListWithSQLCmd( SQLCmd, self._getInstanceToAdapt )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
118
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
119 ## Give a set instances list with a list of identifier numbers
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
120 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
121 # @param lId integers list identifiers list numbers
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
122 # @return lSet list of set instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
123 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
124 def getSetListFromIdList(self,lId):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
125 lSet = []
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
126 if lId == []:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
127 return lSet
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
128 SQLCmd = "select * from %s where path=%d" % (self._table, lId[0])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
129 for i in lId[1:]:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
130 SQLCmd += " or path=%d" % (i)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
131 SQLCmd += ";"
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
132 return self._iDb.getObjectListWithSQLCmd( SQLCmd, self._getInstanceToAdapt )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
133
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
134 ## Return a list of Set instances overlapping a given sequence
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
135 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
136 # @param seqName string sequence name
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
137 # @param start integer start coordinate
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
138 # @param end integer end coordinate
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
139 # @return lSet list of Set instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
140 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
141 def getSetListOverlappingCoord( self, seqName, start, end ):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
142 lSet = self.getListOverlappingCoord( seqName, start, end )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
143 return lSet
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
144
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
145 ## Delete set corresponding to a given identifier number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
146 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
147 # @param id integer identifier number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
148 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
149 def deleteFromId(self, id):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
150 sqlCmd = "delete from %s where path=%d;" % (self._table, id)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
151 self._iDb.execute(sqlCmd)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
152
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
153 ## Delete set corresponding to a given list of identifier number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
154 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
155 # @param lId integers list list of identifier number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
156 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
157 def deleteFromIdList(self, lId):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
158 if lId == []:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
159 return
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
160 sqlCmd = "delete from %s where path=%d" % ( self._table, lId[0] )
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
161 for i in lId[1:]:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
162 sqlCmd += " or path=%d"%(i)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
163 sqlCmd += ";"
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
164 self._iDb.execute(sqlCmd)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
165
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
166 ## Join two set by changing id number of id1 and id2 set to the least of id1 and id2
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
167 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
168 # @param id1 integer id path number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
169 # @param id2 integer id path number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
170 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
171 def joinTwoSets(self, id1, id2):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
172 if id1 < id2:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
173 newId = id1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
174 oldId = id2
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
175 else:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
176 newId = id2
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
177 oldId = id1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
178 sqlCmd = "UPDATE %s SET path=%d WHERE path=%d" % (self._table, newId, oldId)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
179 self._iDb.execute(sqlCmd)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
180
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
181 ## Get a new id number
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
182 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
183 # @return new_id integer max_id + 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
184 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
185 def getNewId(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
186 sqlCmd = "select max(path) from %s;" % (self._table)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
187 maxId = self._iDb.getIntegerWithSQLCmd(sqlCmd)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
188 newId = int(maxId) + 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
189 return newId
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
190
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
191 ## Give the data contained in the table as a list of Sets instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
192 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
193 # @return lSets list of set instances
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
194 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
195 def getListOfAllSets( self ):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
196 return self.getListOfAllCoordObject()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
197
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
198 def _getInstanceToAdapt(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
199 iSet = Set()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
200 return iSet
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
201
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
202 def _getTypeColumAttr2Get(self, contig):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
203 colum2Get = 'chr'
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
204 type2Get = '%s'
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
205 attr2Get = contig
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
206 return colum2Get, type2Get, attr2Get
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
207
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
208 def _getTypeAndAttr2Insert(self, set):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
209 type2Insert = ("'%d'","'%s'","'%s'","'%d'","'%d'")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
210 attr2Insert = (set.id, set.name, set.seqname, set.start, set.end)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
211 return type2Insert, attr2Insert
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
212
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
213 def _escapeAntislash(self, obj):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
214 obj.name = obj.name.replace("\\", "\\\\")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
215 obj.seqname = obj.seqname.replace("\\", "\\\\")