annotate SMART/Java/Python/structure/TranscriptContainer.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -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 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
2 # Copyright INRA-URGI 2009-2010
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
3 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
4 # This software is governed by the CeCILL license under French law and
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
5 # abiding by the rules of distribution of free software. You can use,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
6 # modify and/ or redistribute the software under the terms of the CeCILL
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
7 # license as circulated by CEA, CNRS and INRIA at the following URL
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
8 # "http://www.cecill.info".
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
9 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
10 # As a counterpart to the access to the source code and rights to copy,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
11 # modify and redistribute granted by the license, users are provided only
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
12 # with a limited warranty and the software's author, the holder of the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
13 # economic rights, and the successive licensors have only limited
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
14 # liability.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
15 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
16 # In this respect, the user's attention is drawn to the risks associated
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
17 # with loading, using, modifying and/or developing or reproducing the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
18 # software by the user in light of its specific status of free software,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
19 # that may mean that it is complicated to manipulate, and that also
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
20 # therefore means that it is reserved for developers and experienced
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
21 # professionals having in-depth computer knowledge. Users are therefore
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
22 # encouraged to load and test the software's suitability as regards their
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
23 # requirements in conditions enabling the security of their systems and/or
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
24 # data to be ensured and, more generally, to use and operate it in the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
25 # same conditions as regards security.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
26 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
27 # The fact that you are presently reading this means that you have had
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
28 # knowledge of the CeCILL license and that you accept its terms.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
29 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
30 import re
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
31 import sys
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
32 from commons.core.parsing.ParserChooser import ParserChooser
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
33 from SMART.Java.Python.mySql.MySqlTranscriptTable import MySqlTranscriptTable
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
34 from commons.core.writer.MySqlTranscriptWriter import MySqlTranscriptWriter
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
35
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
36 class TranscriptContainer(object):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
37 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
38 An interface class that contains a list of transcripts, handle different formats
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
39 @ivar container: container of the data
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
40 @type container: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
41 @ivar format: format of the data
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
42 @type format: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
43 @ivar transcriptListParser: possibly contains a parser to a list of transcripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
44 @type transcriptListParser: L{TranscriptListParser<TranscriptListParser>} or None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
45 @ivar mappingListParser: possibly contains a parser to a list of mappings
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
46 @type mappingListParser: L{MapperParser<MapperParser>} or None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
47 @ivar transcriptTables: possibly contains the mySQL tables
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
48 @type transcriptTables: dict of L{MySqlTranscriptTable<MySqlTranscriptTable>} or None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
49 @ivar mySqlConnection: connection to a MySQL database
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
50 @type mySqlConnection: class L{MySqlConnection<MySqlConnection>}
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
51 @ivar type: type of the data (transcripts, mappings or mySQL)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
52 @type type: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
53 @ivar verbosity: verbosity
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
54 @type verbosity: int
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
55 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
56
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
57 def __init__(self, container, format, verbosity = 0):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
58 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
59 Constructor
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
60 @param container: container of the data
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
61 @type container: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
62 @param format: format of the data
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
63 @type format: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
64 @param verbosity: verbosity
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
65 @type verbosity: int
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
66 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
67 self.container = container
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
68 self.format = format
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
69 self.verbosity = verbosity
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
70 self.transcriptListParser = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
71 self.mappingListParser = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
72 self.transcriptTables = {}
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
73 self.mySqlConnection = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
74 self.foundData = False
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
75 self.nbTranscripts = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
76 self.nbNucleotides = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
77 self.chromosomes = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
78 self.type = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
79 if self.container == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
80 sys.exit("Error! Container input file name is empty!")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
81 if self.format == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
82 sys.exit("Error! Container input format is empty!")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
83
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
84
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
85 def findData(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
86 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
87 Load data
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
88 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
89 if self.format == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
90 sys.exit("Error! Format is not specified!")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
91 if self.format == "sql":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
92 self.transcriptTables = {}
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
93 self.chromosomes = []
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
94 self.nbTranscripts = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
95 self.nbNucleotides = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
96 self.type = "sql"
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
97 query = self.mySqlConnection.executeQuery("SELECT name FROM sqlite_master WHERE type LIKE 'table' AND name LIKE '%s_%%_transcripts'" % (self.container))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
98 for line in query.getIterator():
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
99 tableName = line[0]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
100 m = re.search(r"^(\S*)_transcripts$", tableName[len(self.container)+1:])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
101 if m == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
102 sys.exit("Table '%s' has a strange name" % (tableName))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
103 chromosome = m.group(1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
104 self.transcriptTables[chromosome] = MySqlTranscriptTable(self.mySqlConnection, self.container, chromosome, self.verbosity)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
105 self.chromosomes.append(chromosome)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
106 for transcript in self.transcriptTables[chromosome].getIterator():
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
107 self.nbTranscripts += 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
108 self.nbNucleotides += transcript.getSize()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
109 if self.type == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
110 parserChooser = ParserChooser(self.verbosity)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
111 parserChooser.findFormat(self.format)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
112 self.type = parserChooser.getType()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
113 if self.type == "transcript":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
114 self.transcriptListParser = parserChooser.getParser(self.container)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
115 elif self.type == "mapping":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
116 self.mappingListParser = parserChooser.getParser(self.container)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
117 else:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
118 sys.exit("Error! Cannot handle format '%s'!" % (self.format))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
119 if self.type == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
120 sys.exit("Error! Cannot handle format '%s'!" % (self.format))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
121
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
122 if self.transcriptListParser != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
123 if self.type == "transcript":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
124 self.nbTranscripts = self.transcriptListParser.getNbTranscripts()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
125 self.nbNucleotides = self.transcriptListParser.getNbNucleotides()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
126 self.chromosomes = self.transcriptListParser.getChromosomes()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
127 if self.mappingListParser != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
128 if self.type == "mapping":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
129 self.nbTranscripts = self.mappingListParser.getNbMappings()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
130 self.nbNucleotides = self.mappingListParser.getNbNucleotides()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
131 self.chromosomes = self.mappingListParser.getChromosomes()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
132
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
133 self.foundData = True
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
134
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
135
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
136 def getNbTranscripts(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
137 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
138 Get the number of transcripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
139 @return: the number of transcripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
140 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
141 if not self.foundData:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
142 self.findData()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
143 return self.nbTranscripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
144
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
145
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
146 def getNbItems(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
147 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
148 Same as getNbTranscripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
149 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
150 return self.getNbTranscripts()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
151
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
152
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
153 def getNbNucleotides(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
154 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
155 Get the number of nucleotides
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
156 @return: the number of nucleotides
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
157 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
158 if not self.foundData:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
159 self.findData()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
160 return self.nbNucleotides
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
161
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
162
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
163 def getChromosomes(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
164 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
165 Get the chromosomes
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
166 @return: the chromosomes
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
167 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
168 if not self.foundData:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
169 self.findData()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
170 return self.chromosomes
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
171
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
172
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
173 def getIterator(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
174 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
175 An iterator
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
176 @return: an iterator to a list of transcripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
177 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
178 if not self.foundData:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
179 self.findData()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
180 if self.type == "sql":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
181 for chromosome in self.transcriptTables:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
182 for transcript in self.transcriptTables[chromosome].getIterator():
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
183 yield transcript
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
184 return
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
185 if self.type == "transcript":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
186 for transcript in self.transcriptListParser.getIterator():
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
187 yield transcript
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
188 return
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
189 if self.type == "mapping":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
190 for mapping in self.mappingListParser.getIterator():
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
191 yield mapping.getTranscript()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
192 return
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
193 sys.exit("Error! No valid transcript container given!")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
194
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
195
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
196 def storeIntoDatabase(self, name = None):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
197 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
198 Store the current transcript / mapping list into database
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
199 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
200 if not self.foundData:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
201 self.findData()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
202
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
203 if (self.transcriptListParser == None and self.mappingListParser == None) or len(self.transcriptTables.keys()) != 0:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
204 return
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
205
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
206 mySqlTranscriptWriter = MySqlTranscriptWriter(self.mySqlConnection, name, self.verbosity)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
207 mySqlTranscriptWriter.addTranscriptList(self.transcriptListParser if self.transcriptListParser else self.mappingListParser)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
208 mySqlTranscriptWriter.write()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
209 self.transcriptTables = mySqlTranscriptWriter.getTables()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
210 self.type = "sql"
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
211
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
212
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
213 def getTables(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
214 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
215 Accessor to the mySQL tables
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
216 @return: the mySQL tables
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
217 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
218 return self.transcriptTables
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
219
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
220
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
221 def setDefaultTagValue(self, name, value):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
222 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
223 Set the given tag to the value for all transcripts
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
224 @param name: name of the tag
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
225 @type name: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
226 @param value: value of the tag
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
227 @type value: string
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
228 """
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
229 if self.type == "sql":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
230 for chromosome in self.transcriptTables:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
231 self.transcriptTables[chromosome].setDefaultTagValue(name, value)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
232 elif self.type == "transcript":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
233 self.transcriptListParser.setDefaultTagValue(name, value)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
234 elif self.type == "mapping":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
235 self.mappingListParser.setDefaultTagValue(name, value)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
236