comparison commons/core/sql/ITablePathAdaptator.py @ 6:769e306b7933

Change the repository level.
author yufei-luo
date Fri, 18 Jan 2013 04:54:14 -0500
parents
children
comparison
equal deleted inserted replaced
5:ea3082881bf8 6:769e306b7933
1 # Copyright INRA (Institut National de la Recherche Agronomique)
2 # http://www.inra.fr
3 # http://urgi.versailles.inra.fr
4 #
5 # This software is governed by the CeCILL license under French law and
6 # abiding by the rules of distribution of free software. You can use,
7 # modify and/ or redistribute the software under the terms of the CeCILL
8 # license as circulated by CEA, CNRS and INRIA at the following URL
9 # "http://www.cecill.info".
10 #
11 # As a counterpart to the access to the source code and rights to copy,
12 # modify and redistribute granted by the license, users are provided only
13 # with a limited warranty and the software's author, the holder of the
14 # economic rights, and the successive licensors have only limited
15 # liability.
16 #
17 # In this respect, the user's attention is drawn to the risks associated
18 # with loading, using, modifying and/or developing or reproducing the
19 # software by the user in light of its specific status of free software,
20 # that may mean that it is complicated to manipulate, and that also
21 # therefore means that it is reserved for developers and experienced
22 # professionals having in-depth computer knowledge. Users are therefore
23 # encouraged to load and test the software's suitability as regards their
24 # requirements in conditions enabling the security of their systems and/or
25 # data to be ensured and, more generally, to use and operate it in the
26 # same conditions as regards security.
27 #
28 # The fact that you are presently reading this means that you have had
29 # knowledge of the CeCILL license and that you accept its terms.
30
31
32 ## Interface for TablePathAdaptator
33 #
34 class ITablePathAdaptator (object):
35
36 ## Give the data contained in the table as a list of Path instances
37 #
38 # @return lPaths list of path instances
39 #
40 def getListOfAllPaths( self ):
41 pass
42
43 ## Give a list of Path instances having the same identifier
44 #
45 # @param id integer identifier number
46 # @return lPath a list of Path instances
47 #
48 # @warning old name was getPathList_from_num
49 #
50 def getPathListFromId( self, id ):
51 pass
52
53 ## Give a list of Path instances according to the given list of identifier numbers
54 #
55 # @param lId integer list
56 # @return lPath a list of Path instances
57 #
58 # @warning old name was getPathList_from_numlist
59 #
60 def getPathListFromIdList( self, lId ):
61 pass
62
63 ## Give a list of Path instances having the same given query name
64 #
65 # @param query string name of the query
66 # @return lPath a list of Path instances
67 #
68 # @warning old name was getPathList_from_query
69 #
70 def getPathListFromQuery( self, query ):
71 pass
72
73 ## Give a list with all the distinct identifiers corresponding to the query
74 #
75 # @param query string name of the query
76 # @return lId a list of integer
77 #
78 # @warning old name was getPathList_from_query
79 #
80 def getIdListFromQuery( self, query ):
81 pass
82
83 ## Give a list with all the distinct identifiers corresponding to the subject
84 #
85 # @param subject string name of the subject
86 # @return lId a list of integer
87 #
88 # @warning old name was getPathList_from_subject
89 #
90 def getIdListFromSubject( self, subject ):
91 pass
92
93 ## Insert a path instance
94 #
95 # @param obj a path instance
96 # @param delayed boolean indicating if the insert must be delayed
97 #
98 # @note data are inserted such that the query is always on the direct strand
99 #
100 # @warning old name was insAPath
101 #
102 def insert(self, obj, delayed = False):
103 pass
104
105 ## Insert a list of Path instances
106 #
107 # @param l a list of Path instances
108 # @param delayed boolean
109 #
110 # @warning old name was insPathList
111 #
112 def insertList(self, l, delayed = False):
113 pass
114
115 ## Give a list of the identifier number contained in the table
116 #
117 # @return l integer list
118 #
119 # @warning old name was getPath_num
120 #
121 def getIdList(self):
122 pass
123
124 ## Give a list of Path instances having the same given subject name
125 #
126 # @param subject string name of the subject
127 # @return lPath a list of Path instances
128 #
129 # @warning old name was getPath_num
130 #
131 def getPathListFromSubject( self, subject ):
132 pass
133
134 ## Give a list of the distinct subject names present in the table
135 #
136 # @return lDistinctTypeNames string list
137 #
138 # @warning old name was getListDistinctSubjectName
139 #
140 def getSubjectList(self):
141 pass
142
143 ## Give a list of the distinct query names present in the table
144 #
145 # @return lDistinctQueryNames string list
146 #
147 # @warning old name was getListDistinctQueryName
148 #
149 def getQueryList(self):
150 pass
151
152 ## Give a list of Set instance list from the path contained on a query name
153 #
154 # @param queryName string query name
155 # @return lSet list of set instance
156 #
157 def getSubjectListFromQuery (self, queryName):
158 pass
159
160 ## Give a list of Path instances with the given query and subject, both on direct strand
161 #
162 # @param query string query name
163 # @param subject string subject name
164 # @return lPaths list of path instances
165 #
166 # @warning old name was getListPathsWithDirectQueryDirectSubjectPerQuerySubject
167 #
168 def getPathListWithDirectQueryDirectSubjectFromQuerySubject( self, query, subject ):
169 pass
170
171 ## Give a list of Path instances with the given query on direct strand and the given subject on reverse strand
172 #
173 # @param query string query name
174 # @param subject string subject name
175 # @return lPaths list of path instances
176 #
177 # @warning old name was getListPathsWithDirectQueryReverseSubjectPerQuerySubject
178 #
179 def getPathListWithDirectQueryReverseSubjectFromQuerySubject( self, query, subject ):
180 pass
181
182 ## Give the number of Path instances with the given query name
183 #
184 # @param query string query name
185 # @return pathNb integer the number of Path instances
186 #
187 # @warning old name was getNbPaths_from_query
188 #
189 def getNbPathsFromQuery( self, query ):
190 pass
191
192 ## Give the number of Path instances with the given subject name
193 #
194 # @param subject string subject name
195 # @return pathNb integer the number of Path instances
196 #
197 # @warning old name was getNbPaths_from_subject
198 #
199 def getNbPathsFromSubject( self, subject ):
200 pass
201
202 ## Give the number of distinct path identifiers
203 #
204 # @return idNb integer the number of Path instances
205 #
206 # @warning old name was getNbAllPathsnums
207 #
208 def getNbIds( self ):
209 pass
210
211 ## Give the number of distinct path identifiers for a given subject
212 #
213 # subjectName string subject name
214 # @return idNb integer the number of Path instances
215 #
216 # @warning old name was getNbPathsnums_from_subject
217 #
218 def getNbIdsFromSubject( self, subjectName ):
219 pass
220
221 ## Give the number of distinct path identifiers for a given query
222 #
223 # @param queryName string query name
224 # @return idNb integer the number of Path instances
225 #
226 # @warning old name was getNbPathsnums_from_query
227 #
228 def getNbIdsFromQuery( self, queryName ):
229 pass
230
231 ## Give a list of Path instances overlapping a given region
232 #
233 # @param query string query name
234 # @param start integer start coordinate
235 # @param end integer end coordinate
236 # @return lPath list of Path instances
237 #
238 def getPathListOverlappingQueryCoord( self, query, start, end ):
239 pass
240
241 ## Give a list of Set instances overlapping a given region
242 #
243 # @param query string query name
244 # @param start integer start coordinate
245 # @param end integer end coordinate
246 # @return lSet list of Set instances
247 #
248 # @warning old name was getSetList_from_qcoord
249 #
250 def getSetListOverlappingQueryCoord(self, query, start, end):
251 pass
252
253 ## Give a list of Path instances included in a given query region
254 #
255 # @param query string query name
256 # @param start integer start coordinate
257 # @param end integer end coordinate
258 # @return lPaths list of Path instances
259 #
260 # @warning old name was getIncludedPathList_from_qcoord
261 #
262 def getPathListIncludedInQueryCoord( self, query, start, end ):
263 pass
264
265 ## Give a list of Set instances included in a given region
266 #
267 # @param query string query name
268 # @param start integer start coordinate
269 # @param end integer end coordinate
270 # @return lSet list of Set instances
271 #
272 # @warning old name was getInSetList_from_qcoord
273 #
274 def getSetListIncludedInQueryCoord(self, query, start, end):
275 pass
276
277 ## Give a a list of Path instances sorted by query coordinates
278 #
279 # @return lPaths list of Path instances
280 #
281 # @warning old name was getListOfPathsSortedByQueryCoord
282 #
283 def getPathListSortedByQueryCoord( self ):
284 pass
285
286 ## Give a a list of Path instances sorted by query coordinates for a given query
287 #
288 # @param queryName string query name
289 # @return lPaths list of Path instances
290 #
291 def getPathListSortedByQueryCoordFromQuery( self, queryName ):
292 pass
293
294 ## Give a list of path instances sorted by increasing E-value
295 #
296 # queryName string query name
297 # @return lPaths list of path instances
298 #
299 def getPathListSortedByIncreasingEvalueFromQuery( self, queryName ):
300 pass
301
302 ## Give a cumulative length of all paths (fragments) for a given subject name
303 #
304 # @param subjectName string subject name
305 # @return nb Cumulative length for all path
306 # @warning doesn't take into account the overlaps !!
307 # @warning old name was getCumulPathLength_from_subject
308 #
309 def getCumulLengthFromSubject( self, subjectName ):
310 pass
311
312 ## Give a list of the length of all chains of paths for a given subject name
313 #
314 # @param subjectName string name of the subject
315 # @return lChainLengths list of lengths per chain of paths
316 # @warning doesn't take into account the overlaps !!
317 # @warning old name was getListChainLength_from_subject
318 #
319 def getChainLengthListFromSubject( self, subjectName ):
320 pass
321
322 ## Give a list of identity of all chains of paths for a given subject name
323 #
324 # @param subjectName string name of the subject
325 # @return lChainIdentities list of identities per chain of paths
326 # @warning doesn't take into account the overlaps !!
327 # @warning old name was getListChainIdentity_from_subject
328 #
329 def getChainIdentityListFromSubject( self, subjectName ):
330 pass
331
332 ## Give a list of Path lists sorted by weighted identity.
333 #
334 # @param qry query name
335 # @return lChains list of chains
336 #
337 def getListOfChainsSortedByAscIdentityFromQuery( self, qry ):
338 pass
339
340 ## Give a list of the length of all paths for a given subject name
341 #
342 # @param subjectName string name of the subject
343 # @return lPathLengths list of lengths per path
344 # @warning doesn't take into account the overlaps !!
345 # @warning old name was getListPathLength_from_subject
346 #
347 def getPathLengthListFromSubject( self, subjectName ):
348 pass
349
350 ## Give a a list with all distinct identifiers for a given subject sorted in decreasing order according to the length of the chains
351 #
352 # @return lPathNums a list of paths Id
353 #
354 # @warning old name was getPathNumListSortedByDecreasingChainLengthFromSubject
355 #
356 def getIdListSortedByDecreasingChainLengthFromSubject( self, subjectName ):
357 pass
358
359 ## Give a list of Set instance list from the path contained on a query name
360 #
361 # @param query string query name
362 # @return lSet list of set instance
363 #
364 # @warning old name was getSetList_from_contig
365 #
366 def getSetListFromQuery(self, query):
367 pass
368
369 ## Delete path corresponding to a given identifier number
370 #
371 # @param id integer identifier number
372 #
373 # @warning old name was delPath_from_num
374 #
375 def deleteFromId(self,id):
376 pass
377
378 ## Delete path corresponding to a given list of identifier number
379 #
380 # @param lId list of identifier number
381 #
382 # @warning old name was delPath_from_numlist
383 #
384 def deleteFromIdList(self,lId):
385 pass
386
387 ## Join two path by changing id number of id1 and id2 path to the least of id1 and id2
388 #
389 # @param id1 integer path number
390 # @param id2 integer path number
391 # @return newId integer id used to join
392 #
393 # @warning old name was joinPath
394 #
395 def joinTwoPaths(self,id1,id2):
396 pass
397
398 ## Get a new id number
399 #
400 # @return newId integer new id
401 #
402 def getNewId(self):
403 pass
404
405 ## Test if table is empty
406 #
407 def isEmpty( self ):
408 pass
409
410 ## Create a 'pathRange' table from a 'path' table.
411 # The output table summarizes the information per identifier.
412 # The min and max value are taken.
413 # The identity is averaged over the fragments.
414 # It may overwrite an existing table.
415 #
416 # @param outTable string name of the output table
417 # @return outTable string Table which summarizes the information per identifier
418 #
419 def path2PathRange( self, outTable="" ):
420 pass
421
422 ## Return the number of times a given instance is present in the table
423 # The identifier is not considered,
424 # only coordinates, score, E-value and identity.
425 #
426 # @return nbOcc integer
427 #
428 def getNbOccurrences( self, iPath ):
429 pass